linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E. McKenney" <paulmck@linux.ibm.com>
Subject: [PATCH tip/core/rcu 05/14] rcu: Add state name to show_rcu_gp_kthreads() output
Date: Sun, 11 Nov 2018 11:28:55 -0800	[thread overview]
Message-ID: <20181111192904.3199-5-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20181111192839.GA32144@linux.ibm.com>

This commit adds the name of the RCU grace-period state to
the show_rcu_gp_kthreads() output in order to ease debugging.
This commit also moves gp_state_getname() up in the code so that
show_rcu_gp_kthreads() can use it.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/rcu/tree.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 36e30150e1e9..ea78532183ac 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -499,6 +499,16 @@ void rcu_force_quiescent_state(void)
 }
 EXPORT_SYMBOL_GPL(rcu_force_quiescent_state);
 
+/*
+ * Convert a ->gp_state value to a character string.
+ */
+static const char *gp_state_getname(short gs)
+{
+	if (gs < 0 || gs >= ARRAY_SIZE(gp_state_names))
+		return "???";
+	return gp_state_names[gs];
+}
+
 /*
  * Show the state of the grace-period kthreads.
  */
@@ -508,8 +518,9 @@ void show_rcu_gp_kthreads(void)
 	struct rcu_data *rdp;
 	struct rcu_node *rnp;
 
-	pr_info("%s: wait state: %d ->state: %#lx\n", rcu_state.name,
-		rcu_state.gp_state, rcu_state.gp_kthread->state);
+	pr_info("%s: wait state: %s(%d) ->state: %#lx\n", rcu_state.name,
+		gp_state_getname(rcu_state.gp_state), rcu_state.gp_state,
+		rcu_state.gp_kthread->state);
 	rcu_for_each_node_breadth_first(rnp) {
 		if (ULONG_CMP_GE(rcu_state.gp_seq, rnp->gp_seq_needed))
 			continue;
@@ -1142,16 +1153,6 @@ static void record_gp_stall_check_time(void)
 	rcu_state.n_force_qs_gpstart = READ_ONCE(rcu_state.n_force_qs);
 }
 
-/*
- * Convert a ->gp_state value to a character string.
- */
-static const char *gp_state_getname(short gs)
-{
-	if (gs < 0 || gs >= ARRAY_SIZE(gp_state_names))
-		return "???";
-	return gp_state_names[gs];
-}
-
 /*
  * Complain about starvation of grace-period kthread.
  */
-- 
2.17.1


  parent reply	other threads:[~2018-11-11 19:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 19:28 [PATCH tip/core/rcu 0/14] Miscellaneous fixes for v4.21/v5.0 Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 01/14] rcu: Stop expedited grace periods from relying on stop-machine Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 02/14] MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 03/14] rcu: Avoid double multiply by HZ Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 04/14] rcu: Parameterize rcu_check_gp_start_stall() Paul E. McKenney
2018-11-11 19:28 ` Paul E. McKenney [this message]
2018-11-11 19:28 ` [PATCH tip/core/rcu 06/14] rcu: Add jiffies-since-GP-activity to show_rcu_gp_kthreads() Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 07/14] rcu: Adjust the comment of function rcu_is_watching Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 08/14] rcu: Trace end of grace period before end of grace period Paul E. McKenney
2018-11-11 19:28 ` [PATCH tip/core/rcu 09/14] rcu: Speed up expedited GPs when interrupting RCU reader Paul E. McKenney
2018-11-11 19:29 ` [PATCH tip/core/rcu 10/14] rcu: Replace this_cpu_ptr() with __this_cpu_read() Paul E. McKenney
2018-11-11 19:29 ` [PATCH tip/core/rcu 11/14] rcu: Avoid signed integer overflow in rcu_preempt_deferred_qs() Paul E. McKenney
2018-11-11 19:29 ` [PATCH tip/core/rcu 12/14] MAINTAINERS: Add Joel Fernandes as RCU reviewer Paul E. McKenney
2018-11-11 19:29 ` [PATCH tip/core/rcu 13/14] checkpatch: Create table of obsolete APIs and apply to RCU Paul E. McKenney
2018-11-11 19:29 ` [PATCH tip/core/rcu 14/14] checkpatch.pl: Suggest lockdep instead of asserting !spin_is_locked() 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=20181111192904.3199-5-paulmck@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.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).