提交 d8ca83e6 编写于 作者: L Lai Jiangshan 提交者: Tejun Heo

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.
Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 f7537df5
......@@ -2313,11 +2313,11 @@ static int rescuer_thread(void *__rescuer)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册