From: Waiman Long Date: Sat, 3 Feb 2024 15:43:30 +0000 (-0500) Subject: workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8eb17dc1a6b5db7e89681f59285242af8d182f95;p=linux.git workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask Skip updating workqueues with __WQ_DESTROYING bit set when updating global unbound cpumask to avoid unnecessary work and other complications. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d7fdb631ecf7d..68c48489eab31 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6501,7 +6501,7 @@ static int workqueue_apply_unbound_cpumask(const cpumask_var_t unbound_cpumask) lockdep_assert_held(&wq_pool_mutex); list_for_each_entry(wq, &workqueues, list) { - if (!(wq->flags & WQ_UNBOUND)) + if (!(wq->flags & WQ_UNBOUND) || (wq->flags & __WQ_DESTROYING)) continue; /* creating multiple pwqs breaks ordering guarantee */