kernel/workqueue: Let rescuers follow unbound wq cpumask changes
authorJuri Lelli <juri.lelli@redhat.com>
Thu, 8 Feb 2024 16:10:13 +0000 (11:10 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 8 Feb 2024 19:23:32 +0000 (09:23 -1000)
commitd64f2fa064f8866802e23c8ec95d9d1f601480ee
treee25d02698d58b52d6c228874cbde0a99d128f21e
parent4c065dbce1e8639546ef3612acffb062dd084cfe
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>
kernel/workqueue.c