History

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.

Frederic Weisbecker committed 8 years ago

Commit 1bda3f81 parent 22ab8bc3 files · +5 −2Browse files

Unified · Split

3 files
  1. include/linux/sched/isolation.h +1 −0
  2. kernel/sched/isolation.c +2 −1
  3. kernel/workqueue.c +2 −1
include/linux/sched/isolation.h+1−0
@@ -12,6 +12,7 @@ enum hk_flags { · 11 unmodified lines
1212 HK_FLAG_SCHED = (1 << 3),
1313 HK_FLAG_TICK = (1 << 4),
1414 HK_FLAG_DOMAIN = (1 << 5),
15+ HK_FLAG_WQ = (1 << 6),
1516 };
1617
1718 #ifdef CONFIG_CPU_ISOLATION
kernel/sched/isolation.c+2−1
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 * any CPU: unbound workqueues, timers, kthreads and any offloadable work.
44 *
55 * Copyright (C) 2017 Red Hat, Inc., Frederic Weisbecker
6+ * Copyright (C) 2017-2018 SUSE, Frederic Weisbecker
67 *
78 */
89
@@ -119,7 +120,7 @@ static int __init housekeeping_nohz_full_setup(char *str) · 110 unmodified lines
119120 {
120121 unsigned int flags;
121122
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;
123124
124125 return housekeeping_setup(str, flags);
125126 }
kernel/workqueue.c+2−1
@@ -5565,12 +5565,13 @@ static void __init wq_numa_init(void) · 5564 unmodified lines
55655565 int __init workqueue_init_early(void)
55665566 {
55675567 int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL };
5568+ int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
55685569 int i, cpu;
55695570
55705571 WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
55715572
55725573 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));
55745575
55755576 pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
55765577