rcu: Add debug check for too many rcu_read_unlock()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 5 Jan 2010 00:04:01 +0000 (16:04 -0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 13 Jan 2010 08:06:06 +0000 (09:06 +0100)
commitcba8244a0f1c277b6b1e48ed6504fa434119e24d
treebecfa7d6f653774f72f411002626e791243e5057
parentf9094d8e5587cf21091a9516628147c0b55e4264
rcu: Add debug check for too many rcu_read_unlock()

TREE_PREEMPT_RCU maintains an rcu_read_lock_nesting counter in
the task structure, which happens to be a signed int.  So this
patch adds a check for this counter being negative at the end of
__rcu_read_unlock(). This check is under CONFIG_PROVE_LOCKING,
so can be thought of as being part of lockdep.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: josh@joshtriplett.org
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: dhowells@redhat.com
LKML-Reference: <12626498423064-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/rcutree_plugin.h