lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1346864762.2600.30.camel@twins>
Date:	Wed, 05 Sep 2012 19:06:02 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, mingo@...e.hu,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [BUG] perf: perf_swevent PMU should not be on rotation_list

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ