]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: don't use wq_select_unbound_cpu() for bound works
authorHillf Danton <hdanton@sina.com>
Sat, 25 Jan 2020 01:14:45 +0000 (20:14 -0500)
committerTejun Heo <tj@kernel.org>
Tue, 10 Mar 2020 14:30:51 +0000 (10:30 -0400)
commitf33a5350860b74d78505c3457a65815c78859b0e
tree4666dc8751cd9751ac29f07b96e083ae9bb29f48
parent0418a06b570c8d5e3d5cf5bb6c91e35d14ae872b
workqueue: don't use wq_select_unbound_cpu() for bound works

wq_select_unbound_cpu() is designed for unbound workqueues only, but
it's wrongly called when using a bound workqueue too.

Fixing this ensures work queued to a bound workqueue with
cpu=WORK_CPU_UNBOUND always runs on the local CPU.

Before, that would happen only if wq_unbound_cpumask happened to include
it (likely almost always the case), or was empty, or we got lucky with
forced round-robin placement.  So restricting
/sys/devices/virtual/workqueue/cpumask to a small subset of a machine's
CPUs would cause some bound work items to run unexpectedly there.

Fixes: d59ca994f071 ("workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs")
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: Hillf Danton <hdanton@sina.com>
[dj: massage changelog]
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c