diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-08 03:25:54 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-12 01:12:39 +0300 |
commit | 8fd5a37efa0b036353df253e20dabe8773c039cd (patch) | |
tree | c8a4fb7d75fb4868c39a758eb59bfc4dce052d7b /fs/f2fs | |
parent | 4ddb1a4d4dc20642073b7d92400a67b67601fe6f (diff) | |
download | linux-8fd5a37efa0b036353df253e20dabe8773c039cd.tar.xz |
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')
-rw-r--r-- | fs/f2fs/gc.c | 8 |
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; } |