* [PATCH] f2fs: subtract current_reserved_blocks from total
@ 2025-03-04 19:20 Daeho Jeong
2025-03-05 9:10 ` [f2fs-dev] " Chao Yu
0 siblings, 1 reply; 4+ messages in thread
From: Daeho Jeong @ 2025-03-04 19:20 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
From: Daeho Jeong <daehojeong@google.com>
current_reserved_blocks is not allowed to utilize. For some zoned
storage devices, vendors will provide extra space which was used for
device level GC than specs and we will use this space for filesystem
level GC. This extra space should not be shown to users, otherwise,
users will see not standardized size number like 530GB, not 512GB.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
fs/f2fs/super.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 19b67828ae32..c346dcc2518a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_type = F2FS_SUPER_MAGIC;
buf->f_bsize = sbi->blocksize;
- buf->f_blocks = total_count - start_count;
-
spin_lock(&sbi->stat_lock);
+ buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks;
user_block_count = sbi->user_block_count;
total_valid_node_count = valid_node_count(sbi);
avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;
--
2.48.1.711.g2feabab25a-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: subtract current_reserved_blocks from total
2025-03-04 19:20 [PATCH] f2fs: subtract current_reserved_blocks from total Daeho Jeong
@ 2025-03-05 9:10 ` Chao Yu
2025-03-05 14:35 ` Jaegeuk Kim
0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2025-03-05 9:10 UTC (permalink / raw)
To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team
Cc: chao, Daeho Jeong
On 3/5/25 03:20, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> current_reserved_blocks is not allowed to utilize. For some zoned
> storage devices, vendors will provide extra space which was used for
> device level GC than specs and we will use this space for filesystem
> level GC. This extra space should not be shown to users, otherwise,
> users will see not standardized size number like 530GB, not 512GB.
Hi Daeho,
However, if there are other users e.g. oem or vendor want to use
reserved_blocks and current_reserved_blocks sysfs interface to
reserve space, then, total size will be less than 512GB?
What do you think of adding a new variable to indicate reserved
space for zoned storage case only?
Thanks,
>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
> fs/f2fs/super.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 19b67828ae32..c346dcc2518a 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
> buf->f_type = F2FS_SUPER_MAGIC;
> buf->f_bsize = sbi->blocksize;
>
> - buf->f_blocks = total_count - start_count;
> -
> spin_lock(&sbi->stat_lock);
>
> + buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks;
> user_block_count = sbi->user_block_count;
> total_valid_node_count = valid_node_count(sbi);
> avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: subtract current_reserved_blocks from total
2025-03-05 9:10 ` [f2fs-dev] " Chao Yu
@ 2025-03-05 14:35 ` Jaegeuk Kim
2025-03-05 16:03 ` Daeho Jeong
0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2025-03-05 14:35 UTC (permalink / raw)
To: Chao Yu
Cc: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team,
Daeho Jeong
On 03/05, Chao Yu wrote:
> On 3/5/25 03:20, Daeho Jeong wrote:
> > From: Daeho Jeong <daehojeong@google.com>
> >
> > current_reserved_blocks is not allowed to utilize. For some zoned
> > storage devices, vendors will provide extra space which was used for
> > device level GC than specs and we will use this space for filesystem
> > level GC. This extra space should not be shown to users, otherwise,
> > users will see not standardized size number like 530GB, not 512GB.
>
> Hi Daeho,
>
> However, if there are other users e.g. oem or vendor want to use
> reserved_blocks and current_reserved_blocks sysfs interface to
> reserve space, then, total size will be less than 512GB?
>
> What do you think of adding a new variable to indicate reserved
> space for zoned storage case only?
Or, adding a sysfs entry like "carve_out" to determine this?
>
> Thanks,
>
> >
> > Signed-off-by: Daeho Jeong <daehojeong@google.com>
> > ---
> > fs/f2fs/super.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> > index 19b67828ae32..c346dcc2518a 100644
> > --- a/fs/f2fs/super.c
> > +++ b/fs/f2fs/super.c
> > @@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
> > buf->f_type = F2FS_SUPER_MAGIC;
> > buf->f_bsize = sbi->blocksize;
> >
> > - buf->f_blocks = total_count - start_count;
> > -
> > spin_lock(&sbi->stat_lock);
> >
> > + buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks;
> > user_block_count = sbi->user_block_count;
> > total_valid_node_count = valid_node_count(sbi);
> > avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: subtract current_reserved_blocks from total
2025-03-05 14:35 ` Jaegeuk Kim
@ 2025-03-05 16:03 ` Daeho Jeong
0 siblings, 0 replies; 4+ messages in thread
From: Daeho Jeong @ 2025-03-05 16:03 UTC (permalink / raw)
To: Jaegeuk Kim
Cc: Chao Yu, linux-kernel, linux-f2fs-devel, kernel-team, Daeho Jeong
On Wed, Mar 5, 2025 at 6:35 AM Jaegeuk Kim <jaegeuk@kernel.org> wrote:
>
> On 03/05, Chao Yu wrote:
> > On 3/5/25 03:20, Daeho Jeong wrote:
> > > From: Daeho Jeong <daehojeong@google.com>
> > >
> > > current_reserved_blocks is not allowed to utilize. For some zoned
> > > storage devices, vendors will provide extra space which was used for
> > > device level GC than specs and we will use this space for filesystem
> > > level GC. This extra space should not be shown to users, otherwise,
> > > users will see not standardized size number like 530GB, not 512GB.
> >
> > Hi Daeho,
> >
> > However, if there are other users e.g. oem or vendor want to use
> > reserved_blocks and current_reserved_blocks sysfs interface to
> > reserve space, then, total size will be less than 512GB?
> >
> > What do you think of adding a new variable to indicate reserved
> > space for zoned storage case only?
>
> Or, adding a sysfs entry like "carve_out" to determine this?
Good points. Thanks, guys.
>
> >
> > Thanks,
> >
> > >
> > > Signed-off-by: Daeho Jeong <daehojeong@google.com>
> > > ---
> > > fs/f2fs/super.c | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> > > index 19b67828ae32..c346dcc2518a 100644
> > > --- a/fs/f2fs/super.c
> > > +++ b/fs/f2fs/super.c
> > > @@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
> > > buf->f_type = F2FS_SUPER_MAGIC;
> > > buf->f_bsize = sbi->blocksize;
> > >
> > > - buf->f_blocks = total_count - start_count;
> > > -
> > > spin_lock(&sbi->stat_lock);
> > >
> > > + buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks;
> > > user_block_count = sbi->user_block_count;
> > > total_valid_node_count = valid_node_count(sbi);
> > > avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM;
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-05 16:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 19:20 [PATCH] f2fs: subtract current_reserved_blocks from total Daeho Jeong
2025-03-05 9:10 ` [f2fs-dev] " Chao Yu
2025-03-05 14:35 ` Jaegeuk Kim
2025-03-05 16:03 ` Daeho Jeong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox