rcu: Provide API to suppress stall warnings while sysrc runs
authorRik van Riel <riel@redhat.com>
Sun, 27 Apr 2014 06:15:35 +0000 (23:15 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 19 May 2014 17:52:04 +0000 (10:52 -0700)
Some sysrq handlers can run for a long time, because they dump a lot
of data onto a serial console. Having RCU stall warnings pop up in
the middle of them only makes the problem worse.

This commit provides rcu_sysrq_start() and rcu_sysrq_end() APIs to
temporarily suppress RCU CPU stall warnings while a sysrq request is
handled.

Signed-off-by: Rik van Riel <riel@redhat.com>
[ paulmck: Fix TINY_RCU build error. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rcupdate.h
kernel/rcu/update.c

index 9ccd644c12344b790ece59cb29f86b1564189a7c..5a75d19aa661e1f01f62c76eea3f314aa688e806 100644 (file)
@@ -248,6 +248,18 @@ void rcu_idle_exit(void);
 void rcu_irq_enter(void);
 void rcu_irq_exit(void);
 
+#ifdef CONFIG_RCU_STALL_COMMON
+void rcu_sysrq_start(void);
+void rcu_sysrq_end(void);
+#else /* #ifdef CONFIG_RCU_STALL_COMMON */
+static inline void rcu_sysrq_start(void)
+{
+}
+static inline void rcu_sysrq_end(void)
+{
+}
+#endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */
+
 #ifdef CONFIG_RCU_USER_QS
 void rcu_user_enter(void);
 void rcu_user_exit(void);
index ed7a0d72562c3734e97676ca45d0db8ea0e2cc5e..a2aeb4df0f603e9ebf2b3a19d764291a3965d3e0 100644 (file)
@@ -320,6 +320,18 @@ int rcu_jiffies_till_stall_check(void)
        return till_stall_check * HZ + RCU_STALL_DELAY_DELTA;
 }
 
+void rcu_sysrq_start(void)
+{
+       if (!rcu_cpu_stall_suppress)
+               rcu_cpu_stall_suppress = 2;
+}
+
+void rcu_sysrq_end(void)
+{
+       if (rcu_cpu_stall_suppress == 2)
+               rcu_cpu_stall_suppress = 0;
+}
+
 static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr)
 {
        rcu_cpu_stall_suppress = 1;