aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2009-10-07 00:48:18 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-07 02:11:21 -0400
commit978c0b88146a7f9b364b71b5b83c5b12e7b413d7 (patch)
treeb68bedc40888192d329841a786f3b1214eab91ef /kernel
parente74f4c4564455c91a3b4075bb1721993c2a95dda (diff)
rcu: Place root rcu_node structure in separate lockdep class
Before this patch, all of the rcu_node structures were in the same lockdep class, so that lockdep would complain when rcu_preempt_offline_tasks() acquired the root rcu_node structure's lock while holding one of the leaf rcu_nodes' locks. This patch changes rcu_init_one() to use a separate spin_lock_init() for the root rcu_node structure's lock than is used for that of all of the rest of the rcu_node structures, which puts the root rcu_node structure's lock in its own lockdep class. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: akpm@linux-foundation.org Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com LKML-Reference: <12548908983277-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index d8d98655c9e7..705f02ac7433 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1647,7 +1647,8 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1647 cpustride *= rsp->levelspread[i]; 1647 cpustride *= rsp->levelspread[i];
1648 rnp = rsp->level[i]; 1648 rnp = rsp->level[i];
1649 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { 1649 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) {
1650 spin_lock_init(&rnp->lock); 1650 if (rnp != rcu_get_root(rsp))
1651 spin_lock_init(&rnp->lock);
1651 rnp->gpnum = 0; 1652 rnp->gpnum = 0;
1652 rnp->qsmask = 0; 1653 rnp->qsmask = 0;
1653 rnp->qsmaskinit = 0; 1654 rnp->qsmaskinit = 0;
@@ -1670,6 +1671,7 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1670 INIT_LIST_HEAD(&rnp->blocked_tasks[1]); 1671 INIT_LIST_HEAD(&rnp->blocked_tasks[1]);
1671 } 1672 }
1672 } 1673 }
1674 spin_lock_init(&rcu_get_root(rsp)->lock);
1673} 1675}
1674 1676
1675/* 1677/*