]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/isolation: Isolate workqueues when "nohz_full=" is set
authorFrederic Weisbecker <frederic@kernel.org>
Wed, 21 Feb 2018 04:17:26 +0000 (05:17 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 21 Feb 2018 08:49:08 +0000 (09:49 +0100)
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>
include/linux/sched/isolation.h
kernel/sched/isolation.c
kernel/workqueue.c

index d849431c8060a17c49ac247745ae1afd5f88f3f2..4a6582c27dea7bb3f15338b97b67869a9b4b05d0 100644 (file)
@@ -12,6 +12,7 @@ enum hk_flags {
        HK_FLAG_SCHED           = (1 << 3),
        HK_FLAG_TICK            = (1 << 4),
        HK_FLAG_DOMAIN          = (1 << 5),
+       HK_FLAG_WQ              = (1 << 6),
 };
 
 #ifdef CONFIG_CPU_ISOLATION
index b71b436f59f2734a8a92e54c18f806bd2798439d..a2500c459617db40ae4149155c803cb46d29bb3b 100644 (file)
@@ -3,6 +3,7 @@
  *  any CPU: unbound workqueues, timers, kthreads and any offloadable work.
  *
  * Copyright (C) 2017 Red Hat, Inc., Frederic Weisbecker
+ * Copyright (C) 2017-2018 SUSE, Frederic Weisbecker
  *
  */
 
@@ -119,7 +120,7 @@ static int __init housekeeping_nohz_full_setup(char *str)
 {
        unsigned int flags;
 
-       flags = HK_FLAG_TICK | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC;
+       flags = HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC;
 
        return housekeeping_setup(str, flags);
 }
index 017044c2623373455274a1d642cecc7e3c4811aa..593dbe74917473baad53326f07b6ce301f26264a 100644 (file)
@@ -5565,12 +5565,13 @@ static void __init wq_numa_init(void)
 int __init workqueue_init_early(void)
 {
        int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL };
+       int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
        int i, cpu;
 
        WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
 
        BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
-       cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_FLAG_DOMAIN));
+       cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(hk_flags));
 
        pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);