From: Yunlong Song <yunlong.song@huawei.com>
To: Chao Yu <yuchao0@huawei.com>, <jaegeuk@kernel.org>,
<chao@kernel.org>, <yunlong.song@icloud.com>
Cc: <miaoxie@huawei.com>, <bintian.wang@huawei.com>,
<shengyong1@huawei.com>, <heyunlei@huawei.com>,
<linux-f2fs-devel@lists.sourceforge.net>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] f2fs: clear victim_secmap when section has full valid blocks
Date: Tue, 24 Jul 2018 19:42:53 +0800 [thread overview]
Message-ID: <087b0b73-83b3-1d2a-99cc-bd4f451841bf@huawei.com> (raw)
In-Reply-To: <8026538e-2a8b-fad4-82b1-9bb2c04e097d@huawei.com>
Just in case, or maybe this patch should be put after [patch 2/5],which
let BG_GC avoids
skipping BG_GC victim, then SSR can also select the BG_GC victim to
allocate data blocks,
which can make bggc selected section get back to full state.
On 2018/7/24 17:36, Chao Yu wrote:
> On 2018/7/24 17:27, Yunlong Song wrote:
>> Without this patch, f2fs only clears victim_secmap when it finds out
>> that the section has no valid blocks at all, but forgets to clear the
>> victim_secmap when the whole section has full valid blocks.
> Look this patch again, I have a question, why bggc selected section can
> get back to full state?
>
> Thanks,
>
>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>> ---
>> fs/f2fs/segment.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index cfff7cf..0a79554 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -776,7 +776,8 @@ static void __remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
>> if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t]))
>> dirty_i->nr_dirty[t]--;
>>
>> - if (get_valid_blocks(sbi, segno, true) == 0)
>> + if (get_valid_blocks(sbi, segno, true) == 0 ||
>> + get_valid_blocks(sbi, segno, true) == BLKS_PER_SEC(sbi))
>> clear_bit(GET_SEC_FROM_SEG(sbi, segno),
>> dirty_i->victim_secmap);
>> }
>>
>
> .
>
--
Thanks,
Yunlong Song
prev parent reply other threads:[~2018-07-24 11:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 14:10 [PATCH 0/5] f2fs: fix and improve for victim_secmap Yunlong Song
2018-07-23 14:10 ` [PATCH 1/5] f2fs: clear victim_secmap when section has full valid blocks Yunlong Song
2018-07-24 2:52 ` Chao Yu
2018-07-23 14:10 ` [PATCH 2/5] f2fs: add cur_victim_sec for BG_GC to avoid skipping BG_GC victim Yunlong Song
2018-07-24 13:11 ` Chao Yu
2018-07-24 13:39 ` Yunlong Song
2018-07-24 14:17 ` Chao Yu
2018-07-24 15:19 ` Yunlong Song
2018-07-25 15:48 ` Chao Yu
2018-07-23 14:10 ` [PATCH 3/5] f2fs: clear_bit the SSR selected section in the victim_secmap Yunlong Song
2018-07-23 20:48 ` kbuild test robot
2018-07-23 14:10 ` [PATCH 4/5] f2fs: let BG_GC check every dirty segments and gc over a threshold Yunlong Song
2018-07-24 14:52 ` Chao Yu
2018-07-24 16:01 ` Yunlong Song
2018-07-23 14:10 ` [PATCH 5/5] f2fs: add proc entry to show victim_secmap bitmap Yunlong Song
2018-07-24 15:06 ` Chao Yu
2018-07-24 9:27 ` [PATCH v2] f2fs: clear victim_secmap when section has full valid blocks Yunlong Song
2018-07-24 9:36 ` Chao Yu
2018-07-24 11:42 ` Yunlong Song [this message]
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=087b0b73-83b3-1d2a-99cc-bd4f451841bf@huawei.com \
--to=yunlong.song@huawei.com \
--cc=bintian.wang@huawei.com \
--cc=chao@kernel.org \
--cc=heyunlei@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=shengyong1@huawei.com \
--cc=yuchao0@huawei.com \
--cc=yunlong.song@icloud.com \
/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;
as well as URLs for NNTP newsgroup(s).