v2 Tiny RCU changes for 3.9
cover v2 Tiny RCU changes for 3.9
Hello!
This series provides a couple of tiny-RCU changes:
1. Make Tiny RCU emit RCU CPU stall warnings when RCU_TRACE=y.
2. Allow TREE_PREEMPT_RCU to be used on UP systems.
Changes since v1:
o Updated #1 as suggested by Josh Triplett to simplify the
#if expressions.
o Added #2.
Thanx, Paul
b/init/Kconfig | 12 +++++++++ b/kernel/rcu.h | 7 +++++ b/kernel/rcupdate.c | 51 +++++++++++++++++++++++++++++++++++++++++ b/kernel/rcutiny.c | 6 +++- b/kernel/rcutiny_plugin.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++ b/kernel/rcutree.c | 46 ++----------------------------------- b/kernel/rcutree.h | 5 ---- b/lib/Kconfig.debug | 2 - 8 files changed, 133 insertions(+), 52 deletions(-)
PATCH 1/2 rcu: Provide RCU CPU stall warnings for tiny RCU
From: "Paul E. McKenney" <[email protected]>
Tiny RCU has historically omitted RCU CPU stall warnings in order to reduce memory requirements, however, lack of these warnings caused Thomas Gleixner some debugging pain recently. Therefore, this commit adds RCU CPU stall warnings to tiny RCU if RCU_TRACE=y. This keeps the memory footprint small, while still enabling CPU stall warnings in kernels built to enable them.
Updated to include Josh Triplett's suggested use of RCU_STALL_COMMON config variable to simplify #if expressions.
--- init/Kconfig | 8 ++++++ kernel/rcu.h | 7 ++++++ kernel/rcupdate.c | 51 ++++++++++++++++++++++++++++++++++++++++++ kernel/rcutiny.c | 6 +++- kernel/rcutiny_plugin.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++ kernel/rcutree.c | 46 ++------------------------------------ kernel/rcutree.h | 5 ---- lib/Kconfig.debug | 2 +- 8 files changed, 130 insertions(+), 51 deletions(-)
init/Kconfig +8 -0
@@ -486,6 +486,14 @@ config PREEMPT_RCU This option enables preemptible-RCU code that is common between the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. +config RCU_STALL_COMMON + def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE ) + help + This option enables RCU CPU stall code that is common between + the TINY and TREE variants of RCU. The purpose is to allow + the tiny variants to disable RCU CPU stall warnings, while + making these warnings mandatory for the tree variants. + config CONTEXT_TRACKING bool
kernel/rcu.h +7 -0
@@ -111,4 +111,11 @@ static inline bool __rcu_reclaim(char *rn, struct rcu_head *head)extern int rcu_expedited; +#ifdef CONFIG_RCU_STALL_COMMON + +extern int rcu_cpu_stall_suppress; +int rcu_jiffies_till_stall_check (void ); + +#endif /* #ifdef CONFIG_RCU_STALL_COMMON */ +#endif /* __LINUX_RCU_H */
kernel/rcupdate.c +51 -0
54 lines not on this page · raw message
kernel/rcutiny.c +4 -2
@@ -51,10 +51,10 @@ static void __call_rcu(struct rcu_head *head,void (*func)(struct rcu_head *rcu), struct rcu_ctrlblk *rcp); -#include "rcutiny_plugin.h" -static long long rcu_dynticks_nesting =DYNTICK_TASK_EXIT_IDLE ; +#include "rcutiny_plugin.h" +/* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcutree.c. */ static void rcu_idle_enter_common (long long newval) {
@@ -205,6 +205,7 @@ int rcu_is_cpu_rrupt_from_idle(void)*/ static int rcu_qsctr_help (struct rcu_ctrlblk *rcp) { +reset_cpu_stall_ticks (rcp);if (rcp->rcucblist !=NULL && rcp->donetail != rcp->curtail) { rcp->donetail = rcp->curtail;
@@ -251,6 +252,7 @@ void rcu_bh_qs(int cpu)*/ void rcu_check_callbacks (int cpu,int user) { +check_cpu_stalls ();if (user ||rcu_is_cpu_rrupt_from_idle ())rcu_sched_qs (cpu);else if (!in_softirq ())
kernel/rcutiny_plugin.h +56 -0
78 lines not on this page · raw message
kernel/rcutree.c +3 -43
91 lines not on this page · raw message
kernel/rcutree.h +0 -5
@@ -343,11 +343,6 @@ struct rcu_data {#define RCU_JIFFIES_TILL_FORCE_QS 3/* for rsp->jiffies_force_qs */ -#ifdef CONFIG_PROVE_RCU -#define RCU_STALL_DELAY_DELTA (5 * HZ) -#else -#define RCU_STALL_DELAY_DELTA 0 -#endif #define RCU_STALL_RAT_DELAY 2/* Allow other CPUs time */ /* to take at least one */ /* scheduling clock irq */
lib/Kconfig.debug +1 -1
@@ -970,7 +970,7 @@ config RCU_TORTURE_TEST_RUNNABLE config RCU_CPU_STALL_TIMEOUT int "RCU CPU stall timeout in seconds" - depends on TREE_RCU || TREE_PREEMPT_RCU + depends on TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE range 3 300 default 21 help
Signature · 1 line
1.7.8
PATCH 2/2 rcu: Allow TREE_PREEMPT_RCU on UP systems
From: "Paul E. McKenney" <[email protected]>
The TINY_PREEMPT_RCU is complex, does not provide that much memory savings, and therefore TREE_PREEMPT_RCU should be used instead. The systems where the difference between TINY_PREEMPT_RCU and TREE_PREEMPT_RCU are quite small compared to the memory footprint of CONFIG_PREEMPT.
This commit therefore takes a first step towards eliminating TINY_PREEMPT_RCU by allowing TREE_PREEMPT_RCU to be configured on !SMP systems.
--- init/Kconfig | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
init/Kconfig +3 -1
@@ -453,7 +453,7 @@ config TREE_RCU config TREE_PREEMPT_RCU bool "Preemptible tree-based hierarchical RCU" - depends on PREEMPT && SMP + depends on PREEMPT help This option selects the RCU implementation that is designed for very large SMP systems with hundreds or
@@ -461,6 +461,8 @@ config TREE_PREEMPT_RCU is also required. It also scales down nicely to smaller systems. + Select this option if you are unsure. + config TINY_RCU bool "UP-only small-memory-footprint RCU" depends on !PREEMPT && !SMP
Signature · 1 line
1.7.8
Re: [PATCH tip/core/rcu 2/2] rcu: Allow TREE_PREEMPT_RCU on UP systems
Quoted 7 lines · Paul E. McKenney
From: "Paul E. McKenney" <[email protected]>
The
TINY_PREEMPT_RCUis complex, does not provide that much memory savings, and thereforeTREE_PREEMPT_RCUshould be used instead. The systems where the difference betweenTINY_PREEMPT_RCUandTREE_PREEMPT_RCUare quite small compared to the memory footprint ofCONFIG_PREEMPT.
Quoted 5 lines
This commit therefore takes a first step towards eliminating
TINY_PREEMPT_RCUby allowingTREE_PREEMPT_RCUto be configured on !SMP systems.Signed-off-by Paul E. McKenney <[email protected]>
Quoted 29 lines
--- init/Kconfig | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)init/Kconfig +3
-1@@ -453,7 +453,7 @@ config TREE_RCU config TREE_PREEMPT_RCU bool "Preemptible tree-based hierarchical RCU" - depends on PREEMPT && SMP + depends on PREEMPT help This option selects the RCU implementation that is designed for very large SMP systems with hundreds or@@ -461,6 +461,8 @@ config TREE_PREEMPT_RCU is also required. It also scales down nicely to smaller systems. + Select this option if you are unsure. + config TINY_RCU bool "UP-only small-memory-footprint RCU" depends on !PREEMPT && !SMPSignature · 1 line
1.7.8
Re: [PATCH tip/core/rcu 1/2] rcu: Provide RCU CPU stall warnings for tiny RCU
In reply to Paul E. McKenneyQuoted 9 lines · Paul E. McKenney
From: "Paul E. McKenney" <[email protected]>
Tiny RCU has historically omitted RCU CPU stall warnings in order to reduce memory requirements, however, lack of these warnings caused Thomas Gleixner some debugging pain recently. Therefore, this commit adds RCU CPU stall warnings to tiny RCU if RCU_TRACE=y. This keeps the memory footprint small, while still enabling CPU stall warnings in kernels built to enable them.
Quoted 6 lines
Updated to include Josh Triplett's suggested use of
RCU_STALL_COMMONconfig variable to simplify #if expressions.Reported-by Thomas Gleixner <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>
One suggestion below; with that change,
Quoted 14 lines
init/Kconfig +8
-0@@ -486,6 +486,14 @@ config PREEMPT_RCU This option enables preemptible-RCU code that is common between the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. +config RCU_STALL_COMMON + def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE ) + help + This option enables RCU CPU stall code that is common between + the TINY and TREE variants of RCU. The purpose is to allow + the tiny variants to disable RCU CPU stall warnings, while + making these warnings mandatory for the tree variants. +
[...]
lib/Kconfig.debug config RCU_TORTURE_TEST_RUNNABLE · line 973
Quoted 8 lines
lib/Kconfig.debug +1
-1@@ -970,7 +970,7 @@ config RCU_TORTURE_TEST_RUNNABLE config RCU_CPU_STALL_TIMEOUT int "RCU CPU stall timeout in seconds" - depends on TREE_RCU || TREE_PREEMPT_RCU + depends on TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE
depends on RCU_STALL_COMMON
Re: [PATCH tip/core/rcu 1/2] rcu: Provide RCU CPU stall warnings for tiny RCU
Quoted 39 lines · Josh Triplett
Quoted 9 lines · Paul E. McKenney
From: "Paul E. McKenney" <[email protected]>
Tiny RCU has historically omitted RCU CPU stall warnings in order to reduce memory requirements, however, lack of these warnings caused Thomas Gleixner some debugging pain recently. Therefore, this commit adds RCU CPU stall warnings to tiny RCU if RCU_TRACE=y. This keeps the memory footprint small, while still enabling CPU stall warnings in kernels built to enable them.
Quoted 6 lines
Updated to include Josh Triplett's suggested use of
RCU_STALL_COMMONconfig variable to simplify #if expressions.Reported-by Thomas Gleixner <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>One suggestion below; with that change,
Reviewed-by Josh Triplett <[email protected]>Quoted 14 lines
init/Kconfig +8
-0@@ -486,6 +486,14 @@ config PREEMPT_RCU This option enables preemptible-RCU code that is common between the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. +config RCU_STALL_COMMON + def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE ) + help + This option enables RCU CPU stall code that is common between + the TINY and TREE variants of RCU. The purpose is to allow + the tiny variants to disable RCU CPU stall warnings, while + making these warnings mandatory for the tree variants. +[...]
Quoted 4 lines
lib/Kconfig.debug +0
-0@@ -970,7 +970,7 @@ config RCU_TORTURE_TEST_RUNNABLE
Quoted 6 lines
lib/Kconfig.debug config RCU_TORTURE_TEST_RUNNABLE · line 973
Quoted 4 lines
lib/Kconfig.debug +1
-1config RCU_CPU_STALL_TIMEOUT int "RCU CPU stall timeout in seconds" - depends on TREE_RCU || TREE_PREEMPT_RCU + depends on TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACEdepends on
RCU_STALL_COMMON
Good catch, fixed!
Thanx, Paul
Quoted 6 lines · Paul E. McKenney
Hello!
This series provides a couple of tiny-RCU changes:
1. Make Tiny RCU emit RCU CPU stall warnings when RCU_TRACE=y.
2. AllowTREE_PREEMPT_RCUto be used on UP systems.
I replied to patch 1 with a suggestion; with that change,
for the whole series.
- Josh Triplett