From: Yonggil Song <yonggil.song@samsung.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Chao Yu <chao@kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Dongjin Kim <dongjin_.kim@samsung.com>,
Siwoo Jung <siu.jung@samsung.com>,
Daejun Park <daejun7.park@samsung.com>,
Yonggil Song <yonggil.song@samsung.com>
Subject: RE:(2) [PATCH v2] libf2fs: Fix calculation of usable segments for single
Date: Mon, 14 Oct 2024 10:43:41 +0900 [thread overview]
Message-ID: <20241014014341epcms2p3467a0b744b7bfc269871c8e75e80c896@epcms2p3> (raw)
In-Reply-To: <ZwlFkBAV2yxf1DBt@google.com>
> On 10/10, Yonggil Song wrote:
> > There was a problem that did not subtract the super block area when calculating
> > the usable segments for a single zoned device with a conventional zone.
> > This resulted in incorrect the overprovision and reserved area.
> >
> > <256MiB legacy block + zoned block w/ 32MiB zone size>
> > Info: Overprovision ratio = 3.570%
> > Info: Overprovision segments = 656 (GC reserved = 560)
> >
> > <8 conventional zone + 1016 sequential zone w/ 32MiB zone size>
> > Info: Overprovision ratio = 3.700%
> > Info: Overprovision segments = 676 (GC reserved = 578)
> >
> > This patch addresses the problem by subtracting the super block area when
> > there is only one zoned device.
> >
> > Signed-off-by: Yonggil Song <yonggil.song@samsung.com>
> > ---
> > lib/libf2fs_zoned.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c
> > index 89ba5ad73a76..1a0985378789 100644
> > --- a/lib/libf2fs_zoned.c
> > +++ b/lib/libf2fs_zoned.c
> > @@ -555,6 +555,11 @@ uint32_t f2fs_get_usable_segments(struct f2fs_super_block *sb)
> > }
> > usable_segs -= (get_sb(main_blkaddr) - get_sb(segment0_blkaddr)) >>
> > get_sb(log_blocks_per_seg);
> > +
> > + /* single zoned device needs to remove a super block area */
> > + if (c.ndevs == 1 && c.devices[0].zoned_model == F2FS_ZONED_HM)
>
> Does this work?
>
Yes, it works.
I have attached the results of test on null_blk below.
If you have any concerns, please feedback.
before after
legacy block (32GB) 136 (GC reserved = 130) 136 (GC reserved = 130)
single zoned block 676 (GC reserved = 578) 656 (GC reserved = 560)
(32GB, 32MB zone, 8 conv, 1016 seq)
legacy + zoned multi 656 (GC reserved = 560) 656 (GC reserved = 560)
(32GB, 256MB legacy block + 32MB zone, 1016 seq)
Thanks.
> > + usable_segs -= (get_sb(segment0_blkaddr) >> get_sb(log_blocks_per_seg));
> > +
> > return usable_segs;
> > #endif
> > return get_sb(segment_count_main);
> > --
> > 2.43.0
next prev parent reply other threads:[~2024-10-14 1:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20241007052122epcms2p8a7a733c92a8da751ac64af8a29de0303@epcms2p8>
2024-10-07 5:21 ` [PATCH] libf2fs: Fix calculation of usable segments for single zoned Yonggil Song
2024-10-08 9:02 ` Chao Yu
2024-10-08 13:16 ` Markus Elfring
[not found] ` <CGME20241007052122epcms2p8a7a733c92a8da751ac64af8a29de0303@epcms2p2>
2024-10-10 2:15 ` Yonggil Song
2024-10-10 4:31 ` Yonggil Song
[not found] ` <CGME20241007052122epcms2p8a7a733c92a8da751ac64af8a29de0303@epcms2p7>
2024-10-10 4:59 ` [PATCH v2] libf2fs: Fix calculation of usable segments for single Yonggil Song
2024-10-11 15:34 ` Jaegeuk Kim
[not found] ` <CGME20241007052122epcms2p8a7a733c92a8da751ac64af8a29de0303@epcms2p3>
2024-10-14 1:43 ` Yonggil Song [this message]
2024-10-10 5:08 ` [RESEND][PATCH v2] libf2fs: Fix calculation of usable segments for single zoned device Yonggil Song
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=20241014014341epcms2p3467a0b744b7bfc269871c8e75e80c896@epcms2p3 \
--to=yonggil.song@samsung.com \
--cc=chao@kernel.org \
--cc=daejun7.park@samsung.com \
--cc=dongjin_.kim@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=siu.jung@samsung.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
all inboxes | Powered by JetHome®