Skip to content

Commit c76e02c

Browse files
committed
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
2 parents 91afe60 + 01341fb commit c76e02c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

kernel/workqueue.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,17 +3731,24 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq)
37313731
* is updated and visible.
37323732
*/
37333733
if (!freezable || !workqueue_freezing) {
3734+
bool kick = false;
3735+
37343736
pwq->max_active = wq->saved_max_active;
37353737

37363738
while (!list_empty(&pwq->delayed_works) &&
3737-
pwq->nr_active < pwq->max_active)
3739+
pwq->nr_active < pwq->max_active) {
37383740
pwq_activate_first_delayed(pwq);
3741+
kick = true;
3742+
}
37393743

37403744
/*
37413745
* 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.
37433749
*/
3744-
wake_up_worker(pwq->pool);
3750+
if (kick)
3751+
wake_up_worker(pwq->pool);
37453752
} else {
37463753
pwq->max_active = 0;
37473754
}

0 commit comments

Comments
 (0)