Commit 4300aa642cc9ecb35f2e0683dd294fb790ef028c

Authored by Paul E. McKenney
1 parent 26845c2860

rcu: improve RCU CPU stall-warning messages

The existing RCU CPU stall-warning messages can be confusing, especially
in the case where one CPU detects a single other stalled CPU.  In addition,
the console messages did not say which flavor of RCU detected the stall,
which can make it difficult to work out exactly what is causing the stall.
This commit improves these messages.

Requested-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Showing 2 changed files with 12 additions and 9 deletions Side-by-side Diff

... ... @@ -54,8 +54,8 @@
54 54  
55 55 static struct lock_class_key rcu_node_class[NUM_RCU_LVLS];
56 56  
57   -#define RCU_STATE_INITIALIZER(name) { \
58   - .level = { &name.node[0] }, \
  57 +#define RCU_STATE_INITIALIZER(structname) { \
  58 + .level = { &structname.node[0] }, \
59 59 .levelcnt = { \
60 60 NUM_RCU_LVL_0, /* root of hierarchy. */ \
61 61 NUM_RCU_LVL_1, \
62 62  
63 63  
64 64  
... ... @@ -66,13 +66,14 @@
66 66 .signaled = RCU_GP_IDLE, \
67 67 .gpnum = -300, \
68 68 .completed = -300, \
69   - .onofflock = __RAW_SPIN_LOCK_UNLOCKED(&name.onofflock), \
  69 + .onofflock = __RAW_SPIN_LOCK_UNLOCKED(&structname.onofflock), \
70 70 .orphan_cbs_list = NULL, \
71   - .orphan_cbs_tail = &name.orphan_cbs_list, \
  71 + .orphan_cbs_tail = &structname.orphan_cbs_list, \
72 72 .orphan_qlen = 0, \
73   - .fqslock = __RAW_SPIN_LOCK_UNLOCKED(&name.fqslock), \
  73 + .fqslock = __RAW_SPIN_LOCK_UNLOCKED(&structname.fqslock), \
74 74 .n_force_qs = 0, \
75 75 .n_force_qs_ngp = 0, \
  76 + .name = #structname, \
76 77 }
77 78  
78 79 struct rcu_state rcu_sched_state = RCU_STATE_INITIALIZER(rcu_sched_state);
... ... @@ -483,7 +484,8 @@
483 484  
484 485 /* OK, time to rat on our buddy... */
485 486  
486   - printk(KERN_ERR "INFO: RCU detected CPU stalls:");
  487 + printk(KERN_ERR "INFO: %s detected stalls on CPUs/tasks: {",
  488 + rsp->name);
487 489 rcu_for_each_leaf_node(rsp, rnp) {
488 490 raw_spin_lock_irqsave(&rnp->lock, flags);
489 491 rcu_print_task_stall(rnp);
... ... @@ -494,7 +496,7 @@
494 496 if (rnp->qsmask & (1UL << cpu))
495 497 printk(" %d", rnp->grplo + cpu);
496 498 }
497   - printk(" (detected by %d, t=%ld jiffies)\n",
  499 + printk("} (detected by %d, t=%ld jiffies)\n",
498 500 smp_processor_id(), (long)(jiffies - rsp->gp_start));
499 501 trigger_all_cpu_backtrace();
500 502  
... ... @@ -510,8 +512,8 @@
510 512 unsigned long flags;
511 513 struct rcu_node *rnp = rcu_get_root(rsp);
512 514  
513   - printk(KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu jiffies)\n",
514   - smp_processor_id(), jiffies - rsp->gp_start);
  515 + printk(KERN_ERR "INFO: %s detected stall on CPU %d (t=%lu jiffies)\n",
  516 + rsp->name, smp_processor_id(), jiffies - rsp->gp_start);
515 517 trigger_all_cpu_backtrace();
516 518  
517 519 raw_spin_lock_irqsave(&rnp->lock, flags);
... ... @@ -326,6 +326,7 @@
326 326 unsigned long jiffies_stall; /* Time at which to check */
327 327 /* for CPU stalls. */
328 328 #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
  329 + char *name; /* Name of structure. */
329 330 };
330 331  
331 332 /* Return values for rcu_preempt_offline_tasks(). */