[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241014014341epcms2p3467a0b744b7bfc269871c8e75e80c896@epcms2p3>
Date: Mon, 14 Oct 2024 10:43:41 +0900
From: Yonggil Song <yonggil.song@...sung.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>
CC: Chao Yu <chao@...nel.org>, "linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Dongjin Kim <dongjin_.kim@...sung.com>,
Siwoo Jung <siu.jung@...sung.com>, Daejun Park <daejun7.park@...sung.com>,
Yonggil Song <yonggil.song@...sung.com>
Subject: RE:(2) [PATCH v2] libf2fs: Fix calculation of usable segments for
single
> 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@...sung.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
Powered by blists - more mailing lists