Skip to content

Commit 8fd5a37

Browse files
author
Jaegeuk Kim
committed
f2fs: avoid frequent checkpoint during f2fs_gc
Now we're doing SSR aggressively more than ever before, so once we reach to the reserved_segment, f2fs_balance_fs will call f2fs_gc, which triggers checkpoint everytime. We actually must avoid that. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 4ddb1a4 commit 8fd5a37

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎fs/f2fs/gc.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,11 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
966966
* threshold, we can make them free by checkpoint. Then, we
967967
* secure free segments which doesn't need fggc any more.
968968
*/
969-
ret = write_checkpoint(sbi, &cpc);
970-
if (ret)
971-
goto stop;
969+
if (prefree_segments(sbi)) {
970+
ret = write_checkpoint(sbi, &cpc);
971+
if (ret)
972+
goto stop;
973+
}
972974
if (has_not_enough_free_secs(sbi, 0, 0))
973975
gc_type = FG_GC;
974976
}

0 commit comments

Comments
 (0)