public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vince Weaver <vincent.weaver@maine.edu>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Stephane Eranian <eranian@gmail.com>
Subject: Re: perf: aux area related crash and warnings
Date: Thu, 18 Jun 2015 09:30:16 -0700	[thread overview]
Message-ID: <20150618163016.GB3913@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150618090954.GB22009@gmail.com>

On Thu, Jun 18, 2015 at 11:09:55AM +0200, Ingo Molnar wrote:
> 
> * Alexander Shishkin <alexander.shishkin@linux.intel.com> wrote:
> 
> > +void rb_free_aux(struct ring_buffer *rb)
> > +{
> > +	/*
> > +	 * hold rb::refcount to make sure rb doesn't disappear
> > +	 * before aux pages are freed
> > +	 */
> > +	if (WARN_ON_ONCE(!atomic_inc_not_zero(&rb->refcount)))
> > +		return;
> > +
> > +	if (atomic_dec_and_test(&rb->aux_refcount))
> > +		call_rcu(&rb->rcu_head, rb_free_rcu);
> > +	else
> > +		ring_buffer_put(rb);	/* matches the increment above */
> 
> Is call_rcu() NMI-safe? I don't think so ...

Definitely not!  ;-)

> I think the life time rules of this object are really messed up if they can be 
> freed from any fast path. How come the freeing can happen in NMI context? 
> Shouldn't the hardware first stop, then we can free things from the system call 
> path, or so?
> 
> Thanks,
> 
> 	Ingo
> 


  parent reply	other threads:[~2015-06-18 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12  3:15 perf: aux area related crash and warnings Vince Weaver
2015-06-12 18:42 ` Vince Weaver
2015-06-15 12:20   ` Peter Zijlstra
2015-06-15 12:49     ` Alexander Shishkin
2015-06-15 20:24       ` Ingo Molnar
2015-06-16 11:37       ` Alexander Shishkin
2015-06-18  9:09         ` Ingo Molnar
2015-06-18  9:35           ` Alexander Shishkin
2015-06-18 10:24             ` Peter Zijlstra
2015-06-18 16:30           ` Paul E. McKenney [this message]
2015-06-18 10:32         ` Peter Zijlstra
2015-06-18 13:11           ` Alexander Shishkin
2015-06-19 14:21           ` Vince Weaver
2015-07-06 15:34           ` [tip:perf/urgent] perf: Fix AUX buffer refcounting tip-bot for 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=20150618163016.GB3913@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.weaver@maine.edu \
    /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