Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbbFRQae (ORCPT ); Thu, 18 Jun 2015 12:30:34 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:54628 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752393AbbFRQaZ (ORCPT ); Thu, 18 Jun 2015 12:30:25 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Thu, 18 Jun 2015 09:30:16 -0700 From: "Paul E. McKenney" To: Ingo Molnar Cc: Alexander Shishkin , Peter Zijlstra , Vince Weaver , linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo , Stephane Eranian Subject: Re: perf: aux area related crash and warnings Message-ID: <20150618163016.GB3913@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150615122054.GY3644@twins.programming.kicks-ass.net> <87egld2l2o.fsf@ashishki-desk.ger.corp.intel.com> <87381rg9zx.fsf@ashishki-desk.ger.corp.intel.com> <20150618090954.GB22009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150618090954.GB22009@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061816-8236-0000-0000-00000C749A7F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 37 On Thu, Jun 18, 2015 at 11:09:55AM +0200, Ingo Molnar wrote: > > * Alexander Shishkin 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/