[PATCH v4 05/12] arm-cci: PMU: Add support for transactions

Peter Zijlstra peterz at infradead.org
Fri Dec 18 02:42:34 PST 2015


On Fri, Dec 18, 2015 at 10:28:23AM +0000, Suzuki K. Poulose wrote:
> On 17/12/15 18:42, Peter Zijlstra wrote:

> >The above doesn't look like it has a failure case, in which case you can
> >achieve the same simpler, using pmu::pmu_{dis,en}able().
> >
> 
> I thought about that, but was not sure if pmu->stop() is guaranteed to be
> called on all the events scheduled on the PMU when we pmu::pmu_disable().
> Is it ?

Not by core code, but you get to implement your pmu::pmu_disable() call,
and if that's what you need, you can make it do that.

Examples:

On some x86 hardware we indeed have to poke at each counter control
register and clear the ENable bit, which is the same what
pmu::stop(.flags=0) would do.

But other x86 hardware has a global disable switch, which is much
cheaper than poking at the individual counter control registers one by
one. In this case we only update the counter control register if it
needs updates (typically in the pmu_enable path).

Yet other x86 hardware can auto disable this global state on interrupt,
which saves us yet another machine register poke.





More information about the linux-arm-kernel mailing list