• Hillf Danton's avatar
    workqueue: don't use wq_select_unbound_cpu() for bound works · aa202f1f
    Hillf Danton authored
    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: ef557180 ("workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs")
    Cc: stable@vger.kernel.org # v4.5+
    Signed-off-by: default avatarHillf Danton <hdanton@sina.com>
    [dj: massage changelog]
    Signed-off-by: default avatarDaniel 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: default avatarTejun Heo <tj@kernel.org>
    aa202f1f
workqueue.c 165 KB