perf_counter: powerpc: Implement interrupt throttling
authorPaul Mackerras <paulus@samba.org>
Tue, 26 May 2009 06:27:59 +0000 (16:27 +1000)
committerIngo Molnar <mingo@elte.hu>
Tue, 26 May 2009 07:43:59 +0000 (09:43 +0200)
commit8a7b8cb91f26a671f22cedc7fd54508667f2d9b9
tree6d3401bcea7b636a24e904310504f85c7a51ad6a
parent0127c3ea082ee9f1034789b978dfc7fd83254617
perf_counter: powerpc: Implement interrupt throttling

This implements interrupt throttling on powerpc.  Since we don't have
individual count enable/disable or interrupt enable/disable controls
per counter, this simply sets the hardware counter to 0, meaning that
it will not interrupt again until it has counted 2^31 counts, which
will take at least 2^30 cycles assuming a maximum of 2 counts per
cycle.  Also, we set counter->hw.period_left to the maximum possible
value (2^63 - 1), so we won't report overflows for this counter for
the forseeable future.

The unthrottle operation restores counter->hw.period_left and the
hardware counter so that we will once again report a counter overflow
after counter->hw.irq_period counts.

[ Impact: new perfcounters robustness feature on PowerPC ]

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <18971.35823.643362.446774@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/kernel/perf_counter.c