diff options
author | Tal Shorer <tal.shorer@gmail.com> | 2017-11-03 11:27:50 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-11-27 11:57:00 -0500 |
commit | c98a9805096460567404799a7bd3149826affde7 (patch) | |
tree | 6fe72533be2a9d6fadcc31a51d4c80853f9466f7 /kernel/workqueue.c | |
parent | 7d229c668a114e80d6be62b00e21a73bdd9ba7b3 (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>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 8fdb710bfdd7..6a5658cb46da 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/nodemask.h> | 48 | #include <linux/nodemask.h> |
49 | #include <linux/moduleparam.h> | 49 | #include <linux/moduleparam.h> |
50 | #include <linux/uaccess.h> | 50 | #include <linux/uaccess.h> |
51 | #include <linux/sched/isolation.h> | ||
51 | 52 | ||
52 | #include "workqueue_internal.h" | 53 | #include "workqueue_internal.h" |
53 | 54 | ||
@@ -4957,6 +4958,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask) | |||
4957 | if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL)) | 4958 | if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL)) |
4958 | return -ENOMEM; | 4959 | return -ENOMEM; |
4959 | 4960 | ||
4961 | /* | ||
4962 | * Not excluding isolated cpus on purpose. | ||
4963 | * If the user wishes to include them, we allow that. | ||
4964 | */ | ||
4960 | cpumask_and(cpumask, cpumask, cpu_possible_mask); | 4965 | cpumask_and(cpumask, cpumask, cpu_possible_mask); |
4961 | if (!cpumask_empty(cpumask)) { | 4966 | if (!cpumask_empty(cpumask)) { |
4962 | apply_wqattrs_lock(); | 4967 | apply_wqattrs_lock(); |
@@ -5555,7 +5560,7 @@ int __init workqueue_init_early(void) | |||
5555 | WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); | 5560 | WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); |
5556 | 5561 | ||
5557 | BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); | 5562 | BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); |
5558 | cpumask_copy(wq_unbound_cpumask, cpu_possible_mask); | 5563 | cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_FLAG_DOMAIN)); |
5559 | 5564 | ||
5560 | pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); | 5565 | pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); |
5561 | 5566 | ||