Skip to contentSkip to conversation

f2fs: enable tuning of boost_zoned_gc_percent via sysfs

PATCH Superseded yohan.joung 2 participants 2 messages May 23, 2025 F2FS file system

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: enable tuning of boost_zoned_gc_percent via sysfs

to allow users to dynamically tune
the boost_zoned_gc_percent parameter

---
 fs/f2fs/gc.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/gc.h +3 -1
index 5c1eaf55e127..f9ff68dc2bcc 100644
@@ -194,6 +194,8 @@ 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 < 100
+			? sbi->gc_thread->boost_zoned_gc_percent : 100);
 	return has_enough_invalid_blocks(sbi);
 }
Signature · 8 lines
2.33.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 13 lines · yohan.joung

to allow users to dynamically tune
the boost_zoned_gc_percent parameter

---
 fs/f2fs/gc.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/gc.h +0 -0
index 5c1eaf55e127..f9ff68dc2bcc 100644

fs/f2fs/gc.h static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi) · line 199

Quoted 7 lines
fs/f2fs/gc.h +3 -1
@@ -194,6 +194,8 @@ 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 < 100
+			? sbi->gc_thread->boost_zoned_gc_percent : 100);

How about checking lower/upper boundary for boost_zoned_gc_percent during setting its value via sysfs? Also update the manual page?

Then we can use sbi->gc_thread->boost_zoned_gc_percent directly here?

Thanks,

Quoted 2 lines
fs/f2fs/gc.h +0 -0
 	return has_enough_invalid_blocks(sbi);
 }