mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	mingo@kernel.org, alexander.shishkin@linux.intel.com,
	hpa@zytor.com, bp@alien8.de, brgerst@gmail.com,
	luto@amacapital.net, oleg@redhat.com, akpm@linux-foundation.org,
	tglx@linutronix.de, dvlasenk@redhat.com
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/urgent] perf/x86/intel: Fix PMI handling for Intel PT
Date: Wed, 24 Jun 2015 15:16:48 +0200	[thread overview]
Message-ID: <20150624131648.GM3644@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <tip-1b7b938f181742f899a2f31c280f79dabef6ddb6@git.kernel.org>

On Fri, Jun 19, 2015 at 10:58:36AM -0700, tip-bot for Alexander Shishkin wrote:
> @@ -371,12 +373,24 @@ int x86_add_exclusive(unsigned int what)
>  
>  out:
>  	mutex_unlock(&pmc_reserve_mutex);
> +
> +	/*
> +	 * Assuming that all exclusive events will share the PMI handler
> +	 * (which checks active_events for whether there is work to do),
> +	 * we can bump active_events counter right here, except for
> +	 * x86_lbr_exclusive_lbr events that go through x86_pmu_event_init()
> +	 * path, which already bumps active_events for them.
> +	 */
> +	if (!ret && what != x86_lbr_exclusive_lbr)
> +		atomic_inc(&active_events);
> +
>  	return ret;
>  }
>  
>  void x86_del_exclusive(unsigned int what)
>  {
>  	atomic_dec(&x86_pmu.lbr_exclusive[what]);
> +	atomic_dec(&active_events);
>  }
>  

This, conditional inc, unconditional dec.

This leads to active_events == 0 even though there's still the NMI
watchdog active generating NMIs.

I would say, drop the condition on inc, double inc isn't a problem as
long as we match with a double dec and that results in simpler code too.

  parent reply	other threads:[~2015-06-24 13:17 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
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 [this message]
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=20150624131648.GM3644@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

Powered by JetHome