* [PATCH v2] f2fs: enable tuning of boost_zoned_gc_percent via sysfs
@ 2025-06-16 5:04 yohan.joung
2025-06-17 5:38 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: yohan.joung @ 2025-06-16 5:04 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: linux-kernel, linux-f2fs-devel, pilhyun.kim, yohan.joung
to allow users to dynamically tune
the boost_zoned_gc_percent parameter
Signed-off-by: yohan.joung <yohan.joung@sk.com>
---
fs/f2fs/gc.h | 3 ++-
fs/f2fs/sysfs.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h
index 5c1eaf55e127..11fba7636af7 100644
--- a/fs/f2fs/gc.h
+++ b/fs/f2fs/gc.h
@@ -194,6 +194,7 @@ static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi)
static inline bool need_to_boost_gc(struct f2fs_sb_info *sbi)
{
if (f2fs_sb_has_blkzoned(sbi))
- return !has_enough_free_blocks(sbi, LIMIT_BOOST_ZONED_GC);
+ return !has_enough_free_blocks(sbi,
+ sbi->gc_thread->boost_zoned_gc_percent);
return has_enough_invalid_blocks(sbi);
}
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 75134d69a0bd..6c26b5e10c8f 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -628,6 +628,11 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
return count;
}
+ if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
+ if (t > 100)
+ return -EINVAL;
+ }
+
#ifdef CONFIG_F2FS_IOSTAT
if (!strcmp(a->attr.name, "iostat_enable")) {
sbi->iostat_enable = !!t;
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] f2fs: enable tuning of boost_zoned_gc_percent via sysfs
2025-06-16 5:04 [PATCH v2] f2fs: enable tuning of boost_zoned_gc_percent via sysfs yohan.joung
@ 2025-06-17 5:38 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2025-06-17 5:38 UTC (permalink / raw)
To: yohan.joung, jaegeuk; +Cc: chao, linux-kernel, linux-f2fs-devel, pilhyun.kim
On 6/16/25 13:04, yohan.joung wrote:
> to allow users to dynamically tune
> the boost_zoned_gc_percent parameter
>
> Signed-off-by: yohan.joung <yohan.joung@sk.com>
> ---
> fs/f2fs/gc.h | 3 ++-
> fs/f2fs/sysfs.c | 5 +++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h
> index 5c1eaf55e127..11fba7636af7 100644
> --- a/fs/f2fs/gc.h
> +++ b/fs/f2fs/gc.h
> @@ -194,6 +194,7 @@ static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi)
> static inline bool need_to_boost_gc(struct f2fs_sb_info *sbi)
> {
> if (f2fs_sb_has_blkzoned(sbi))
> - return !has_enough_free_blocks(sbi, LIMIT_BOOST_ZONED_GC);
> + return !has_enough_free_blocks(sbi,
> + sbi->gc_thread->boost_zoned_gc_percent);
> return has_enough_invalid_blocks(sbi);
> }
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index 75134d69a0bd..6c26b5e10c8f 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -628,6 +628,11 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
> return count;
> }
>
> + if (!strcmp(a->attr.name, "gc_boost_zoned_gc_percent")) {
> + if (t > 100)
> + return -EINVAL;
We'd better assign boost_zoned_gc_percent here and return directly to
avoid all below unnecessary comparison between a->attr.name and entry
names.
Thanks,
> + }
> +
> #ifdef CONFIG_F2FS_IOSTAT
> if (!strcmp(a->attr.name, "iostat_enable")) {
> sbi->iostat_enable = !!t;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-17 5:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-16 5:04 [PATCH v2] f2fs: enable tuning of boost_zoned_gc_percent via sysfs yohan.joung
2025-06-17 5:38 ` Chao Yu
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®