Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752198AbcCIFes (ORCPT ); Wed, 9 Mar 2016 00:34:48 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37912 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752556AbcCIFeb (ORCPT ); Wed, 9 Mar 2016 00:34:31 -0500 MIME-Version: 1.0 In-Reply-To: References: <1457034642-21837-1-git-send-email-eranian@google.com> <1457034642-21837-3-git-send-email-eranian@google.com> <20160303214312.GI23621@tassilo.jf.intel.com> <20160307102413.GB6356@twins.programming.kicks-ass.net> <20160307121840.GF6375@twins.programming.kicks-ass.net> <20160307182731.GA12153@krava.redhat.com> <20160307202556.GQ6344@twins.programming.kicks-ass.net> <20160308210707.GG6344@twins.programming.kicks-ass.net> Date: Tue, 8 Mar 2016 21:34:29 -0800 Message-ID: Subject: Re: [PATCH 2/3] perf/x86/pebs: add workaround for broken OVFL status on HSW From: Stephane Eranian To: Peter Zijlstra Cc: Jiri Olsa , Andi Kleen , LKML , Arnaldo Carvalho de Melo , "mingo@elte.hu" , "Liang, Kan" , Namhyung Kim , Adrian Hunter Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4015 Lines: 86 On Tue, Mar 8, 2016 at 1:13 PM, Stephane Eranian wrote: > Hi, > > On Tue, Mar 8, 2016 at 1:07 PM, Peter Zijlstra wrote: >> On Tue, Mar 08, 2016 at 12:59:23PM -0800, Stephane Eranian wrote: >>> hi, >>> >>> On Mon, Mar 7, 2016 at 12:25 PM, Peter Zijlstra wrote: >>> > >>> > On Mon, Mar 07, 2016 at 07:27:31PM +0100, Jiri Olsa wrote: >>> > > On Mon, Mar 07, 2016 at 01:18:40PM +0100, Peter Zijlstra wrote: >>> > > > On Mon, Mar 07, 2016 at 11:24:13AM +0100, Peter Zijlstra wrote: >>> > > > >>> > > > > I suspect Andi is having something along: >>> > > > > >>> > > > > lkml.kernel.org/r/1445458568-16956-1-git-send-email-andi@firstfloor.org >>> > > > > >>> > > > > applied to his tree. >>> > > > >>> > > > OK, I munged a bunch of patches together, please have a hard look at the >>> > > > end result found in: >>> > > > >>> > > > git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core >>> > > > >>> >>> I ran this kernel on Haswell. Even with Andi's fixes the problem I identified is >>> still there, so my patch is still needed. >> >> Right, your patch should be included in that kernel, or did I make a >> royal mess of things? >> > No, it is as expected for the OVF PMI fix. > >> I put Andi's late status ack on top of your patch. >> Ok, I ran into a problem on Broadwell with your branch with Andi's patches. I see a problem which had disappeared since SandyBridge: 11551.128422] ------------[ cut here ]------------ [11551.128435] WARNING: CPU: 3 PID: 12114 at arch/x86/events/intel/core.c:1868 intel_pmu_handle_irq+0x2da/0x4b0() [11551.128437] perfevents: irq loop stuck! [11551.128469] [] dump_stack+0x4d/0x63 [11551.128479] [] warn_slowpath_common+0x97/0xe0 [11551.128482] [] warn_slowpath_fmt+0x46/0x50 [11551.128486] [] intel_pmu_handle_irq+0x2da/0x4b0 [11551.128491] [] perf_event_nmi_handler+0x39/0x60 [11551.128494] [] nmi_handle+0x61/0x110 [11551.128497] [] default_do_nmi+0x44/0x110 [11551.128500] [] do_nmi+0xd7/0x140 [11551.128504] [] end_repeat_nmi+0x1a/0x1e [11551.128507] [] ? native_write_msr+0x6/0x30 [11551.128510] [] ? native_write_msr+0x6/0x30 [11551.128514] [] ? native_write_msr+0x6/0x30 [11551.128515] <> [] ? intel_pmu_enable_event+0x215/0x230 [11551.128520] [] x86_pmu_start+0x8d/0x120 [11551.128523] [] x86_pmu_enable+0x27b/0x2f0 [11551.128527] [] perf_pmu_enable+0x1d/0x30 [11551.128530] [] ctx_resched+0x5a/0x70 [11551.128532] [] __perf_event_enable+0x1ac/0x210 [11551.128537] [] event_function+0xa1/0x170 [11551.128540] [] ? perf_duration_warn+0x70/0x70 [11551.128543] [] remote_function+0x47/0x60 [11551.128547] [] generic_exec_single+0xa8/0xb0 [11551.128550] [] ? perf_duration_warn+0x70/0x70 [11551.128553] [] ? perf_duration_warn+0x70/0x70 [11551.128555] [] smp_call_function_single+0xa8/0x100 [11551.128559] [] event_function_call+0x84/0x100 [11551.128561] [] ? ctx_resched+0x70/0x70 [11551.128564] [] ? ctx_resched+0x70/0x70 [11551.128566] [] ? perf_ctx_lock+0x30/0x30 [11551.128570] [] _perf_event_enable+0x60/0x80 [11551.128572] [] perf_ioctl+0x271/0x3e0 The infinite loop in the irq handler! But here it seems there is a race with a perf_events ioctl() to likely reset the period. I am not using the perf tool here just running a self-monitoring task. >> Also note, Ingo merged most of those patches today, all except the top >> 3, because Andi wanted to double check something. >