mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: kan.liang@intel.com
Cc: linux-kernel@vger.kernel.org, ak@linux.intel.com,
	eranian@google.com, alexander.shishkin@linux.intel.com,
	vincent.weaver@maine.edu
Subject: Re: [RFC 1/1] perf, x86: fix pebs warning by always update msr when disabling pebs event
Date: Thu, 25 Feb 2016 09:25:38 +0100	[thread overview]
Message-ID: <20160225082538.GA6357@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1456347668-3339-1-git-send-email-kan.liang@intel.com>

On Wed, Feb 24, 2016 at 01:01:08PM -0800, kan.liang@intel.com wrote:
> From: Kan Liang <kan.liang@intel.com>
> 
> This patch tries to fix a pebs warning found in my stress test.
> The following perf command can easily trigger the pebs warning or
> spurious NMI error on Skylake/Broadwell/Haswell platforms.
> 
> sudo perf record -e
> 'cpu/umask=0x04,event=0xc4/pp,cycles,branches,ref-cycles,cache-misses,
> cache-references' --call-graph fp -b -c1000 -a
> Also NMI watchdog must be enabled.
> 
> For this case, the events number is larger than counter number. So
> perf has to do multiplexing. In perf_mux_hrtimer_handler, it does
> perf_pmu_disable, schedule out old events, rotate_ctx, schedule in new
> events and finally perf_pmu_enable. If the old events include precise
> event, the MSR_IA32_PEBS_ENABLE should be cleared when perf_pmu_disable.
> The MSR_IA32_PEBS_ENABLE should keep 0 until the perf_pmu_enable is
> called and the new event is precise event.

Right, so intel_pmu_pebs_disable_all() should be called and should be
writing a 0 here.

> However, unfortunately, for some reason, MSR_IA32_PEBS_ENABLE still
> keeps the old state according to my test. 

Yeah, that a problem, please continue looking and find the root cause,
we really do not want to band-aid our way around such problems, that
always leads to surprises later on.

      reply	other threads:[~2016-02-25  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 21:01 kan.liang
2016-02-25  8:25 ` Peter Zijlstra [this message]

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=20160225082538.GA6357@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.weaver@maine.edu \
    /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

Powered by JetHome