workqueue: wake regular worker if need_more_worker() when rescuer leave the pool
authorLai Jiangshan <laijs@cn.fujitsu.com>
Wed, 16 Jul 2014 06:56:36 +0000 (14:56 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 18 Jul 2014 22:46:11 +0000 (18:46 -0400)
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.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index a791a8c32b4f5cd8963609b839d9a2dff71433d2..d3444169e26102d42798da4686be86fa100fbf94 100644 (file)
@@ -2313,11 +2313,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;