summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-04-07 17:25:54 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-04-11 15:12:39 -0700
commit8fd5a37efa0b036353df253e20dabe8773c039cd (patch)
treec8a4fb7d75fb4868c39a758eb59bfc4dce052d7b /fs/f2fs/gc.c
parent4ddb1a4d4dc20642073b7d92400a67b67601fe6f (diff)
downloadlinux-8fd5a37efa0b036353df253e20dabe8773c039cd.tar.gz
linux-8fd5a37efa0b036353df253e20dabe8773c039cd.tar.bz2
linux-8fd5a37efa0b036353df253e20dabe8773c039cd.zip
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>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e2f9b2b12b74..9172112d6246 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -966,9 +966,11 @@ gc_more:
* threshold, we can make them free by checkpoint. Then, we
* secure free segments which doesn't need fggc any more.
*/
- ret = write_checkpoint(sbi, &cpc);
- if (ret)
- goto stop;
+ if (prefree_segments(sbi)) {
+ ret = write_checkpoint(sbi, &cpc);
+ if (ret)
+ goto stop;
+ }
if (has_not_enough_free_secs(sbi, 0, 0))
gc_type = FG_GC;
}