Skip to contentSkip to conversation

f2fs: make sure zoned device GC to use FG_GC in shortage of free section

PATCH Applied Daeho Jeong 3 participants 3 messages May 29, 2025 – Jun 24, 2025 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: make sure zoned device GC to use FG_GC in shortage of free section

From: Daeho Jeong <[email protected]>

We already use FG_GC when we have free sections under gc_boost_zoned_gc_percent. So, let's make it consistent.

---
 fs/f2fs/gc.c      | 2 +-
 fs/f2fs/segment.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
fs/f2fs/gc.c +1 -1
index f752dec71e45..cd13a642055b 100644
@@ -144,7 +144,7 @@ static int gc_thread_func(void *data)
 				gc_control.one_time;
 
 		/* foreground GC was been triggered via f2fs_balance_fs() */
-		if (foreground)
+		if (foreground && !f2fs_sb_has_blkzoned(sbi))
 			sync_mode = false;
 
 		gc_control.init_gc_type = sync_mode ? FG_GC : BG_GC;
fs/f2fs/segment.c +2 -1
index 396ef71f41e3..030540df3550 100644
@@ -446,7 +446,8 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need)
 	} else {
 		struct f2fs_gc_control gc_control = {
 			.victim_segno = NULL_SEGNO,
-			.init_gc_type = BG_GC,
+			.init_gc_type = f2fs_sb_has_blkzoned(sbi) ?
+				FG_GC : BG_GC,
 			.no_bg_gc = true,
 			.should_migrate_blocks = false,
 			.err_gc_skipped = false,
Signature · 1 line
2.49.0.1204.g71687c7c1d-goog
#2 lore raw
In reply to Daeho Jeong
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · On Thu, 29 May 2025 15:25:32 -0700 you wrote:

From: Daeho Jeong <[email protected]>

We already use FG_GC when we have free sections under gc_boost_zoned_gc_percent. So, let's make it consistent.

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: make sure zoned device GC to use FG_GC in shortage of free section

    https://git.kernel.org/jaegeuk/f2fs/c/24bf3ee37fb8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html