Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752571AbcCGKYd (ORCPT ); Mon, 7 Mar 2016 05:24:33 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:37261 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500AbcCGKYU (ORCPT ); Mon, 7 Mar 2016 05:24:20 -0500 Date: Mon, 7 Mar 2016 11:24:13 +0100 From: Peter Zijlstra To: Stephane Eranian Cc: Andi Kleen , LKML , Arnaldo Carvalho de Melo , "mingo@elte.hu" , "Liang, Kan" , Jiri Olsa , Namhyung Kim , Adrian Hunter Subject: Re: [PATCH 2/3] perf/x86/pebs: add workaround for broken OVFL status on HSW Message-ID: <20160307102413.GB6356@twins.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 35 On Thu, Mar 03, 2016 at 03:40:49PM -0800, Stephane Eranian wrote: > On Thu, Mar 3, 2016 at 1:43 PM, Andi Kleen wrote: > > > > > + /* > > > + * There are cases where, even though, the PEBS ovfl bit is set in > > > + * GLOBAL_OVF_STATUS, the PEBS events may also have their overflow bits > > > + * set for their counters. We must clear them here because they have > > > + * been processed as exact samples in the drain_pebs() routine. They > > > + * must not be processed again in the for_each_bit_set() loop for > > > + * regular samples below. > > > + */ > > > + status &= ~cpuc->pebs_enabled; > > > + status &= x86_pmu.intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI; > > > > If you just clear the bits here they will not be acked and stay around > > forever in GLOBAL_STATUS, which causes other problems. > > > > You need a separate ack_status variable that contains all bits and is always > > acked. > > I understand that. You mean I need to that has all the bits that were set to > call intel_pmu_ack_status(). > > But if you look at the code, and where I made the change, there is no more > intel_pmu_ack_status() BEFORE you read the status again via > intel_pmu_get_status(). > > So why would I need to keep another variable around? I suspect Andi is having something along: lkml.kernel.org/r/1445458568-16956-1-git-send-email-andi@firstfloor.org applied to his tree.