]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
workqueue: respect isolated cpus when queueing an unbound work
authorTal Shorer <tal.shorer@gmail.com>
Sat, 21 Oct 2017 16:29:24 +0000 (19:29 +0300)
committerTejun Heo <tj@kernel.org>
Sat, 21 Oct 2017 16:32:15 +0000 (09:32 -0700)
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>
kernel/workqueue.c

index 64d0edf428f850f2e5cfed94970cb74491eb6b61..bfa433b38a617e6fb86f2f077a93870ea37dc354 100644 (file)
@@ -4980,6 +4980,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
        if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL))
                return -ENOMEM;
 
+       /*
+        * Not excluding isolated cpus on purpose.
+        * If the user wishes to include them, we allow that.
+        */
        cpumask_and(cpumask, cpumask, cpu_possible_mask);
        if (!cpumask_empty(cpumask)) {
                apply_wqattrs_lock();
@@ -5579,7 +5583,7 @@ int __init workqueue_init_early(void)
        WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
 
        BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
-       cpumask_copy(wq_unbound_cpumask, cpu_possible_mask);
+       cpumask_andnot(wq_unbound_cpumask, cpu_possible_mask, cpu_isolated_map);
 
        pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);