Commit 8fd5a37e authored by Jaegeuk Kim's avatar Jaegeuk Kim

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 4ddb1a4d
...@@ -966,9 +966,11 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background) ...@@ -966,9 +966,11 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
* threshold, we can make them free by checkpoint. Then, we * threshold, we can make them free by checkpoint. Then, we
* secure free segments which doesn't need fggc any more. * secure free segments which doesn't need fggc any more.
*/ */
if (prefree_segments(sbi)) {
ret = write_checkpoint(sbi, &cpc); ret = write_checkpoint(sbi, &cpc);
if (ret) if (ret)
goto stop; goto stop;
}
if (has_not_enough_free_secs(sbi, 0, 0)) if (has_not_enough_free_secs(sbi, 0, 0))
gc_type = FG_GC; gc_type = FG_GC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment