mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	mingo@elte.hu, "Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>
Subject: Re: [BUG] perf: perf_swevent PMU should not be on rotation_list
Date: Wed, 05 Sep 2012 19:06:02 +0200	[thread overview]
Message-ID: <1346864762.2600.30.camel@twins> (raw)
In-Reply-To: <CABPqkBQGNx0od5-nkRDsrXkKa3+TAYW07j59ct5b17gPU-Oqeg@mail.gmail.com>

On Wed, 2012-09-05 at 16:03 +0200, Stephane Eranian wrote:
> Hi,
> 
> I was looking at the rotation code and I found out that when
> I monitor a SW event (in my case a probe), I end up having
> two PMUs on the rotation list on Intel Core: cpu and software.
> 
> I thought there was no multiplexing needed for SW events.

Correct, since programming of swevents should always succeed.

> So why is the SW PMU on the rotation list causing extra
> iterations through the rotation code?

Because... uhm.. someone (probably me) didn't think to exclude swevents.

> Shouldn't we do something like:
> 
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -771,6 +780,9 @@ static void perf_pmu_rotate_start(struct pmu *pmu)
>         struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
>         struct list_head *head = &__get_cpu_var(rotation_list);
> 
> +       if (pmu->type == PERF_TYPE_SOFTWARE)
> +               return;
> +
>         WARN_ON(!irqs_disabled());
> 
>         if (list_empty(&cpuctx->rotation_list))


Yeah, I guess that'll do, although I guess something like:

  pmu->task_ctx_nr == perf_sw_context

would be even better, since that would also work for TYPE_TRACEPOINT and
possibly any other swevent like things.

  reply	other threads:[~2012-09-05 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 14:03 Stephane Eranian
2012-09-05 17:06 ` Peter Zijlstra [this message]
2012-09-05 18:45   ` Stephane Eranian

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=1346864762.2600.30.camel@twins \
    --to=peterz@infradead.org \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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®