aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2018-02-20 23:17:26 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-21 03:49:08 -0500
commit1bda3f8087fce9063da0b8aef87f17a3fe541aca (patch)
treeedc54db089d5a761a3fb40abad0fea3b8eb9b5a0
parent22ab8bc02a5f6e8ffc418759894f7a6b0b632331 (diff)
sched/isolation: Isolate workqueues when "nohz_full=" is set
As we prepare for offloading the residual 1hz scheduler ticks to workqueue, let's affine those to housekeepers so that they don't interrupt the CPUs that don't want to be disturbed. Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Christoph Lameter <cl@linux.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Rik van Riel <riel@redhat.com> Cc: Wanpeng Li <kernellwp@gmail.com> Link: http://lkml.kernel.org/r/1519186649-3242-5-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--include/linux/sched/isolation.h1
-rw-r--r--kernel/sched/isolation.c3
-rw-r--r--kernel/workqueue.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index d849431c8060..4a6582c27dea 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -12,6 +12,7 @@ enum hk_flags {
12 HK_FLAG_SCHED = (1 << 3), 12 HK_FLAG_SCHED = (1 << 3),
13 HK_FLAG_TICK = (1 << 4), 13 HK_FLAG_TICK = (1 << 4),
14 HK_FLAG_DOMAIN = (1 << 5), 14 HK_FLAG_DOMAIN = (1 << 5),
15 HK_FLAG_WQ = (1 << 6),
15}; 16};
16 17
17#ifdef CONFIG_CPU_ISOLATION 18#ifdef CONFIG_CPU_ISOLATION
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index b71b436f59f2..a2500c459617 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -3,6 +3,7 @@
3 * any CPU: unbound workqueues, timers, kthreads and any offloadable work. 3 * any CPU: unbound workqueues, timers, kthreads and any offloadable work.
4 * 4 *
5 * Copyright (C) 2017 Red Hat, Inc., Frederic Weisbecker 5 * Copyright (C) 2017 Red Hat, Inc., Frederic Weisbecker
6 * Copyright (C) 2017-2018 SUSE, Frederic Weisbecker
6 * 7 *
7 */ 8 */
8 9
@@ -119,7 +120,7 @@ static int __init housekeeping_nohz_full_setup(char *str)
119{ 120{
120 unsigned int flags; 121 unsigned int flags;
121 122
122 flags = HK_FLAG_TICK | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC; 123 flags = HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC;
123 124
124 return housekeeping_setup(str, flags); 125 return housekeeping_setup(str, flags);
125} 126}
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 017044c26233..593dbe749174 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5565,12 +5565,13 @@ static void __init wq_numa_init(void)
5565int __init workqueue_init_early(void) 5565int __init workqueue_init_early(void)
5566{ 5566{
5567 int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL }; 5567 int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL };
5568 int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
5568 int i, cpu; 5569 int i, cpu;
5569 5570
5570 WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); 5571 WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
5571 5572
5572 BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); 5573 BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
5573 cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_FLAG_DOMAIN)); 5574 cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(hk_flags));
5574 5575
5575 pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); 5576 pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
5576 5577