Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70369b11 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo
Browse files

workqueue: use cwq_set_max_active() helper for workqueue_set_max_active()



workqueue_set_max_active() may increase ->max_active without
activating delayed works and may make the activation order differ from
the queueing order.  Both aren't strictly bugs but the resulting
behavior could be a bit odd.

To make things more consistent, use cwq_set_max_active() helper which
immediately makes use of the newly increased max_mactive if there are
delayed work items and also keeps the activation order.

tj: Slight update to description.

Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 9f4bd4cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3413,7 +3413,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)

		if (!(wq->flags & WQ_FREEZABLE) ||
		    !(gcwq->flags & GCWQ_FREEZING))
			get_cwq(gcwq->cpu, wq)->max_active = max_active;
			cwq_set_max_active(get_cwq(gcwq->cpu, wq), max_active);

		spin_unlock_irq(&gcwq->lock);
	}