mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Zhen Lei <thunder.leizhen@huawei.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	rcu@vger.kernel.org
Subject: Re: [PATCH v3 1/3] rcu/exp: Use NMI to get the backtrace of cpu_curr(other_cpu) first
Date: Mon, 1 Aug 2022 16:14:15 -0700	[thread overview]
Message-ID: <20220801231415.GC2860372@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <20220730102330.1255-2-thunder.leizhen@huawei.com>

On Sat, Jul 30, 2022 at 06:23:28PM +0800, Zhen Lei wrote:
> The backtrace of cpu_curr(other_cpu) is unwinded based on the 'fp' saved
> during its last switch-out. For the most part, it's out of date. So try
> to use NMI to get the backtrace first, just like those functions in
> "tree_stall.h" did. Such as rcu_dump_cpu_stacks().
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Much better, thank you!

> ---
>  kernel/rcu/tree_exp.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
> index 0f70f62039a9090..21381697de23f0b 100644
> --- a/kernel/rcu/tree_exp.h
> +++ b/kernel/rcu/tree_exp.h
> @@ -665,7 +665,8 @@ static void synchronize_rcu_expedited_wait(void)
>  				mask = leaf_node_cpu_bit(rnp, cpu);
>  				if (!(READ_ONCE(rnp->expmask) & mask))
>  					continue;
> -				dump_cpu_task(cpu);
> +				if (!trigger_single_cpu_backtrace(cpu))
> +					dump_cpu_task(cpu);

But why not just leave this unchanged, rather than adding the call to
trigger_single_cpu_backtrace() in this patch and then removing it in
the next patch?

							Thanx, Paul

>  			}
>  		}
>  		jiffies_stall = 3 * rcu_exp_jiffies_till_stall_check() + 3;
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-08-01 23:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30 10:23 [PATCH v3 0/3] rcu: Display registers of self-detected stall as far as possible Zhen Lei
2022-07-30 10:23 ` [PATCH v3 1/3] rcu/exp: Use NMI to get the backtrace of cpu_curr(other_cpu) first Zhen Lei
2022-08-01 23:14   ` Paul E. McKenney [this message]
2022-08-02  2:06     ` Leizhen (ThunderTown)
2022-08-04  0:07       ` Paul E. McKenney
2022-08-04  1:34         ` Leizhen (ThunderTown)
2022-07-30 10:23 ` [PATCH v3 2/3] sched/debug: Try trigger_single_cpu_backtrace(cpu) in dump_cpu_task() Zhen Lei
2022-07-30 10:23 ` [PATCH v3 3/3] sched/debug: Show the registers of 'current' " Zhen Lei

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=20220801231415.GC2860372@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=thunder.leizhen@huawei.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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

all inboxes | Powered by JetHome®