lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 21 Feb 2024 16:14:20 +0800
From: liujinbao1 <jinbaoliu365@...il.com>
To: chao@...nel.org,
	jaegeuk@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org,
	liujinbao1 <liujinbao1@...omi.com>
Subject: [PATCH] f2fs: control gc_thread_func to run periodically

From: liujinbao1 <liujinbao1@...omi.com>

By default, the gc_thread_func function fluctuates within
the range of min_sleep_time to max_sleep_time, and only
when gc_mode is GC_URGENT_HIGH, wait_ms can be specified
as urgent_sleep_time.For other algorithms, we may also want
to execute it periodically. After introducing this patch,
we can control the gc_thread_func function to run periodically
by setting the values of min_sleep_time and max_sleep_time to
be the same.

Signed-off-by: liujinbao1 <liujinbao1@...omi.com>
---
 fs/f2fs/gc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index f550cdeaa663..df94e64533de 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -120,6 +120,10 @@ static int gc_thread_func(void *data)
 			decrease_sleep_time(gc_th, &wait_ms);
 		else
 			increase_sleep_time(gc_th, &wait_ms);
+
+		if (gc_th->min_sleep_time == gc_th->max_sleep_time)
+			wait_ms = gc_th->min_sleep_time;
+
 do_gc:
 		stat_inc_gc_call_count(sbi, foreground ?
 					FOREGROUND : BACKGROUND);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ