From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao2.yu@samsung.com>
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: fix to correct freed section number during gc
Date: Tue, 22 Sep 2015 15:53:52 -0700 [thread overview]
Message-ID: <20150922225352.GA31427@jaegeuk-mac02.mot.com> (raw)
In-Reply-To: <00d601d0f539$3d893e90$b89bbbb0$@samsung.com>
Hi Chao,
On Tue, Sep 22, 2015 at 09:18:18PM +0800, Chao Yu wrote:
> We pass 'nfree' to has_not_enough_free_secs to check whether there is
> enough free section, but 'nfree' indicates the number of segment gced,
> should alter the value to section number.
Yeah, but I think we need to increase nfree only when an entire section is gced
completely, since sometimes nfree can be increased across sections.
Thanks,
>
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
> fs/f2fs/gc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index e932740..7ad2a60 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -817,7 +817,8 @@ gc_more:
> if (unlikely(f2fs_cp_error(sbi)))
> goto stop;
>
> - if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
> + if (gc_type == BG_GC &&
> + has_not_enough_free_secs(sbi, nfree / sbi->segs_per_sec)) {
> gc_type = FG_GC;
> if (__get_victim(sbi, &segno, gc_type) || prefree_segments(sbi))
> write_checkpoint(sbi, &cpc);
> @@ -839,7 +840,7 @@ gc_more:
> if (gc_type == FG_GC)
> sbi->cur_victim_sec = NULL_SEGNO;
>
> - if (has_not_enough_free_secs(sbi, nfree))
> + if (has_not_enough_free_secs(sbi, nfree / sbi->segs_per_sec))
> goto gc_more;
>
> if (gc_type == FG_GC)
> --
> 2.5.2
next prev parent reply other threads:[~2015-09-22 22:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 13:18 Chao Yu
2015-09-22 22:53 ` Jaegeuk Kim [this message]
2015-09-23 10:11 ` Chao Yu
2015-09-23 21:08 ` Jaegeuk Kim
2015-09-25 12:43 ` [f2fs-dev] " Chao Yu
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=20150922225352.GA31427@jaegeuk-mac02.mot.com \
--to=jaegeuk@kernel.org \
--cc=chao2.yu@samsung.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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®