rcu: Give different levels of the rcu_node hierarchy distinct lockdep names
[cascardo/linux.git] / kernel / rcutree.c
index 0a4c328..3b13d64 100644 (file)
@@ -1811,11 +1811,17 @@ static void __init rcu_init_levelspread(struct rcu_state *rsp)
  */
 static void __init rcu_init_one(struct rcu_state *rsp)
 {
+       static char *buf[] = { "rcu_node_level_0",
+                              "rcu_node_level_1",
+                              "rcu_node_level_2",
+                              "rcu_node_level_3" };  /* Match MAX_RCU_LVLS */
        int cpustride = 1;
        int i;
        int j;
        struct rcu_node *rnp;
 
+       BUILD_BUG_ON(MAX_RCU_LVLS > ARRAY_SIZE(buf));  /* Fix buf[] init! */
+
        /* Initialize the level-tracking arrays. */
 
        for (i = 1; i < NUM_RCU_LVLS; i++)
@@ -1829,7 +1835,8 @@ static void __init rcu_init_one(struct rcu_state *rsp)
                rnp = rsp->level[i];
                for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) {
                        spin_lock_init(&rnp->lock);
-                       lockdep_set_class(&rnp->lock, &rcu_node_class[i]);
+                       lockdep_set_class_and_name(&rnp->lock,
+                                                  &rcu_node_class[i], buf[i]);
                        rnp->gpnum = 0;
                        rnp->qsmask = 0;
                        rnp->qsmaskinit = 0;