diff options
author | Tal Shorer <tal.shorer@gmail.com> | 2017-10-21 19:29:24 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-10-21 09:32:15 -0700 |
commit | b5149873a0c299195b5346fe4dc2c5b04ae2f995 (patch) | |
tree | 534024d1cdc80574754200444866721b764b6612 /kernel/workqueue.c | |
parent | 9c323bff13f92832e03657cabdd70d731408d621 (diff) | |
download | linux-stable-b5149873a0c299195b5346fe4dc2c5b04ae2f995.tar.gz linux-stable-b5149873a0c299195b5346fe4dc2c5b04ae2f995.tar.bz2 linux-stable-b5149873a0c299195b5346fe4dc2c5b04ae2f995.zip |
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>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 6 |
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) 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); |