Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758661AbcCDInn (ORCPT ); Fri, 4 Mar 2016 03:43:43 -0500 Received: from ozlabs.org ([103.22.144.67]:35829 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751585AbcCDInm (ORCPT ); Fri, 4 Mar 2016 03:43:42 -0500 Message-ID: <1457081014.20076.6.camel@ellerman.id.au> Subject: Re: hw_breakpoint: Fix Oops at destroying hw_breakpoint event on powerpc From: Michael Ellerman To: Peter Zijlstra Cc: Ravi Bangoria , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, acme@kernel.org, mingo@redhat.com, paulus@samba.org Date: Fri, 04 Mar 2016 19:43:34 +1100 In-Reply-To: <20160303102002.GK6356@twins.programming.kicks-ass.net> References: <1456912517-5711-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <20160302115324.63B35140BF5@ozlabs.org> <20160302115942.GC6356@twins.programming.kicks-ass.net> <1456997018.335.7.camel@ellerman.id.au> <20160303102002.GK6356@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 36 On Thu, 2016-03-03 at 11:20 +0100, Peter Zijlstra wrote: > On Thu, Mar 03, 2016 at 08:23:38PM +1100, Michael Ellerman wrote: > > On Wed, 2016-03-02 at 12:59 +0100, Peter Zijlstra wrote: > > Indeed, but if there's a preemption point in between setting and using > that state, the ctx->task pointer might not actually still point to the > same task. With inherited events the event might get swapped to the next > task if it has the exact same (inherited) event configuration instead of > reprogramming the hardware. Yep that sounds like it would be bad for this code. > > I can't think of a reason why we can't also store it per-cpu, but I could be > > wrong, I don't know the code well and I haven't thought about it for very long. > > Right, so I'm not really up to snuff on the whole hw_breakpoint stuff > either, that was bolted onto perf by mingo, fweisbec, kprasad and others > while I was doing PMU bits, and I've never really dug into it. > > I understand kprasad is no longer with IBM, his email bounced. That's a > shame because he knew about this stuff.. :/ I don't know that for sure but I suspect you're right, which is definitely a shame. > > Do you mind if I merge the following fix for now as a band-aid, and we'll try > > and fix it up properly in the next few weeks (but maybe not in time for 4.5 > > final). > > OK, that works for me. > > Acked-by: Peter Zijlstra (Intel) Thanks. I've merged it into my fixes branch. cheers