]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: restore CPU affinity of unbound workers on CPU_ONLINE
authorTejun Heo <tj@kernel.org>
Tue, 19 Mar 2013 20:45:21 +0000 (13:45 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 19 Mar 2013 20:45:21 +0000 (13:45 -0700)
commit995ea0a281c5bef930cbc2b3baca09b91a1f1fe6
treeb102c68e70c38739ce128102fa818f3e91b8056d
parent8795de177901ca2fb7de02d6f256b71d049b8907
workqueue: restore CPU affinity of unbound workers on CPU_ONLINE

With the recent addition of the custom attributes support, unbound
pools may have allowed cpumask which isn't full.  As long as some of
CPUs in the cpumask are online, its workers will maintain cpus_allowed
as set on worker creation; however, once no online CPU is left in
cpus_allowed, the scheduler will reset cpus_allowed of any workers
which get scheduled so that they can execute.

To remain compliant to the user-specified configuration, CPU affinity
needs to be restored when a CPU becomes online for an unbound pool
which doesn't currently have any online CPUs before.

This patch implement restore_unbound_workers_cpumask(), which is
called from CPU_ONLINE for all unbound pools, checks whether the
coming up CPU is the first allowed online one, and, if so, invokes
set_cpus_allowed_ptr() with the configured cpumask on all workers.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
kernel/workqueue.c