Commit 7b05c90b authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo
Browse files

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: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 99ed6f62
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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.