aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTal Shorer <tal.shorer@gmail.com>2017-10-21 12:29:24 -0400
committerTejun Heo <tj@kernel.org>2017-10-21 12:32:15 -0400
commitb5149873a0c299195b5346fe4dc2c5b04ae2f995 (patch)
tree534024d1cdc80574754200444866721b764b6612
parent9c323bff13f92832e03657cabdd70d731408d621 (diff)
workqueue: respect isolated cpus when queueing an unbound work
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer <tal.shorer@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--kernel/workqueue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 64d0edf428f8..bfa433b38a61 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4980,6 +4980,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
4980 if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL)) 4980 if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL))
4981 return -ENOMEM; 4981 return -ENOMEM;
4982 4982
4983 /*
4984 * Not excluding isolated cpus on purpose.
4985 * If the user wishes to include them, we allow that.
4986 */
4983 cpumask_and(cpumask, cpumask, cpu_possible_mask); 4987 cpumask_and(cpumask, cpumask, cpu_possible_mask);
4984 if (!cpumask_empty(cpumask)) { 4988 if (!cpumask_empty(cpumask)) {
4985 apply_wqattrs_lock(); 4989 apply_wqattrs_lock();
@@ -5579,7 +5583,7 @@ int __init workqueue_init_early(void)
5579 WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); 5583 WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
5580 5584
5581 BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); 5585 BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
5582 cpumask_copy(wq_unbound_cpumask, cpu_possible_mask); 5586 cpumask_andnot(wq_unbound_cpumask, cpu_possible_mask, cpu_isolated_map);
5583 5587
5584 pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); 5588 pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
5585 5589