[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ea7ce0e-b40e-e80b-55b6-8256b3e9c2c1@huawei.com>
Date: Mon, 17 Feb 2020 09:40:48 +0800
From: Chao Yu <yuchao0@...wei.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 1/3] f2fs: skip GC when section is full
On 2020/2/15 2:58, Jaegeuk Kim wrote:
> This fixes skipping GC when segment is full in large section.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
> ---
> fs/f2fs/gc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 53312d7bc78b..65c0687ee2bb 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1018,8 +1018,8 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
> * race condition along with SSR block allocation.
> */
> if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
> - get_valid_blocks(sbi, segno, false) ==
> - sbi->blocks_per_seg)
> + get_valid_blocks(sbi, segno, true) ==
> + BLKS_PER_SEC(sbi))
Then in large section, if current segment is all valid, we won't skip scanning
it, so do we need to change like this:
if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
get_valid_blocks(sbi, segno, false) == sbi->blocks_per_seg ||
get_valid_blocks(sbi, segno, true) == BLKS_PER_SEC(sbi))
return submitted;
> return submitted;
>
> if (check_valid_map(sbi, segno, off) == 0)
>
Powered by blists - more mailing lists