Skip to content

Commit 24bf3ee

Browse files
Daeho JeongJaegeuk Kim
authored andcommitted
f2fs: make sure zoned device GC to use FG_GC in shortage of free section
We already use FG_GC when we have free sections under gc_boost_zoned_gc_percent. So, let's make it consistent. Signed-off-by: Daeho Jeong <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 78f4e73 commit 24bf3ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fs/f2fs/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int gc_thread_func(void *data)
144144
gc_control.one_time;
145145

146146
/* foreground GC was been triggered via f2fs_balance_fs() */
147-
if (foreground)
147+
if (foreground && !f2fs_sb_has_blkzoned(sbi))
148148
sync_mode = false;
149149

150150
gc_control.init_gc_type = sync_mode ? FG_GC : BG_GC;

fs/f2fs/segment.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need)
455455
} else {
456456
struct f2fs_gc_control gc_control = {
457457
.victim_segno = NULL_SEGNO,
458-
.init_gc_type = BG_GC,
458+
.init_gc_type = f2fs_sb_has_blkzoned(sbi) ?
459+
FG_GC : BG_GC,
459460
.no_bg_gc = true,
460461
.should_migrate_blocks = false,
461462
.err_gc_skipped = false,

0 commit comments

Comments
 (0)