aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-12-28 11:23:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-28 11:23:02 -0800
commitc76e02c59e13ae6c22cc091786d16c01bee23a14 (patch)
tree0c0dc51300595b329dad40a9c95dc835d047e6b9
parent91afe604c15405a7b15d1464f224372cd82d3e2c (diff)
parent01341fbd0d8d4e717fc1231cdffe00343088ce0b (diff)
downloadlinux-stericsson-c76e02c59e13ae6c22cc091786d16c01bee23a14.tar.gz
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
-rw-r--r--kernel/workqueue.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index b5295a0b0536..9880b6c0e272 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3731,17 +3731,24 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq)
* is updated and visible.
*/
if (!freezable || !workqueue_freezing) {
+ bool kick = false;
+
pwq->max_active = wq->saved_max_active;
while (!list_empty(&pwq->delayed_works) &&
- pwq->nr_active < pwq->max_active)
+ pwq->nr_active < pwq->max_active) {
pwq_activate_first_delayed(pwq);
+ kick = true;
+ }
/*
* Need to kick a worker after thawed or an unbound wq's
- * max_active is bumped. It's a slow path. Do it always.
+ * max_active is bumped. In realtime scenarios, always kicking a
+ * worker will cause interference on the isolated cpu cores, so
+ * let's kick iff work items were activated.
*/
- wake_up_worker(pwq->pool);
+ if (kick)
+ wake_up_worker(pwq->pool);
} else {
pwq->max_active = 0;
}