f2fs: avoid BG_GC in f2fs_balance_fs
If many threads hit has_not_enough_free_secs() in f2fs_balance_fs() at the same time, all the threads would do FG_GC or BG_GC. In this critical path, we totally don't need to do BG_GC at all. Let's avoid that. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -366,7 +366,7 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need)
|
||||
*/
|
||||
if (has_not_enough_free_secs(sbi, 0, 0)) {
|
||||
mutex_lock(&sbi->gc_mutex);
|
||||
f2fs_gc(sbi, false);
|
||||
f2fs_gc(sbi, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user