mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc
Date: Tue, 11 Apr 2017 09:42:15 +0800	[thread overview]
Message-ID: <af677bdd-bf75-a928-1c4c-541642199b4b@huawei.com> (raw)
In-Reply-To: <20170411001308.12881-4-jaegeuk@kernel.org>

On 2017/4/11 8:13, Jaegeuk Kim wrote:
> 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;

We don't need redundant check here?

Otherwise, this patchset looks good to me, anyway please add:

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

>  		if (has_not_enough_free_secs(sbi, 0, 0))
> 

  reply	other threads:[~2017-04-11  1:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  0:13 [PATCH 1/4] f2fs: use segment number for get_valid_blocks Jaegeuk Kim
2017-04-11  0:13 ` [PATCH 2/4] f2fs: clean up get_valid_blocks with consistent parameter Jaegeuk Kim
2017-04-11  0:13 ` [PATCH 3/4] f2fs: clean up some macros in terms of GET_SEGNO Jaegeuk Kim
2017-04-11  0:13 ` [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc Jaegeuk Kim
2017-04-11  1:42   ` Chao Yu [this message]
2017-04-11 22:13     ` 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=af677bdd-bf75-a928-1c4c-541642199b4b@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=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®