Re: [PATCH 9/9] perf/x86: add syfs entry to disable HT bug workaround

Peter Zijlstra
2014-06-05T13:20:01Z

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

On Thu, Jun 05, 2014 at 11:29:33AM +0200, Stephane Eranian wrote:

> If you know what you are doing (poweruser), then there are measurements
> which works fine with the HT erratum. This is why we have the option.
>
> For instance if you only measure events 4x4 in system-wide mode
> and you know which counters these event are going to use, you don't
> need the workaround. For instance:
>
> # perf stat -a -e r81d0,r01d1,r08d0,r20d1 sleep 5
>
> Works well if you have a uniform workload across all CPUs.
> All those events leak, but the leaks balance themselves and you
> get the correct counts in the end. The advantage is that you don't
> have to multiplex. With the workaround enable, this would multiplex
> a lot.
>
> But as I said, this is for experts only.

Still seems tricky, you really want those pinned to make that guarantee,
and even then its a stretch. I don't think perf tool exposes the pinned
attribute though, or I'm just not looking right.

I say stretch, because while I think it'll work out and we'll end up
programming the counters the same way on each cpu, we really do not make
that guarantee either, pinned or not.

I think I agree with Matt in that exposing this to userspace is really
asking for trouble.

Now, I've not yet read through the entire patch series, but how
impossible is it to allow programming the exact same event on both HT
siblings?

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]