[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b18c286a-cc72-439c-b373-98e0d6504618@kernel.org>
Date: Fri, 26 Jan 2024 09:27:10 +0800
From: Chao Yu <chao@...nel.org>
To: Daeho Jeong <daeho43@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
kernel-team@...roid.com, Daeho Jeong <daehojeong@...gle.com>,
Yongpeng Yang <yangyongpeng1@...o.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: allocate logs after conventional
area for HM zoned devices
On 2024/1/26 0:25, Daeho Jeong wrote:
> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@...nel.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.
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@...gle.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@...gle.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);
Powered by blists - more mailing lists