aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuwei Guan <ssawgyw@gmail.com>2022-12-11 21:08:41 +0800
committerJaegeuk Kim <jaegeuk@google.com>2022-12-12 15:22:35 -0800
commitb9aeb147225616494256fcf913c559afd4088a05 (patch)
treee30e5bdef0412d6a9c8fed6f4b605cfa3219d6eb
parentdae7b24407e3c460b61a81dbc89656fc215d7bf1 (diff)
downloadf2fs-stable-linux-4.19.y.tar.gz
f2fs: reset wait_ms to default if any of the victims have been selected6.2-rc1-4.19linux-4.19.y
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 <Yuwei.Guan@zeekrlife.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 30673f49ea547f..7491f912abdf55 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -141,6 +141,10 @@ do_gc:
/* don't bother wait_ms by foreground gc */
if (!foreground)
wait_ms = gc_th->no_gc_sleep_time;
+ } else {
+ /* reset wait_ms to default sleep time */
+ if (wait_ms == gc_th->no_gc_sleep_time)
+ wait_ms = gc_th->min_sleep_time;
}
if (foreground)