Re: [PATCH 5/9] perf/x86: implement cross-HT corruption bug workaround

From: Peter Zijlstra
Date: Thu Jun 05 2014 - 10:45:49 EST


On Thu, Jun 05, 2014 at 04:26:38PM +0200, Stephane Eranian wrote:
> On Thu, Jun 5, 2014 at 4:21 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > We could limit each cpu to num_counters/2 exclusive slots. That'll still
> > be painful with some constrained events I imagine, but in general that
> > should 'work' I suppose.
>
> That is probably the easiest solution, just modify the dynamic constraint
> mask some more. Have not yet tried it.

Right, see what happens :-)

> The repatriation of the leaked count is not so easy either. Need to IPI
> the other HT. There may be some restrictions as to when we can
> safely do this.

Yes, that'll be 'interesting'. You typically cannot do things like
smp_function_call() from IRQ/NMI context. Which leaves you to
asynchonous IPIs.

I suppose the easiest way is to simply push the count out to the right
event when you reprogram the sibling. And maybe kick it every so often
to force do this just in case the PMU doesn't get reprogrammed a lot.

Still tricky.

Attachment: pgpKTZ9YIZyLE.pgp
Description: PGP signature