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


Groups > linux.kernel > #1205588

Re: [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments

From Jaegeuk Kim <jaegeuk@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments
Date 2015-08-12 07:10 +0200
Message-ID <pWwsx-2Cs-3@gated-at.bofh.it> (permalink)
References <pW6y5-6TZ-5@gated-at.bofh.it> <pW6y5-6TZ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Change log from v1:
 - fix skipping gc incorrectly

From 06f90d3757a6b7ff524cc112168488f31bbf830f Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 11 Aug 2015 21:59:49 -0700
Subject: [PATCH] f2fs: skip checkpoint if there is no dirty and prefree
 segments

We should avoid needless checkpoints when there is no dirty and prefree segment.

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

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..98bf538 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -811,7 +811,8 @@ gc_more:
 
 	if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
 		gc_type = FG_GC;
-		write_checkpoint(sbi, &cpc);
+		if (dirty_segments(sbi) || prefree_segments(sbi))
+			write_checkpoint(sbi, &cpc);
 	}
 
 	if (!__get_victim(sbi, &segno, gc_type))
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim <jaegeuk@kernel.org> - 2015-08-11 03:30 +0200
  Re: [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty  segments Jaegeuk Kim <jaegeuk@kernel.org> - 2015-08-12 07:10 +0200
    RE: [f2fs-dev] [PATCH 2/2 v2] f2fs: skip checkpoint if there is no  dirty segments Chao Yu <chao2.yu@samsung.com> - 2015-08-12 11:50 +0200
      Re: [f2fs-dev] [PATCH 2/2 v3] f2fs: skip checkpoint if there is no  dirty segments Jaegeuk Kim <jaegeuk@kernel.org> - 2015-08-13 03:30 +0200

csiph-web