Thread (26 messages) 26 messages, 6 authors, 2007-08-08

[PATCH -rt 1/9] preempt rcu: check for underflow

flat view
STALE6999d

From: Daniel Walker <hidden>
Date: 2007-07-30 02:47:39
Also in: lkml

Simple WARN_ON to catch any underflow in rcu_read_lock_nesting.

Signed-off-by: Daniel Walker <redacted>

---
 kernel/rcupreempt.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6.22/kernel/rcupreempt.c
===================================================================
--- linux-2.6.22.orig/kernel/rcupreempt.c
+++ linux-2.6.22/kernel/rcupreempt.c
@@ -157,6 +157,12 @@ void __rcu_read_unlock(void)
 	}
 
 	local_irq_restore(oldirq);
+
+	/*
+	 * If our rcu_read_lock_nesting went negative, likely
+	 * something is wrong..
+	 */
+	WARN_ON(current->rcu_read_lock_nesting < 0);
 }
 
 static void __rcu_advance_callbacks(void)
-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help