mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, Stephane Eranian <eranian@google.com>,
	John Sperbeck <jsperbeck@google.com>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [PATCH 1/2] perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS
Date: Thu, 26 Nov 2020 13:13:29 +0100	[thread overview]
Message-ID: <20201126121329.GJ3040@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201126110922.317681-1-namhyung@kernel.org>

On Thu, Nov 26, 2020 at 08:09:21PM +0900, Namhyung Kim wrote:
> The commit 3966c3feca3f ("x86/perf/amd: Remove need to check "running"
> bit in NMI handler") introduced this.  It seems x86_pmu_stop can be
> called recursively (like when it losts some samples) like below:
> 
>   x86_pmu_stop
>     intel_pmu_disable_event  (x86_pmu_disable)
>       intel_pmu_pebs_disable
>         intel_pmu_drain_pebs_nhm  (x86_pmu_drain_pebs_buffer)
>           x86_pmu_stop
> 
> While commit 35d1ce6bec13 ("perf/x86/intel/ds: Fix x86_pmu_stop
> warning for large PEBS") fixed it for the normal cases, there's
> another path to call x86_pmu_stop() recursively when a PEBS error was
> detected (like two or more counters overflowed at the same time).
> 
> Like in the Kan's previous fix, we can skip the interrupt accounting
> for large PEBS, so check the iregs which is set for PMI only.
> 
> Fixes: 3966c3feca3f ("x86/perf/amd: Remove need to check "running" bit in NMI handler")
> Reported-by: John Sperbeck <jsperbeck@google.com>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Cc: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Thanks for both!

  parent reply	other threads:[~2020-11-26 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 11:09 Namhyung Kim
2020-11-26 11:09 ` [PATCH 2/2] perf/x86/intel: Check PEBS status correctly Namhyung Kim
2020-12-03  9:07   ` [tip: perf/urgent] " tip-bot2 for Stephane Eranian
2020-11-26 12:13 ` Peter Zijlstra [this message]
2020-12-03  9:07 ` [tip: perf/urgent] perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS tip-bot2 for Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201126121329.GJ3040@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Thomas.Lendacky@amd.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=jsperbeck@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®