linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, adrian.hunter@intel.com,
	x86@kernel.org, hpa@zytor.com, acme@infradead.org
Subject: Re: [PATCH 2/2] perf/x86/intel: Fix PMI handling for Intel PT
Date: Fri, 12 Jun 2015 15:09:53 +0200	[thread overview]
Message-ID: <20150612130953.GA19282@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <87k2v92t0s.fsf@ashishki-desk.ger.corp.intel.com>

On Fri, Jun 12, 2015 at 12:08:35PM +0300, Alexander Shishkin wrote:
> From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Date: Tue, 9 Jun 2015 13:03:26 +0300
> Subject: [PATCH] perf/x86/intel: Fix PMI handling for Intel PT
> 
> Since Intel PT is a separate pmu and is not using any of the x86_pmu
> code paths, which means in particular that active_events counter remains
> intact when new PT events are created. However, PT uses x86_pmu PMI
> handler for its PMI handling needs. The problem here is that the latter
> checks active_events and in case of it being zero, exits without calling
> the actual x86_pmu.handle_nmi(), which results in unknown NMI errors and
> massive data loss for PT.
> 
> The effect is not visible if there are other perf events in the system
> at the same time that keep active_events counter non-zero, for instance
> if the NMI watchdog is running, so one needs to disable it to reproduce
> the problem.
> 
> At the same time, the active_events counter besides doing what the name
> suggests also implicitly serves as a pmc hardware and DS area reference
> counter.
> 
> This patch adds a separate reference counter for the pmc hardware, leaving
> active_events for actually counting the events and makes sure it also
> counts PT and BTS events.
> 
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>

Thanks.

  reply	other threads:[~2015-06-12 13:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 12:13 [PATCH 0/2] perf/x86/intel: Fixes for PT and BTS Alexander Shishkin
2015-06-11 12:13 ` [PATCH 1/2] perf/x86/intel/bts: Fix DS area sharing with x86_pmu events Alexander Shishkin
2015-06-19 17:58   ` [tip:perf/urgent] " tip-bot for Alexander Shishkin
2015-06-11 12:13 ` [PATCH 2/2] perf/x86/intel: Fix PMI handling for Intel PT Alexander Shishkin
2015-06-11 14:00   ` Peter Zijlstra
2015-06-12  9:08     ` Alexander Shishkin
2015-06-12 13:09       ` Peter Zijlstra [this message]
2015-06-19 17:58       ` [tip:perf/urgent] " tip-bot for Alexander Shishkin
2015-06-24 12:21         ` Peter Zijlstra
2015-06-24 13:16         ` Peter Zijlstra
2015-06-24 14:47           ` Peter Zijlstra
2015-07-01  6:57             ` [tip:perf/urgent] perf/x86: Fix 'active_events' imbalance tip-bot for Peter Zijlstra

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=20150612130953.GA19282@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@infradead.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).