mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments
Date: Tue, 11 Aug 2015 22:09:16 -0700	[thread overview]
Message-ID: <20150812050916.GA22780@jaegeuk-mac02.hsd1.ca.comcast.net> (raw)
In-Reply-To: <1439256205-8906-2-git-send-email-jaegeuk@kernel.org>

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


  reply	other threads:[~2015-08-12  5:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11  1:23 [PATCH 1/2] f2fs: increase the number of max hard links Jaegeuk Kim
2015-08-11  1:23 ` [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim
2015-08-12  5:09   ` Jaegeuk Kim [this message]
2015-08-12  9:43     ` [f2fs-dev] [PATCH 2/2 v2] " Chao Yu
2015-08-13  1:26       ` [f2fs-dev] [PATCH 2/2 v3] " Jaegeuk Kim
2015-08-12  9:42 ` [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links Chao Yu
2015-08-14 23:22   ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150812050916.GA22780@jaegeuk-mac02.hsd1.ca.comcast.net \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®