Skip to content

Commit

Permalink
workqueue: Skip __WQ_DESTROYING workqueues when updating global unbou…
Browse files Browse the repository at this point in the history
…nd 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 <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Waiman-Long authored and htejun committed Feb 5, 2024
1 parent 96068b6 commit 8eb17dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8eb17dc

Please sign in to comment.