rcu: Improve diagnostics for blocked critical sections in irq
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 21 Jan 2015 23:26:03 +0000 (15:26 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 3 Mar 2015 19:16:00 +0000 (11:16 -0800)
If an RCU read-side critical section occurs within an interrupt handler
or a softirq handler, it cannot have been preempted.  Therefore, there is
a check in rcu_read_unlock_special() checking for this error.  However,
when this check triggers, it lacks diagnostic information.  This commit
therefore moves rcu_read_unlock()'s lockdep annotation to follow the
call to __rcu_read_unlock() and changes rcu_read_unlock_special()'s
WARN_ON_ONCE() to an lockdep_rcu_suspicious() in order to locate where
the offending RCU read-side critical section began.  In addition, the
value of the ->rcu_read_unlock_special field is printed.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/lockdep.h
include/linux/rcupdate.h
kernel/rcu/tree_plugin.h

index 74ab231..066ba41 100644 (file)
@@ -531,8 +531,13 @@ do {                                                                       \
 # define might_lock_read(lock) do { } while (0)
 #endif
 
-#ifdef CONFIG_PROVE_RCU
+#ifdef CONFIG_LOCKDEP
 void lockdep_rcu_suspicious(const char *file, const int line, const char *s);
+#else
+static inline void
+lockdep_rcu_suspicious(const char *file, const int line, const char *s)
+{
+}
 #endif
 
 #endif /* __LINUX_LOCKDEP_H */
Simple merge
Simple merge