workqueue: Enable unbound cpumask update on ordered workqueues
authorWaiman Long <longman@redhat.com>
Thu, 8 Feb 2024 19:12:20 +0000 (14:12 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 8 Feb 2024 19:22:49 +0000 (09:22 -1000)
commit4c065dbce1e8639546ef3612acffb062dd084cfe
treed1450c1fe0bbee488136756b0728897dc75fc3a1
parent26fb7e3dda4c16e2cfe2164a1e7315a9386602db
workqueue: Enable unbound cpumask update on ordered workqueues

Ordered workqueues does not currently follow changes made to the
global unbound cpumask because per-pool workqueue changes may break
the ordering guarantee. IOW, a work function in an ordered workqueue
may run on an isolated CPU.

This patch enables ordered workqueues to follow changes made to the
global unbound cpumask by temporaily plug or suspend the newly allocated
pool_workqueue from executing newly queued work items until the old
pwq has been properly drained. For ordered workqueues, there should
only be one pwq that is unplugged, the rests should be plugged.

This enables ordered workqueues to follow the unbound cpumask changes
like other unbound workqueues at the expense of some delay in execution
of work functions during the transition period.

Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c