diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-02-22 20:05:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-25 04:34:59 -0500 |
commit | 3acd9eb31c5f7eb97cb2009fa41472710fb4a10f (patch) | |
tree | a339775ed9683bdf0f4d7b47a75648a6f86a8446 /kernel/rcutree.c | |
parent | 1304afb225288a2e250d6a7495462c28e5509cbb (diff) |
rcu: Fix deadlock in TREE_PREEMPT_RCU CPU stall detection
Under TREE_PREEMPT_RCU, print_other_cpu_stall() invokes
rcu_print_task_stall() with the root rcu_node structure's ->lock
held, and rcu_print_task_stall() acquires that same lock for
self-deadlock. Fix this by removing the lock acquisition from
rcu_print_task_stall(), and making all callers acquire the lock
instead.
Tested-by: John Kacur <jkacur@redhat.com>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Located-by: Thomas Gleixner <tglx@linutronix.de>
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: <1266887105-1528-19-git-send-email-paulmck@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 65a807b4f58c..b07be37d2aa3 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -476,7 +476,9 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
476 | 476 | ||
477 | printk(KERN_ERR "INFO: RCU detected CPU stalls:"); | 477 | printk(KERN_ERR "INFO: RCU detected CPU stalls:"); |
478 | rcu_for_each_leaf_node(rsp, rnp) { | 478 | rcu_for_each_leaf_node(rsp, rnp) { |
479 | raw_spin_lock_irqsave(&rnp->lock, flags); | ||
479 | rcu_print_task_stall(rnp); | 480 | rcu_print_task_stall(rnp); |
481 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | ||
480 | if (rnp->qsmask == 0) | 482 | if (rnp->qsmask == 0) |
481 | continue; | 483 | continue; |
482 | for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++) | 484 | for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++) |