Skip to contentSkip to conversation

workqueue: set the rescuer worker that belong to freezable wq is freezable

PATCH Superseded [email protected] 1 participant 1 message Jun 22, 2021 Workqueue

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: set the rescuer worker that belong to freezable wq is freezable

From: Zqiang <[email protected]>

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

---
 kernel/workqueue.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/workqueue.c +6 -0
index 104e3ef04e33..ccd6ee8f3dc6 100644
@@ -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);
Signature · 1 line
2.17.1