[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221122085649epcms2p5b72ef048e5ac93c02859611fd2233c3a@epcms2p5>
Date: Tue, 22 Nov 2022 17:56:49 +0900
From: Yonggil Song <yonggil.song@...sung.com>
To: Chao Yu <chao@...nel.org>,
"jaegeuk@...nel.org" <jaegeuk@...nel.org>,
"linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE:(2) [PATCH v1] f2fs: avoid victim selection from previous victim
section
Hi Chao,
Thanks for your review.
I'll fix this and resend a mail.
Thanks
>Hi Yonggil,
>
>I guess your email client forces converting tab and space characters of
>patch, please check that.
>
>On 2022/11/22 10:36, Yonggil Song wrote:
>> When f2fs chooses GC victim in large section & LFS mode,
>> next_victim_seg[gc_type] is referenced first. After segment is freed,
>> next_victim_seg[gc_type] has the next segment number.
>> However, next_victim_seg[gc_type] still has the last segment number
>> even after the last segment of section is freed. In this case, when f2fs
>> chooses a victim for the next GC round, the last segment of previous victim
>> section is chosen as a victim.
>>
>> Initialize next_victim_seg[gc_type] to NULL_SEGNO for the last segment in
>> large section.
>>
>> Fixes: e3080b0120a1 ("f2fs: support subsectional garbage collection")
>
>Good catch, I'm fine with this fix.
>
>Thanks,
>
>> Signed-off-by: Yonggil Song <yonggil.song@...sung.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 4546e01b2ee0..10677d53ef0e 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -1744,8 +1744,9 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
>> get_valid_blocks(sbi, segno, false) == 0)
>> seg_freed++;
>>
>> - if (__is_large_section(sbi) && segno + 1 < end_segno)
>> - sbi->next_victim_seg[gc_type] = segno + 1;
>> + if (__is_large_section(sbi))
>> + sbi->next_victim_seg[gc_type] =
>> + (segno + 1 < end_segno) ? segno + 1 : NULL_SEGNO;
>> skip:
>> f2fs_put_page(sum_page, 0);
>> }
>> --
>> 2.34.1
Powered by blists - more mailing lists