[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201125073646.GL2414@hirez.programming.kicks-ass.net>
Date: Wed, 25 Nov 2020 08:36:46 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Stephane Eranian <eranian@...gle.com>
Cc: Namhyung Kim <namhyung@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
John Sperbeck <jsperbeck@...gle.com>,
"Lendacky, Thomas" <Thomas.Lendacky@....com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [RFC] perf/x86: Fix a warning on x86_pmu_stop()
On Tue, Nov 24, 2020 at 12:19:34AM -0800, Stephane Eranian wrote:
> Hi,
>
> Another remark on the PEBS drainage code, it seems to me like a test
> is not quite correct:
> intel_pmu_drain_pebs_nhm()
> {
> ...
> if (p->status != (1ULL << bit)) {
> for_each_set_bit(i, (unsigned long *)&pebs_status, size)
> error[i]++;
> continue;
> }
>
> The kernel cannot disambiguate when 2+ PEBS counters overflow at the
> same time. This is what the comment for this code suggests.
> However, I see the comparison is done with the unfiltered p->status
> which is a copy of IA32_PERF_GLOBAL_STATUS at the time of
> the sample. This register contains more than the PEBS counter overflow
> bits. It also includes many other bits which could also be set.
>
> Shouldn't this test use pebs_status instead (which covers only the
> PEBS counters)?
Hmm, yes, think so.
Powered by blists - more mailing lists