diff options
author | chao <chao@eero.com> | 2020-08-30 23:41:17 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-11-19 19:37:16 -0800 |
commit | dfe564045c653d9e6969ccca57a8a04771d333f7 (patch) | |
tree | 7131af1630ff2c254d7304dc5f835765f486f379 /kernel/rcu/tree_stall.h | |
parent | 29368e09392123800e5e2bf0f3eda91f16972e52 (diff) | |
download | linux-dfe564045c653d9e6969ccca57a8a04771d333f7.tar.bz2 |
rcu: Panic after fixed number of stalls
Some stalls are transient, so that system fully recovers. This commit
therefore allows users to configure the number of stalls that must happen
in order to trigger kernel panic.
Signed-off-by: chao <chao@eero.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/tree_stall.h')
-rw-r--r-- | kernel/rcu/tree_stall.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index ca21d28a0f98..70d48c52fabc 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -13,6 +13,7 @@ /* panic() on RCU Stall sysctl. */ int sysctl_panic_on_rcu_stall __read_mostly; +int sysctl_max_rcu_stall_to_panic __read_mostly; #ifdef CONFIG_PROVE_RCU #define RCU_STALL_DELAY_DELTA (5 * HZ) @@ -106,6 +107,11 @@ early_initcall(check_cpu_stall_init); /* If so specified via sysctl, panic, yielding cleaner stall-warning output. */ static void panic_on_rcu_stall(void) { + static int cpu_stall; + + if (++cpu_stall < sysctl_max_rcu_stall_to_panic) + return; + if (sysctl_panic_on_rcu_stall) panic("RCU Stall\n"); } |