linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected
@ 2022-12-11 13:08 Yuwei Guan
  2022-12-12 10:23 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yuwei Guan @ 2022-12-11 13:08 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-kernel, linux-f2fs-devel

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>
---
 fs/f2fs/gc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index f0c6506d8975..d7a9d84ba57c 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -141,6 +141,10 @@ static int gc_thread_func(void *data)
 			/* 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)
-- 
2.34.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected
  2022-12-11 13:08 [f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected Yuwei Guan
@ 2022-12-12 10:23 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2022-12-12 10:23 UTC (permalink / raw)
  To: Yuwei Guan, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

On 2022/12/11 21:08, Yuwei Guan wrote:
> 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>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-12 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-11 13:08 [f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected Yuwei Guan
2022-12-12 10:23 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).