[PATCH RFC tip/core/rcu 12/16] rcu: disable CPU stall warnings upon panic

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Thursday, April 15, 2010 - 11:13 am

The current RCU CPU stall warnings remain enabled even after a panic
occurs, which some people have found to be a bit counterproductive.
This patch therefore uses a notifier to disable stall warnings once a
panic occurs.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 3623f8e..595fb83 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -449,6 +449,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
 
 #ifdef CONFIG_RCU_CPU_STALL_DETECTOR
 
+int rcu_cpu_stall_panicking __read_mostly;
+
 static void record_gp_stall_check_time(struct rcu_state *rsp)
 {
 	rsp->gp_start = jiffies;
@@ -526,6 +528,8 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
 	long delta;
 	struct rcu_node *rnp;
 
+	if (rcu_cpu_stall_panicking)
+		return;
 	delta = jiffies - rsp->jiffies_stall;
 	rnp = rdp->mynode;
 	if ((rnp->qsmask & rdp->grpmask) && delta >= 0) {
@@ -540,6 +544,21 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
 	}
 }
 
+static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr)
+{
+	rcu_cpu_stall_panicking = 1;
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block rcu_panic_block = {
+	.notifier_call = rcu_panic,
+};
+
+static void __init check_cpu_stall_init(void)
+{
+	atomic_notifier_chain_register(&panic_notifier_list, &rcu_panic_block);
+}
+
 #else /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
 
 static void record_gp_stall_check_time(struct rcu_state *rsp)
@@ -550,6 +569,10 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
 {
 }
 
+static void __init check_cpu_stall_init(void)
+{
+}
+
 #endif /* #else #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
 
 /*
@@ -1934,6 +1957,7 @@ void __init rcu_init(void)
 	cpu_notifier(rcu_cpu_notify, 0);
 	for_each_online_cpu(cpu)
 		rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu);
+	check_cpu_stall_init();
 }
 
 #include "rcutree_plugin.h"
-- 
1.7.0

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH tip/core/rcu 0/16] rcu: v2 patches queued for 2.6.35, Paul E. McKenney, (Thu Apr 15, 11:12 am)
[PATCH RFC tip/core/rcu 01/16] rcu: substitute set_need_re ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 02/16] rcu: make dead code really dead, Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 03/16] rcu: move some code from ma ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 04/16] rcu: ignore offline CPUs in ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 05/16] rcu: Fix bogus CONFIG_PROVE ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 06/16] rcu: fix now-bogus rcu_sche ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 07/16] rcu: shrink rcutiny by maki ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 08/16] rcu: rename rcutiny rcu_ctr ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 09/16] rcu: refactor RCU's context ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 10/16] rcu: slim down rcutiny by r ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 11/16] rcu: enable CPU_STALL_VERBO ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 12/16] rcu: disable CPU stall warn ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 13/16] rcu: print boot-time consol ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 14/16] rcu: improve RCU CPU stall- ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 15/16] rcu: permit discontiguous c ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
[PATCH RFC tip/core/rcu 16/16] rcu: v2: reduce the number ..., Paul E. McKenney, (Thu Apr 15, 11:13 am)
Re: [PATCH RFC tip/core/rcu 07/16] rcu: shrink rcutiny by ..., Paul E. McKenney, (Tue Apr 20, 8:05 am)
Re: [PATCH RFC tip/core/rcu 10/16] rcu: slim down rcutiny ..., Paul E. McKenney, (Tue Apr 20, 12:18 pm)