linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, dvhltc@us.ibm.com, niv@us.ibm.com,
	tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH RFC tip/core/rcu 14/16] rcu: improve RCU CPU stall-warning messages
Date: Thu, 15 Apr 2010 11:13:37 -0700	[thread overview]
Message-ID: <1271355219-20714-14-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100415181255.GA19588@linux.vnet.ibm.com>

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>
---
 kernel/rcutree.c |   20 +++++++++++---------
 kernel/rcutree.h |    1 +
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index ec6196f..f391886 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -54,8 +54,8 @@
 
 static struct lock_class_key rcu_node_class[NUM_RCU_LVLS];
 
-#define RCU_STATE_INITIALIZER(name) { \
-	.level = { &name.node[0] }, \
+#define RCU_STATE_INITIALIZER(structname) { \
+	.level = { &structname.node[0] }, \
 	.levelcnt = { \
 		NUM_RCU_LVL_0,  /* root of hierarchy. */ \
 		NUM_RCU_LVL_1, \
@@ -66,13 +66,14 @@ static struct lock_class_key rcu_node_class[NUM_RCU_LVLS];
 	.signaled = RCU_GP_IDLE, \
 	.gpnum = -300, \
 	.completed = -300, \
-	.onofflock = __RAW_SPIN_LOCK_UNLOCKED(&name.onofflock), \
+	.onofflock = __RAW_SPIN_LOCK_UNLOCKED(&structname.onofflock), \
 	.orphan_cbs_list = NULL, \
-	.orphan_cbs_tail = &name.orphan_cbs_list, \
+	.orphan_cbs_tail = &structname.orphan_cbs_list, \
 	.orphan_qlen = 0, \
-	.fqslock = __RAW_SPIN_LOCK_UNLOCKED(&name.fqslock), \
+	.fqslock = __RAW_SPIN_LOCK_UNLOCKED(&structname.fqslock), \
 	.n_force_qs = 0, \
 	.n_force_qs_ngp = 0, \
+	.name = #structname, \
 }
 
 struct rcu_state rcu_sched_state = RCU_STATE_INITIALIZER(rcu_sched_state);
@@ -483,7 +484,8 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
 
 	/* OK, time to rat on our buddy... */
 
-	printk(KERN_ERR "INFO: RCU detected CPU stalls:");
+	printk(KERN_ERR "INFO: %s detected stalls on CPUs/tasks: {",
+	       rsp->name);
 	rcu_for_each_leaf_node(rsp, rnp) {
 		raw_spin_lock_irqsave(&rnp->lock, flags);
 		rcu_print_task_stall(rnp);
@@ -494,7 +496,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
 			if (rnp->qsmask & (1UL << cpu))
 				printk(" %d", rnp->grplo + cpu);
 	}
-	printk(" (detected by %d, t=%ld jiffies)\n",
+	printk("} (detected by %d, t=%ld jiffies)\n",
 	       smp_processor_id(), (long)(jiffies - rsp->gp_start));
 	trigger_all_cpu_backtrace();
 
@@ -510,8 +512,8 @@ static void print_cpu_stall(struct rcu_state *rsp)
 	unsigned long flags;
 	struct rcu_node *rnp = rcu_get_root(rsp);
 
-	printk(KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu jiffies)\n",
-			smp_processor_id(), jiffies - rsp->gp_start);
+	printk(KERN_ERR "INFO: %s detected stall on CPU %d (t=%lu jiffies)\n",
+	       rsp->name, smp_processor_id(), jiffies - rsp->gp_start);
 	trigger_all_cpu_backtrace();
 
 	raw_spin_lock_irqsave(&rnp->lock, flags);
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index 4a525a3..11f1711 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -326,6 +326,7 @@ struct rcu_state {
 	unsigned long jiffies_stall;		/* Time at which to check */
 						/*  for CPU stalls. */
 #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
+	char *name;				/* Name of structure. */
 };
 
 /* Return values for rcu_preempt_offline_tasks(). */
-- 
1.7.0


  parent reply	other threads:[~2010-04-15 18:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 18:12 [PATCH tip/core/rcu 0/16] rcu: v2 patches queued for 2.6.35 Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 01/16] rcu: substitute set_need_resched for sending resched IPIs Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 02/16] rcu: make dead code really dead Paul E. McKenney
2010-04-15 23:52   ` Josh Triplett
2010-04-16 14:23     ` Paul E. McKenney
2010-04-16 21:16       ` Josh Triplett
2010-04-16 22:29         ` Paul E. McKenney
2010-04-17  4:53           ` Josh Triplett
2010-04-18  1:12             ` Paul E. McKenney
2010-04-18  3:53               ` Josh Triplett
2010-04-18 13:42                 ` Paul E. McKenney
2010-04-18 21:12                   ` Josh Triplett
2010-04-18 21:54                     ` Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 03/16] rcu: move some code from macro to function Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 04/16] rcu: ignore offline CPUs in last non-dyntick-idle CPU check Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 05/16] rcu: Fix bogus CONFIG_PROVE_LOCKING in comments to reflect reality Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 06/16] rcu: fix now-bogus rcu_scheduler_active comments Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 07/16] rcu: shrink rcutiny by making synchronize_rcu_bh() be inline Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 08/16] rcu: rename rcutiny rcu_ctrlblk to rcu_sched_ctrlblk Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 09/16] rcu: refactor RCU's context-switch handling Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 10/16] rcu: slim down rcutiny by removing rcu_scheduler_active and friends Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 11/16] rcu: enable CPU_STALL_VERBOSE by default Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 12/16] rcu: disable CPU stall warnings upon panic Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 13/16] rcu: print boot-time console messages if RCU configs out of ordinary Paul E. McKenney
2010-04-15 18:13 ` Paul E. McKenney [this message]
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 15/16] rcu: permit discontiguous cpu_possible_mask CPU numbering Paul E. McKenney
2010-04-15 18:13 ` [PATCH RFC tip/core/rcu 16/16] rcu: v2: reduce the number of spurious RCU_SOFTIRQ invocations Paul E. McKenney
2010-04-20 10:11 ` [PATCH RFC tip/core/rcu 07/16] rcu: shrink rcutiny by making synchronize_rcu_bh() be inline David Howells
2010-04-20 15:05   ` Paul E. McKenney
2010-04-20 10:15 ` [PATCH RFC tip/core/rcu 10/16] rcu: slim down rcutiny by removing rcu_scheduler_active and friends David Howells
2010-04-20 19:18   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1271355219-20714-14-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).