]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: Avoid a false warning in unbind_workers()
authorLai Jiangshan <jiangshan.ljs@antgroup.com>
Fri, 29 Jul 2022 09:44:38 +0000 (17:44 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 29 Jul 2022 17:49:02 +0000 (07:49 -1000)
commitaef0a9f2765702bc639ee8e3b94de991ee0bf5e8
tree041b7b34242dc7f44b8bd6bf894839e778926b12
parent361b7b5ed99d97edafe700a3e3e73c9cd5d12c30
workqueue: Avoid a false warning in unbind_workers()

Doing set_cpus_allowed_ptr() with wq_unbound_cpumask can be possible
fails and trigger the false warning.

Use cpu_possible_mask instead when wq_unbound_cpumask has no active CPUs.

It is very easy to trigger the warning:
  Set wq_unbound_cpumask to a small set of CPUs.
  Offline all the CPUs of wq_unbound_cpumask.
  Offline an extra CPU and trigger the warning.

Fixes: 40c32ece1fac ("workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs")
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c