aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2009-10-26 13:24:31 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-26 16:07:16 -0400
commit88b91c7ca49bc8600cf1106eb891d08c1965b9ce (patch)
tree0b45d744c0016e11d70d56f864ad95f321b3ddea /kernel
parent4ce5b90340879ce93d169b7b523c2cbbe7c45843 (diff)
rcu: Simplify creating of lockdep class for root rcu_node
Use lockdep_set_class() to simplify the code and to avoid any additional overhead in the !LOCKDEP case. Also move the definition of rcu_root_class into kernel/rcutree.c, as suggested by Lai Jiangshan. Signed-off-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: 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: <1256577871443-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index ddbf111e9e18..055f1a941a9e 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -51,6 +51,8 @@
51 51
52/* Data structures. */ 52/* Data structures. */
53 53
54static struct lock_class_key rcu_root_class;
55
54#define RCU_STATE_INITIALIZER(name) { \ 56#define RCU_STATE_INITIALIZER(name) { \
55 .level = { &name.node[0] }, \ 57 .level = { &name.node[0] }, \
56 .levelcnt = { \ 58 .levelcnt = { \
@@ -1666,8 +1668,7 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1666 cpustride *= rsp->levelspread[i]; 1668 cpustride *= rsp->levelspread[i];
1667 rnp = rsp->level[i]; 1669 rnp = rsp->level[i];
1668 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { 1670 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) {
1669 if (rnp != rcu_get_root(rsp)) 1671 spin_lock_init(&rnp->lock);
1670 spin_lock_init(&rnp->lock);
1671 rnp->gpnum = 0; 1672 rnp->gpnum = 0;
1672 rnp->qsmask = 0; 1673 rnp->qsmask = 0;
1673 rnp->qsmaskinit = 0; 1674 rnp->qsmaskinit = 0;
@@ -1690,7 +1691,7 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1690 INIT_LIST_HEAD(&rnp->blocked_tasks[1]); 1691 INIT_LIST_HEAD(&rnp->blocked_tasks[1]);
1691 } 1692 }
1692 } 1693 }
1693 spin_lock_init(&rcu_get_root(rsp)->lock); 1694 lockdep_set_class(&rcu_get_root(rsp)->lock, &rcu_root_class);
1694} 1695}
1695 1696
1696/* 1697/*