aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-01-21 18:26:03 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-03 14:16:00 -0500
commitd24209bb689e2c7f7418faec9b4a948e922d24da (patch)
tree40db37902a30acb68f5733e666f25ea7b52e8485 /kernel/rcu
parent6629240575992a6f0d18c46f5160b34527b0e501 (diff)
rcu: Improve diagnostics for blocked critical sections in irq
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>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree_plugin.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 0a571e9a0f1d..8a33920b8845 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -334,7 +334,13 @@ void rcu_read_unlock_special(struct task_struct *t)
334 } 334 }
335 335
336 /* Hardware IRQ handlers cannot block, complain if they get here. */ 336 /* Hardware IRQ handlers cannot block, complain if they get here. */
337 if (WARN_ON_ONCE(in_irq() || in_serving_softirq())) { 337 if (in_irq() || in_serving_softirq()) {
338 lockdep_rcu_suspicious(__FILE__, __LINE__,
339 "rcu_read_unlock() from irq or softirq with blocking in critical section!!!\n");
340 pr_alert("->rcu_read_unlock_special: %#x (b: %d, nq: %d)\n",
341 t->rcu_read_unlock_special.s,
342 t->rcu_read_unlock_special.b.blocked,
343 t->rcu_read_unlock_special.b.need_qs);
338 local_irq_restore(flags); 344 local_irq_restore(flags);
339 return; 345 return;
340 } 346 }