aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-01-04 19:04:02 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-13 03:06:07 -0500
commitb6407e863934965cdc66cbc244d811ceeb6f4d77 (patch)
tree5fb8f9fe233a2084f283887e019e6bf5ac6fac29 /kernel/rcutree.c
parentcba8244a0f1c277b6b1e48ed6504fa434119e24d (diff)
rcu: Give different levels of the rcu_node hierarchy distinct lockdep names
Previously, each level of the rcu_node hierarchy had the same rather unimaginative name: "&rcu_node_class[i]". This makes lockdep diagnostics involving these lockdep classes less helpful than would be nice. This patch fixes this by giving each level of the rcu_node hierarchy a distinct name: "rcu_node_level_0", "rcu_node_level_1", and so on. This version of the patch includes improved diagnostics suggested by Josh Triplett and Peter Zijlstra. 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: <12626498421830-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 0a4c32879398..3b13d64b010b 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1811,11 +1811,17 @@ static void __init rcu_init_levelspread(struct rcu_state *rsp)
1811 */ 1811 */
1812static void __init rcu_init_one(struct rcu_state *rsp) 1812static void __init rcu_init_one(struct rcu_state *rsp)
1813{ 1813{
1814 static char *buf[] = { "rcu_node_level_0",
1815 "rcu_node_level_1",
1816 "rcu_node_level_2",
1817 "rcu_node_level_3" }; /* Match MAX_RCU_LVLS */
1814 int cpustride = 1; 1818 int cpustride = 1;
1815 int i; 1819 int i;
1816 int j; 1820 int j;
1817 struct rcu_node *rnp; 1821 struct rcu_node *rnp;
1818 1822
1823 BUILD_BUG_ON(MAX_RCU_LVLS > ARRAY_SIZE(buf)); /* Fix buf[] init! */
1824
1819 /* Initialize the level-tracking arrays. */ 1825 /* Initialize the level-tracking arrays. */
1820 1826
1821 for (i = 1; i < NUM_RCU_LVLS; i++) 1827 for (i = 1; i < NUM_RCU_LVLS; i++)
@@ -1829,7 +1835,8 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1829 rnp = rsp->level[i]; 1835 rnp = rsp->level[i];
1830 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { 1836 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) {
1831 spin_lock_init(&rnp->lock); 1837 spin_lock_init(&rnp->lock);
1832 lockdep_set_class(&rnp->lock, &rcu_node_class[i]); 1838 lockdep_set_class_and_name(&rnp->lock,
1839 &rcu_node_class[i], buf[i]);
1833 rnp->gpnum = 0; 1840 rnp->gpnum = 0;
1834 rnp->qsmask = 0; 1841 rnp->qsmask = 0;
1835 rnp->qsmaskinit = 0; 1842 rnp->qsmaskinit = 0;