rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Stefan Reiter <stefan@pimaker.at>
Cc: rcu@vger.kernel.org, Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu/nocb: Fix dump_tree hierarchy print always active
Date: Fri, 4 Oct 2019 15:24:02 -0700	[thread overview]
Message-ID: <20191004222402.GQ2689@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20191004194854.11352-1-stefan@pimaker.at>

On Fri, Oct 04, 2019 at 07:49:10PM +0000, Stefan Reiter wrote:
> Commit 18cd8c93e69e ("rcu/nocb: Print gp/cb kthread hierarchy if
> dump_tree") added print statements to rcu_organize_nocb_kthreads for
> debugging, but incorrectly guarded them, causing the function to always
> spew out its message.
> 
> This patch fixes it by guarding both pr_alert statements with dump_tree,
> while also changing the second pr_alert to a pr_cont, to print the
> hierarchy in a single line (assuming that's how it was supposed to
> work).
> 
> Fixes: 18cd8c93e69e ("rcu/nocb: Print gp/cb kthread hierarchy if dump_tree")
> Signed-off-by: Stefan Reiter <stefan@pimaker.at>

Queued for testing and review, thank you!

> ---
> 
> First time contributing to the kernel, hope I'm doing this right :)

Looks good so far.  Then again, I just kicked off the tests.  ;-)

							Thanx, Paul

>  kernel/rcu/tree_plugin.h | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index 2defc7fe74c3..7cbf4a0f3eff 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -2346,15 +2346,19 @@ static void __init rcu_organize_nocb_kthreads(void)
>  			nl = DIV_ROUND_UP(rdp->cpu + 1, ls) * ls;
>  			rdp->nocb_gp_rdp = rdp;
>  			rdp_gp = rdp;
> -			if (!firsttime && dump_tree)
> -				pr_cont("\n");
> -			firsttime = false;
> -			pr_alert("%s: No-CB GP kthread CPU %d:", __func__, cpu);
> +			if (dump_tree) {
> +				if (!firsttime)
> +					pr_cont("\n");
> +				firsttime = false;
> +				pr_alert("%s: No-CB GP kthread CPU %d:",
> +					 __func__, cpu);
> +			}
>  		} else {
>  			/* Another CB kthread, link to previous GP kthread. */
>  			rdp->nocb_gp_rdp = rdp_gp;
>  			rdp_prev->nocb_next_cb_rdp = rdp;
> -			pr_alert(" %d", cpu);
> +			if (dump_tree)
> +				pr_cont(" %d", cpu);
>  		}
>  		rdp_prev = rdp;
>  	}
> -- 
> 2.23.0
> 
> 

  reply	other threads:[~2019-10-04 22:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 19:49 [PATCH] rcu/nocb: Fix dump_tree hierarchy print always active Stefan Reiter
2019-10-04 22:24 ` Paul E. McKenney [this message]
2019-10-07  1:26   ` Paul E. McKenney
2019-10-07 17:56     ` Stefan

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=20191004222402.GQ2689@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stefan@pimaker.at \
    /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).