diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-11-30 18:36:35 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-02-15 18:40:37 -0500 |
commit | a7c8655b073d89303911c89d0fd9fc4be7631fbe (patch) | |
tree | 11d473673df9f5d561224431bf46b92956dd31f4 | |
parent | 398953e62ce3b27f9f7805e367195b7ee6705f57 (diff) |
sched/isolation: Eliminate NO_HZ_FULL_ALL
Commit 6f1982fedd59 ("sched/isolation: Handle the nohz_full= parameter")
broke CONFIG_NO_HZ_FULL_ALL=y kernels. This breakage is due to the code
under CONFIG_NO_HZ_FULL_ALL failing to invoke the shiny new housekeeping
functions. This means that rcutorture scenario TREE04 now emits RCU CPU
stall warnings due to the RCU grace-period kthreads not being awakened
at a time of their choosing, or perhaps even not at all:
[ 27.731422] rcu_bh kthread starved for 21001 jiffies! g18446744073709551369 c18446744073709551368 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x402 ->cpu=3
[ 27.731423] rcu_bh I14936 9 2 0x80080000
[ 27.731435] Call Trace:
[ 27.731440] __schedule+0x31a/0x6d0
[ 27.731442] schedule+0x31/0x80
[ 27.731446] schedule_timeout+0x15a/0x320
[ 27.731453] ? call_timer_fn+0x130/0x130
[ 27.731457] rcu_gp_kthread+0x66c/0xea0
[ 27.731458] ? rcu_gp_kthread+0x66c/0xea0
Because no one has complained about CONFIG_NO_HZ_FULL_ALL=y being broken,
I hypothesize that no one is in fact using it, other than rcutorture.
This commit therefore eliminates CONFIG_NO_HZ_FULL_ALL and updates
rcutorture's config files to instead use the nohz_full= kernel parameter
to put the desired CPUs into nohz_full mode.
Fixes: 6f1982fedd59 ("sched/isolation: Handle the nohz_full= parameter")
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Wanpeng Li <kernellwp@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/timers/NO_HZ.txt | 7 | ||||
-rw-r--r-- | kernel/time/Kconfig | 10 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 22 | ||||
-rw-r--r-- | tools/testing/selftests/rcutorture/configs/rcu/TASKS03 | 1 | ||||
-rw-r--r-- | tools/testing/selftests/rcutorture/configs/rcu/TASKS03.boot | 2 | ||||
-rw-r--r-- | tools/testing/selftests/rcutorture/configs/rcu/TREE04 | 1 | ||||
-rw-r--r-- | tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot | 2 | ||||
-rw-r--r-- | tools/testing/selftests/rcutorture/configs/rcu/TREE07 | 1 |
8 files changed, 4 insertions, 42 deletions
diff --git a/Documentation/timers/NO_HZ.txt b/Documentation/timers/NO_HZ.txt index 2dcaf9adb7a7..9591092da5e0 100644 --- a/Documentation/timers/NO_HZ.txt +++ b/Documentation/timers/NO_HZ.txt | |||
@@ -131,13 +131,6 @@ error message, and the boot CPU will be removed from the mask. Note that | |||
131 | this means that your system must have at least two CPUs in order for | 131 | this means that your system must have at least two CPUs in order for |
132 | CONFIG_NO_HZ_FULL=y to do anything for you. | 132 | CONFIG_NO_HZ_FULL=y to do anything for you. |
133 | 133 | ||
134 | Alternatively, the CONFIG_NO_HZ_FULL_ALL=y Kconfig parameter specifies | ||
135 | that all CPUs other than the boot CPU are adaptive-ticks CPUs. This | ||
136 | Kconfig parameter will be overridden by the "nohz_full=" boot parameter, | ||
137 | so that if both the CONFIG_NO_HZ_FULL_ALL=y Kconfig parameter and | ||
138 | the "nohz_full=1" boot parameter is specified, the boot parameter will | ||
139 | prevail so that only CPU 1 will be an adaptive-ticks CPU. | ||
140 | |||
141 | Finally, adaptive-ticks CPUs must have their RCU callbacks offloaded. | 134 | Finally, adaptive-ticks CPUs must have their RCU callbacks offloaded. |
142 | This is covered in the "RCU IMPLICATIONS" section below. | 135 | This is covered in the "RCU IMPLICATIONS" section below. |
143 | 136 | ||
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index f6b5f19223d6..78eabc41eaa6 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig | |||
@@ -113,16 +113,6 @@ config NO_HZ_FULL | |||
113 | 113 | ||
114 | endchoice | 114 | endchoice |
115 | 115 | ||
116 | config NO_HZ_FULL_ALL | ||
117 | bool "Full dynticks system on all CPUs by default (except CPU 0)" | ||
118 | depends on NO_HZ_FULL | ||
119 | help | ||
120 | If the user doesn't pass the nohz_full boot option to | ||
121 | define the range of full dynticks CPUs, consider that all | ||
122 | CPUs in the system are full dynticks by default. | ||
123 | Note the boot CPU will still be kept outside the range to | ||
124 | handle the timekeeping duty. | ||
125 | |||
126 | config NO_HZ | 116 | config NO_HZ |
127 | bool "Old Idle dynticks config" | 117 | bool "Old Idle dynticks config" |
128 | depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS | 118 | depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 29a5733eff83..ccd3782da0bf 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -405,30 +405,12 @@ static int tick_nohz_cpu_down(unsigned int cpu) | |||
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
407 | 407 | ||
408 | static int tick_nohz_init_all(void) | ||
409 | { | ||
410 | int err = -1; | ||
411 | |||
412 | #ifdef CONFIG_NO_HZ_FULL_ALL | ||
413 | if (!alloc_cpumask_var(&tick_nohz_full_mask, GFP_KERNEL)) { | ||
414 | WARN(1, "NO_HZ: Can't allocate full dynticks cpumask\n"); | ||
415 | return err; | ||
416 | } | ||
417 | err = 0; | ||
418 | cpumask_setall(tick_nohz_full_mask); | ||
419 | tick_nohz_full_running = true; | ||
420 | #endif | ||
421 | return err; | ||
422 | } | ||
423 | |||
424 | void __init tick_nohz_init(void) | 408 | void __init tick_nohz_init(void) |
425 | { | 409 | { |
426 | int cpu, ret; | 410 | int cpu, ret; |
427 | 411 | ||
428 | if (!tick_nohz_full_running) { | 412 | if (!tick_nohz_full_running) |
429 | if (tick_nohz_init_all() < 0) | 413 | return; |
430 | return; | ||
431 | } | ||
432 | 414 | ||
433 | /* | 415 | /* |
434 | * Full dynticks uses irq work to drive the tick rescheduling on safe | 416 | * Full dynticks uses irq work to drive the tick rescheduling on safe |
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 b/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 index c70c51d5ded1..28568b72a31b 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 | |||
@@ -9,5 +9,4 @@ CONFIG_PREEMPT=y | |||
9 | CONFIG_HZ_PERIODIC=n | 9 | CONFIG_HZ_PERIODIC=n |
10 | CONFIG_NO_HZ_IDLE=n | 10 | CONFIG_NO_HZ_IDLE=n |
11 | CONFIG_NO_HZ_FULL=y | 11 | CONFIG_NO_HZ_FULL=y |
12 | CONFIG_NO_HZ_FULL_ALL=y | ||
13 | #CHECK#CONFIG_RCU_EXPERT=n | 12 | #CHECK#CONFIG_RCU_EXPERT=n |
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03.boot b/tools/testing/selftests/rcutorture/configs/rcu/TASKS03.boot index cd2a188eeb6d..838297c58318 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03.boot +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS03.boot | |||
@@ -1 +1 @@ | |||
rcutorture.torture_type=tasks | rcutorture.torture_type=tasks nohz_full=1 | ||
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE04 b/tools/testing/selftests/rcutorture/configs/rcu/TREE04 index 27d22695d64c..24c9f6012e35 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE04 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE04 | |||
@@ -7,7 +7,6 @@ CONFIG_PREEMPT=n | |||
7 | CONFIG_HZ_PERIODIC=n | 7 | CONFIG_HZ_PERIODIC=n |
8 | CONFIG_NO_HZ_IDLE=n | 8 | CONFIG_NO_HZ_IDLE=n |
9 | CONFIG_NO_HZ_FULL=y | 9 | CONFIG_NO_HZ_FULL=y |
10 | CONFIG_NO_HZ_FULL_ALL=y | ||
11 | CONFIG_RCU_FAST_NO_HZ=y | 10 | CONFIG_RCU_FAST_NO_HZ=y |
12 | CONFIG_RCU_TRACE=y | 11 | CONFIG_RCU_TRACE=y |
13 | CONFIG_HOTPLUG_CPU=n | 12 | CONFIG_HOTPLUG_CPU=n |
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot index e34c33430447..e6071bb96c7d 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot | |||
@@ -1 +1 @@ | |||
rcutorture.torture_type=rcu_bh rcutree.rcu_fanout_leaf=4 | rcutorture.torture_type=rcu_bh rcutree.rcu_fanout_leaf=4 nohz_full=1-7 | ||
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 index 0f4759f4232e..d7afb271a586 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 | |||
@@ -7,7 +7,6 @@ CONFIG_PREEMPT=n | |||
7 | CONFIG_HZ_PERIODIC=n | 7 | CONFIG_HZ_PERIODIC=n |
8 | CONFIG_NO_HZ_IDLE=n | 8 | CONFIG_NO_HZ_IDLE=n |
9 | CONFIG_NO_HZ_FULL=y | 9 | CONFIG_NO_HZ_FULL=y |
10 | CONFIG_NO_HZ_FULL_ALL=n | ||
11 | CONFIG_RCU_FAST_NO_HZ=n | 10 | CONFIG_RCU_FAST_NO_HZ=n |
12 | CONFIG_RCU_TRACE=y | 11 | CONFIG_RCU_TRACE=y |
13 | CONFIG_HOTPLUG_CPU=y | 12 | CONFIG_HOTPLUG_CPU=y |