linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] workqueue: set the rescuer worker that belong to freezable wq is freezable
@ 2021-06-22  7:08 qiang.zhang
  0 siblings, 0 replies; only message in thread
From: qiang.zhang @ 2021-06-22  7:08 UTC (permalink / raw)
  To: jiangshanlai, tj, akpm; +Cc: linux-kernel

From: Zqiang <qiang.zhang@windriver.com>

If the rescuer worker belong to freezable wq, when this wq is
frozen, the rescuer also need to be frozen.

Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
 kernel/workqueue.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 104e3ef04e33..ccd6ee8f3dc6 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2476,6 +2476,9 @@ static int rescuer_thread(void *__rescuer)
 	 * doesn't participate in concurrency management.
 	 */
 	set_pf_worker(true);
+
+	if (wq->flags & WQ_FREEZABLE)
+		set_freezable();
 repeat:
 	set_current_state(TASK_IDLE);
 
@@ -2504,6 +2507,9 @@ static int rescuer_thread(void *__rescuer)
 
 		raw_spin_unlock_irq(&wq_mayday_lock);
 
+		if (!kthread_should_stop())
+			try_to_freeze();
+
 		worker_attach_to_pool(rescuer, pool);
 
 		raw_spin_lock_irq(&pool->lock);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-22  7:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  7:08 [PATCH] workqueue: set the rescuer worker that belong to freezable wq is freezable qiang.zhang

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).