lkml.org 
[lkml]   [2021]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] workqueue: set the rescuer worker that belong to freezable wq is freezable
Date
From: Zqiang <qiang.zhang@windriver.com>

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

Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
v1->v2:
use kthread_freezable_should_stop() replaces try_to_freeze().

kernel/workqueue.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 104e3ef04e33..dd7b78bdb7f1 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);

@@ -2487,7 +2490,7 @@ static int rescuer_thread(void *__rescuer)
* @wq->maydays processing before acting on should_stop so that the
* list is always empty on exit.
*/
- should_stop = kthread_should_stop();
+ should_stop = kthread_freezable_should_stop(NULL);

/* see whether any pwq is asking for help */
raw_spin_lock_irq(&wq_mayday_lock);
--
2.25.1
\
 
 \ /
  Last update: 2021-06-22 14:43    [W:0.051 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site