Skip to content

Commit 98e9286

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: use aggressive GC policy during f2fs_disable_checkpoint()
Let's enable GC_URGENT_HIGH mode during f2fs_disable_checkpoint(), so that we can use SSR allocator for GCed data/node persistence, it can improve the performance due to it avoiding migration of data/node locates in selected target segment of SSR allocator. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 9b56adc commit 98e9286

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/f2fs/super.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,7 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
20802080
{
20812081
unsigned int s_flags = sbi->sb->s_flags;
20822082
struct cp_control cpc;
2083+
unsigned int gc_mode;
20832084
int err = 0;
20842085
int ret;
20852086
block_t unusable;
@@ -2092,6 +2093,9 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
20922093

20932094
f2fs_update_time(sbi, DISABLE_TIME);
20942095

2096+
gc_mode = sbi->gc_mode;
2097+
sbi->gc_mode = GC_URGENT_HIGH;
2098+
20952099
while (!f2fs_time_over(sbi, DISABLE_TIME)) {
20962100
f2fs_down_write(&sbi->gc_lock);
20972101
err = f2fs_gc(sbi, true, false, false, NULL_SEGNO);
@@ -2129,6 +2133,7 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
21292133
out_unlock:
21302134
f2fs_up_write(&sbi->gc_lock);
21312135
restore_flag:
2136+
sbi->gc_mode = gc_mode;
21322137
sbi->sb->s_flags = s_flags; /* Restore SB_RDONLY status */
21332138
return err;
21342139
}

0 commit comments

Comments
 (0)