mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:24:31 +01:00
workqueue: Only assign rescuer work when really needed
If the pwq does not need rescue (normal workers have been created or become available), the rescuer can immediately move on to other stalled pwqs. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
99ed6f62a4
commit
7b05c90b33
1 changed files with 4 additions and 0 deletions
|
|
@ -3442,6 +3442,10 @@ static bool assign_rescuer_work(struct pool_workqueue *pwq, struct worker *rescu
|
|||
struct worker_pool *pool = pwq->pool;
|
||||
struct work_struct *work, *n;
|
||||
|
||||
/* need rescue? */
|
||||
if (!pwq->nr_active || !need_to_create_worker(pool))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Slurp in all works issued via this workqueue and
|
||||
* process'em.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue