Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1620796

[PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc

From Jaegeuk Kim <jaegeuk@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc
Date 2017-04-11 02:20 +0200
Message-ID <tuRHk-81J-17@gated-at.bofh.it> (permalink)
References <tuRHk-81J-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/gc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e2f9b2b12b74..4a720f3394d9 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -966,7 +966,11 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
 		 * 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 (prefree_segments(sbi)) {
+			ret = write_checkpoint(sbi, &cpc);
+			if (ret)
+				goto stop;
+		}
 		if (ret)
 			goto stop;
 		if (has_not_enough_free_secs(sbi, 0, 0))
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] f2fs: use segment number for get_valid_blocks Jaegeuk Kim <jaegeuk@kernel.org> - 2017-04-11 02:20 +0200
  [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc Jaegeuk Kim <jaegeuk@kernel.org> - 2017-04-11 02:20 +0200
    Re: [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc Chao Yu <yuchao0@huawei.com> - 2017-04-11 03:50 +0200
      Re: [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc Jaegeuk Kim <jaegeuk@kernel.org> - 2017-04-12 00:20 +0200
  [PATCH 3/4] f2fs: clean up some macros in terms of GET_SEGNO Jaegeuk Kim <jaegeuk@kernel.org> - 2017-04-11 02:20 +0200
  [PATCH 2/4] f2fs: clean up get_valid_blocks with consistent parameter Jaegeuk Kim <jaegeuk@kernel.org> - 2017-04-11 02:20 +0200

csiph-web