diff options
author | Juri Lelli <juri.lelli@redhat.com> | 2024-02-08 17:10:13 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2024-02-08 20:23:32 +0100 |
commit | d64f2fa064f8866802e23c8ec95d9d1f601480ee (patch) | |
tree | e25d02698d58b52d6c228874cbde0a99d128f21e /kernel/workqueue.c | |
parent | workqueue: Enable unbound cpumask update on ordered workqueues (diff) | |
download | linux-d64f2fa064f8866802e23c8ec95d9d1f601480ee.tar.xz linux-d64f2fa064f8866802e23c8ec95d9d1f601480ee.zip |
kernel/workqueue: Let rescuers follow unbound wq cpumask changes
When workqueue cpumask changes are committed the associated rescuer (if
one exists) affinity is not touched and this might be a problem down the
line for isolated setups.
Make sure rescuers affinity is updated every time a workqueue cpumask
changes, so that rescuers can't break isolation.
[longman: set_cpus_allowed_ptr() will block until the designated task
is enqueued on an allowed CPU, no wake_up_process() needed. Also use
the unbound_effective_cpumask() helper as suggested by Tejun.]
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index da124859a691..a24c7cfb80b4 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5051,6 +5051,11 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx) /* update node_nr_active->max */ wq_update_node_max_active(ctx->wq, -1); + /* rescuer needs to respect wq cpumask changes */ + if (ctx->wq->rescuer) + set_cpus_allowed_ptr(ctx->wq->rescuer->task, + unbound_effective_cpumask(ctx->wq)); + mutex_unlock(&ctx->wq->mutex); } |