Skip to content

Commit 26a8057

Browse files
Yuwei GuanJaegeuk Kim
authored andcommitted
f2fs: reset wait_ms to default if any of the victims have been selected
In non-foreground gc mode, if no victim is selected, the gc process will wait for no_gc_sleep_time before waking up again. In this subsequent time, even though a victim will be selected, the gc process still waits for no_gc_sleep_time before waking up. The configuration of wait_ms is not reasonable. After any of the victims have been selected, we need to reset wait_ms to default sleep time from no_gc_sleep_time. Signed-off-by: Yuwei Guan <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 7411143 commit 26a8057

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/f2fs/gc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ static int gc_thread_func(void *data)
141141
/* don't bother wait_ms by foreground gc */
142142
if (!foreground)
143143
wait_ms = gc_th->no_gc_sleep_time;
144+
} else {
145+
/* reset wait_ms to default sleep time */
146+
if (wait_ms == gc_th->no_gc_sleep_time)
147+
wait_ms = gc_th->min_sleep_time;
144148
}
145149

146150
if (foreground)

0 commit comments

Comments
 (0)