gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
* [PATCH 1/2] gfs2: Add missing set_freezable() for freezable kthread
@ 2023-12-18  5:35 Kevin Hao
  2023-12-18  5:35 ` [PATCH 2/2] gfs2: Use wait_event_freezable_timeout() " Kevin Hao
  2023-12-21 14:10 ` [PATCH 1/2] gfs2: Add missing set_freezable() " Andreas Gruenbacher
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Hao @ 2023-12-18  5:35 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: gfs2, Rafael J. Wysocki, Pavel Machek

The kernel thread function gfs2_logd() and gfs2_quotad() invoke the
try_to_freeze() in its loop. But all the kernel threads are no-freezable
by default. So if we want to make a kernel thread to be freezable,
we have to invoke set_freezable() explicitly.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
 fs/gfs2/log.c   | 1 +
 fs/gfs2/quota.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index e5271ae87d1c..a268b69bb636 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1297,6 +1297,7 @@ int gfs2_logd(void *data)
 	struct gfs2_sbd *sdp = data;
 	unsigned long t = 1;
 
+	set_freezable();
 	while (!kthread_should_stop()) {
 		if (gfs2_withdrawn(sdp))
 			break;
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index fa47824acf13..173581736a6e 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1583,6 +1583,7 @@ int gfs2_quotad(void *data)
 	unsigned long quotad_timeo = 0;
 	unsigned long t = 0;
 
+	set_freezable();
 	while (!kthread_should_stop()) {
 		if (gfs2_withdrawn(sdp))
 			break;
-- 
2.39.2


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

end of thread, other threads:[~2023-12-21 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18  5:35 [PATCH 1/2] gfs2: Add missing set_freezable() for freezable kthread Kevin Hao
2023-12-18  5:35 ` [PATCH 2/2] gfs2: Use wait_event_freezable_timeout() " Kevin Hao
2023-12-21 14:11   ` Andreas Gruenbacher
2023-12-21 14:10 ` [PATCH 1/2] gfs2: Add missing set_freezable() " Andreas Gruenbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox