From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Yonggil Song <yonggil.song@samsung.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>,
Siwoo Jung <siu.jung@samsung.com>,
Dongjin Kim <dongjin_.kim@samsung.com>
Subject: Re: [f2fs-dev] [PATCH v2] libf2fs: Fix calculation of usable segments for single
Date: Fri, 11 Oct 2024 15:34:40 +0000 [thread overview]
Message-ID: <ZwlFkBAV2yxf1DBt@google.com> (raw)
In-Reply-To: <20241010045935epcms2p7ab5f54e9789b36ea496abcb100a7878f@epcms2p7>
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?
> + 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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yonggil Song <yonggil.song@samsung.com>
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>
Subject: Re: [PATCH v2] libf2fs: Fix calculation of usable segments for single
Date: Fri, 11 Oct 2024 15:34:40 +0000 [thread overview]
Message-ID: <ZwlFkBAV2yxf1DBt@google.com> (raw)
In-Reply-To: <20241010045935epcms2p7ab5f54e9789b36ea496abcb100a7878f@epcms2p7>
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?
> + 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-11 15:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20241007052122epcms2p8a7a733c92a8da751ac64af8a29de0303@epcms2p8>
2024-10-07 5:21 ` [f2fs-dev] [PATCH] libf2fs: Fix calculation of usable segments for single zoned Yonggil Song
2024-10-07 5:21 ` Yonggil Song
2024-10-08 9:02 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2024-10-08 9:02 ` Chao Yu
2024-10-10 2:15 ` [f2fs-dev] (2) " Yonggil Song
2024-10-10 2:15 ` Yonggil Song
2024-10-10 4:31 ` [f2fs-dev] (3) " Yonggil Song
2024-10-10 4:31 ` Yonggil Song
2024-10-10 4:59 ` [f2fs-dev] [PATCH v2] libf2fs: Fix calculation of usable segments for single Yonggil Song
2024-10-10 4:59 ` Yonggil Song
2024-10-10 5:08 ` [f2fs-dev] [RESEND][PATCH v2] libf2fs: Fix calculation of usable segments for single zoned device Yonggil Song
2024-10-10 5:08 ` Yonggil Song
2024-10-11 15:34 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2024-10-11 15:34 ` [PATCH v2] libf2fs: Fix calculation of usable segments for single Jaegeuk Kim
2024-10-14 1:43 ` [f2fs-dev] (2) " Yonggil Song
2024-10-14 1:43 ` Yonggil Song
2024-10-08 13:16 ` [f2fs-dev] [PATCH] libf2fs: Fix calculation of usable segments for single zoned Markus Elfring via Linux-f2fs-devel
2024-10-08 13:16 ` Markus Elfring
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=ZwlFkBAV2yxf1DBt@google.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=dongjin_.kim@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=siu.jung@samsung.com \
--cc=yonggil.song@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.