[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200211150615.GK2935@paulmck-ThinkPad-P72>
Date: Tue, 11 Feb 2020 07:06:15 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Thomas Gleixner <tglx@...utronix.de>,
Josh Triplett <josh@...htriplett.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: [PATCH] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf
trace point hook
On Tue, Feb 11, 2020 at 09:05:03AM -0500, Steven Rostedt wrote:
> On Tue, 11 Feb 2020 12:49:54 +0100
> Peter Zijlstra <peterz@...radead.org> wrote:
>
> > On Mon, Feb 10, 2020 at 05:06:43PM -0500, Steven Rostedt wrote:
> > > + if (!rcu_watching) { \
> > > + /* Can not use RCU if rcu is not watching and in NMI */ \
> > > + if (in_nmi()) \
> > > + return; \
> > > + rcu_irq_enter_irqson(); \
> > > + } \
> >
> > I saw the same weirdness in __trace_stack(), and I'm confused by it.
> >
> > How can we ever get to: in_nmi() && !rcu_watching() ? That should be a
> > BUG. In particular, nmi_enter() has rcu_nmi_enter().
> >
> > Paul, can that really happen?
>
> The stack tracer connects to the function tracer and is called at all
> the places that function tracing can be called from. As I like being
> able to trace RCU internal functions (especially as they are complex),
> I don't want to set them all to notrace. But, for callbacks that
> require RCU to be watching, we need this check, because there's some
> internal state that we can be in an NMI and RCU is not watching (as
> there's some places in nmi_enter that can be traced!).
>
> And if we are tracing preempt_enable and preempt_disable (as Joel added
> trace events there), it may be the case for trace events too.
Ah, thank you for the reminder!
Should Documentation/RCU/Design/Requirements/Requirements.rst be
updated to include this?
And I have to ask... What happens if we are very early in from-idle
NMI entry (or very late in NMI exit), such that both in_nmi() and
rcu_is_watching() are returning false? Or did I miss a turn somewhere?
Thanx, Paul
Powered by blists - more mailing lists