]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: Use cpu_possible_mask instead of cpu_active_mask to break affinity
authorLai Jiangshan <laijs@linux.alibaba.com>
Mon, 11 Jan 2021 15:26:33 +0000 (23:26 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 22 Jan 2021 14:09:41 +0000 (15:09 +0100)
commit347e7b67b6899c19d9a392b8f88c4788712572b5
tree09f6cd90cb4d818ffa6df2feb13bb955288c11a1
parent78ce8c7a4502266054d366ad18b7f8180c4c5d05
workqueue: Use cpu_possible_mask instead of cpu_active_mask to break affinity

The scheduler won't break affinity for us any more, and we should
"emulate" the same behavior when the scheduler breaks affinity for
us.  The behavior is "changing the cpumask to cpu_possible_mask".

And there might be some other CPUs online later while the worker is
still running with the pending work items.  The worker should be allowed
to use the later online CPUs as before and process the work items ASAP.
If we use cpu_active_mask here, we can't achieve this goal but
using cpu_possible_mask can.

Fixes: 90219f32bcfb ("workqueue: Manually break affinity on hotplug")
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210111152638.2417-4-jiangshanlai@gmail.com
kernel/workqueue.c