Skip to contentSkip to conversation

workqueue: wake regular worker if need_more_worker() when rescuer leave the pool

PATCH Applied Lai Jiangshan 2 participants 2 messages Jul 16, 2014 – Jul 18, 2014 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: wake regular worker if need_more_worker() when rescuer leave the pool

We don't need to wake up regular worker when nr_running==1, so need_more_worker() is sufficient here.

And need_more_worker() gives us better readability due to the name of "keep_working()" implies the rescuer should keep working now but the rescuer is actually leaving.

---
 kernel/workqueue.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/workqueue.c +2 -2
index dfd9f68..7128053 100644
@@ -2308,11 +2308,11 @@ repeat:
 		put_pwq(pwq);
 
 		/*
-		 * Leave this pool.  If keep_working() is %true, notify a
+		 * Leave this pool.  If need_more_worker() is %true, notify a
 		 * regular worker; otherwise, we end up with 0 concurrency
 		 * and stalling the execution.
 		 */
-		if (keep_working(pool))
+		if (need_more_worker(pool))
 			wake_up_worker(pool);
 
 		rescuer->pool = NULL;
Signature · 1 line
1.7.4.4
maintainer Applied
#1 lore raw
Quoted 8 lines · Lai Jiangshan

We don't need to wake up regular worker when nr_running==1, so need_more_worker() is sufficient here.

And need_more_worker() gives us better readability due to the name of "keep_working()" implies the rescuer should keep working now but the rescuer is actually leaving.

Applied to wq/for-3.17.

Thanks.

Signature · 1 line
tejun