linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	"Joel Fernandes, Google" <joel@joelfernandes.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	paulmck <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH v2] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf trace point hook
Date: Tue, 11 Feb 2020 11:35:05 -0500	[thread overview]
Message-ID: <20200211113505.0a1b52e9@gandalf.local.home> (raw)
In-Reply-To: <698566505.617724.1581438456170.JavaMail.zimbra@efficios.com>

On Tue, 11 Feb 2020 11:27:36 -0500 (EST)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> ----- On Feb 11, 2020, at 11:18 AM, rostedt rostedt@goodmis.org wrote:
> 
> > On Tue, 11 Feb 2020 16:34:52 +0100
> > Peter Zijlstra <peterz@infradead.org> wrote:
> >   
> >> > +		if (unlikely(in_nmi()))
> >> > +			goto out;  
> >> 
> >> unless I'm mistaken, we can simply do rcu_nmi_enter() in this case, and
> >> rcu_nmi_exit() on the other end.
> >>   
> >> > +		rcu_irq_enter_irqson();  
> > 
> > The thing is, I don't think this can ever happen. We've had in the
> > tracepoint.h:
> > 
> >		/* srcu can't be used from NMI */			\
> >		WARN_ON_ONCE(rcuidle && in_nmi());			\
> > 
> > And this has yet to trigger.  
> 
> But that "rcuidle" state is defined on a per-tracepoint basis, whereas
> "!rcu_is_watching()" is a state which depends on the current execution
> context. I don't follow how the fact that this WARN_ON_ONCE() never
> triggered allows us to infer anything about (!rcu_is_watching() && in_nmi()).
>

The "_rcuidle()" version of the tracepoint was to be used in places
that RCU may not be watching, otherwise you would get a lockdep splat.

As that "rcuidle" variable is a hardcoded constant, it would be
compiled out when rcuidle is zero. But, in all purposes, rcuidle is
basically equivalent to rcu_is_watching(), because if it wasn't you
would have lockdep splats.

-- Steve

  reply	other threads:[~2020-02-11 16:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 14:50 [PATCH v2] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf trace point hook Steven Rostedt
2020-02-11 15:34 ` Mathieu Desnoyers
2020-02-11 15:46   ` Peter Zijlstra
2020-02-11 16:02     ` Mathieu Desnoyers
2020-02-11 15:34 ` Peter Zijlstra
2020-02-11 16:18   ` Steven Rostedt
2020-02-11 16:27     ` Mathieu Desnoyers
2020-02-11 16:35       ` Steven Rostedt [this message]
2020-02-11 17:29     ` Peter Zijlstra
2020-02-11 17:32       ` Peter Zijlstra
2020-02-11 18:54         ` Paul E. McKenney
2020-02-12  8:05           ` Peter Zijlstra
2020-02-12  9:05             ` Paul E. McKenney
2020-02-11 17:35       ` Mathieu Desnoyers
2020-02-12  8:02         ` Peter Zijlstra
2020-02-12 15:14           ` Mathieu Desnoyers

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=20200211113505.0a1b52e9@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.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=paulmck@kernel.org \
    --cc=peterz@infradead.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).