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

Borislav Petkov
2014-06-05T14:05:42Z

On Thu, Jun 05, 2014 at 03:42:14PM +0200, Stephane Eranian wrote:
> I gave a test case earlier:
>
> # echo 0 >/proc/sys/kernel/nmi_watchdog
> # run_my_uniform_workload_on_all_cpus &
> # perf stat -a -e r81d0,r01d1,r08d0,r20d1 sleep 5
>
> That run gives the correct answer.
>
> If I just look at CPU0 CPU4 siblings:
>
> CPU0, counter0 leaks N counts to CPU4, counter 0
>
> but at the same time:
>
> CPU4, counter0 leaks N counts to CPU0, counter 0
>
> This is because we have the same event in the same
> counter AND the workload is uniform, meaning the
> event (here loads retired) occurs at the same rate
> on both siblings.
>
> You can test this by measuring only on one HT.
> # perf stat -a -C0 -e r81d0,r01d1,r08d0,r20d1 sleep 5
>
> Note that some events, leak more than they count.

Ok, so AFAIU, this particular workload counts correctly just because
counters leak the same amount. If so, what happens if you run this exact
same workload with the workaround enabled? I read something about a bit
more counter multiplexing... or is there a more serious issue?

Thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--