Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue update from Tejun Heo:
"The same as the cgroup tree - one commit which was scheduled for the
5.11 merge window.

All the commit does is avoding spurious worker wakeups from workqueue
allocation / config change path to help cpuisol use cases"

* 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
workqueue: Kick a worker based on the actual activation of delayed works

+10 -3
+10 -3
kernel/workqueue.c
··· 3731 3731 * is updated and visible. 3732 3732 */ 3733 3733 if (!freezable || !workqueue_freezing) { 3734 + bool kick = false; 3735 + 3734 3736 pwq->max_active = wq->saved_max_active; 3735 3737 3736 3738 while (!list_empty(&pwq->delayed_works) && 3737 - pwq->nr_active < pwq->max_active) 3739 + pwq->nr_active < pwq->max_active) { 3738 3740 pwq_activate_first_delayed(pwq); 3741 + kick = true; 3742 + } 3739 3743 3740 3744 /* 3741 3745 * Need to kick a worker after thawed or an unbound wq's 3742 - * max_active is bumped. It's a slow path. Do it always. 3746 + * max_active is bumped. In realtime scenarios, always kicking a 3747 + * worker will cause interference on the isolated cpu cores, so 3748 + * let's kick iff work items were activated. 3743 3749 */ 3744 - wake_up_worker(pwq->pool); 3750 + if (kick) 3751 + wake_up_worker(pwq->pool); 3745 3752 } else { 3746 3753 pwq->max_active = 0; 3747 3754 }