From: Chao Yu <chao@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com,
Daeho Jeong <daehojeong@google.com>,
Yongpeng Yang <yangyongpeng1@oppo.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: allocate logs after conventional area for HM zoned devices
Date: Mon, 29 Jan 2024 09:27:44 +0800 [thread overview]
Message-ID: <e879da72-4c4f-4aed-8081-784f2de5c887@kernel.org> (raw)
In-Reply-To: <CACOAw_yqrtEhq4wtJbs7CVn260h7iZyC7koCWH1iMyeQo5140g@mail.gmail.com>
On 2024/1/27 2:17, Daeho Jeong wrote:
> On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote:
>>
>> On 2024/1/26 0:25, Daeho Jeong wrote:
>>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote:
>>>>
>>>> +Cc Yongpeng Yang
>>>>
>>>> Daeho,
>>>>
>>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is
>>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed
>>>> end boundary of mainarea. Could you please check that? though it's a corner
>>>> case.
>>>
>>> Can you elaborate more?
>>
>> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr.
>
> Oh, Got it.
> Then, how about this?
>
> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ?
> (c.devices[1].start_blkaddr -
> get_sb(main_blkaddr)) / c.blks_per_seg : 0;
Better, but log header should align to start blkaddr of zone?
Thanks,
>
>> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments,
>> and c.devices[0].total_segments is larger than segments of mainare,
>> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea.
>>
>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ?
>> c.devices[0].total_segments : 0;
>>
>>> In the case of F2FS_ZONED_HM, we have the devices[1].
>>> Do you mean the case we format the filesystem intentionally smaller
>>> than what devices have?
>>
>> I mean blew case:
>> device[0]: conventional device size = 10240 MB
>> device[1]: zone device size = 2 MB
>>
>> Thanks,
>>
>>>
>>>>
>>>> On 2024/1/18 7:00, Daeho Jeong wrote:
>>>>> From: Daeho Jeong <daehojeong@google.com>
>>>>>
>>>>> Make to allocate logs after conventional area for HM zoned devices to
>>>>> spare them for file pinning support.
>>>>>
>>>>> Signed-off-by: Daeho Jeong <daehojeong@google.com>
>>>>> ---
>>>>> mkfs/f2fs_format.c | 3 ++-
>>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
>>>>> index f2840c8..91a7f4b 100644
>>>>> --- a/mkfs/f2fs_format.c
>>>>> +++ b/mkfs/f2fs_format.c
>>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void)
>>>>> c.cur_seg[CURSEG_COLD_DATA] = 0;
>>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA);
>>>>> } else if (c.zoned_mode) {
>>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0;
>>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ?
>>>>> + c.devices[0].total_segments : 0;
>>>>> c.cur_seg[CURSEG_WARM_NODE] = next_zone(CURSEG_HOT_NODE);
>>>>> c.cur_seg[CURSEG_COLD_NODE] = next_zone(CURSEG_WARM_NODE);
>>>>> c.cur_seg[CURSEG_HOT_DATA] = next_zone(CURSEG_COLD_NODE);
next prev parent reply other threads:[~2024-01-29 1:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 23:00 [PATCH] f2fs-tools: allocate logs after conventional area for HM zoned devices Daeho Jeong
2024-01-22 6:40 ` [f2fs-dev] " Chao Yu
2024-01-25 3:34 ` Chao Yu
2024-01-25 16:25 ` Daeho Jeong
2024-01-26 1:27 ` Chao Yu
2024-01-26 18:17 ` Daeho Jeong
2024-01-29 1:27 ` Chao Yu [this message]
2024-01-29 15:47 ` Daeho Jeong
2024-01-30 2:17 ` Yongpeng Yang
[not found] ` <CACOAw_zKTPD5epxD2RsvarDJJUxz8LEhFvkWJex19XtY9hxa0w@mail.gmail.com>
2024-01-31 2:14 ` Yongpeng Yang
2024-01-30 14:29 ` 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=e879da72-4c4f-4aed-8081-784f2de5c887@kernel.org \
--to=chao@kernel.org \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yangyongpeng1@oppo.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