linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] tracing: Have stack tracer force RCU to be watching
Date: Wed, 21 Oct 2015 10:01:42 +0200	[thread overview]
Message-ID: <20151021080142.GZ2881@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20151020173228.3e4edda5@gandalf.local.home>

On Tue, Oct 20, 2015 at 05:32:28PM -0400, Steven Rostedt wrote:
> On Tue, 20 Oct 2015 13:25:28 -0700
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On Tue, Oct 20, 2015 at 12:10:31PM -0400, Steven Rostedt wrote:
> > > 
> > > Paul,
> > > 
> > > I've spent a couple of days debugging this, and finally found that my
> > > stack tracer was calling the stack trace code, which calls
> > > __module_address() which asserts the below.
> > > 
> > > Is just calling rcu_irq_enter() and rcu_irq_exit() safe to do
> > > everywhere (with interrupts always disabled)? This patch appears to fix
> > > the bug.
> > 
> > Yep!  Just don't call it from an NMI handler.  And don't call it with
> > interrupts enabled.  The patch looks to have interrupts always disabled,
> > and the surrounding code doesn't look like NMI-safe code anyway, so
> > should be OK.
> > 
> > 							Thanx, Paul
> >
> 
> Hmm, good point about NMI handler. Right now I think the only thing
> protecting this from getting in the critical section while in NMI is
> the check that we are using the task struct stack. But that may not be
> enough in 32 bit.
> 
> I should probably add a "if (in_nmi()) return" somewhere.

But if there's an arch that doesn't use a separate NMI stack, the NMI
might cause the largest stack, which would then remain invisible from
the stack-tracer.

Should we not instead fix the NMI-safety of this tracer?

  parent reply	other threads:[~2015-10-21  8:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 16:10 [RFC][PATCH] tracing: Have stack tracer force RCU to be watching Steven Rostedt
2015-10-20 20:25 ` Paul E. McKenney
2015-10-20 21:32   ` Steven Rostedt
2015-10-20 23:48     ` Paul E. McKenney
2015-10-20 23:55       ` Steven Rostedt
2015-10-21 17:46         ` Steven Rostedt
2015-10-21  8:01     ` Peter Zijlstra [this message]
2015-10-21 11:39       ` Steven Rostedt
2015-10-21 11:52         ` Peter Zijlstra

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=20151021080142.GZ2881@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    /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).