Commit c98a9805 authored by Tal Shorer's avatar Tal Shorer Committed by Tejun Heo

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: default avatarTal Shorer <tal.shorer@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 7d229c66
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/sched/isolation.h>
#include "workqueue_internal.h" #include "workqueue_internal.h"
...@@ -4957,6 +4958,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask) ...@@ -4957,6 +4958,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL)) if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL))
return -ENOMEM; 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); cpumask_and(cpumask, cpumask, cpu_possible_mask);
if (!cpumask_empty(cpumask)) { if (!cpumask_empty(cpumask)) {
apply_wqattrs_lock(); apply_wqattrs_lock();
...@@ -5555,7 +5560,7 @@ int __init workqueue_init_early(void) ...@@ -5555,7 +5560,7 @@ int __init workqueue_init_early(void)
WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
cpumask_copy(wq_unbound_cpumask, cpu_possible_mask); cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_FLAG_DOMAIN));
pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment