perf_counter: Fix swcounter context invariance
authorPeter Zijlstra <peterz@infradead.org>
Thu, 13 Aug 2009 07:51:55 +0000 (09:51 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 13 Aug 2009 10:18:43 +0000 (12:18 +0200)
commitbcfc2602e8541ac13b1def38e2591dca072cff7a
tree0e5601dac2fbc4ca1ff452cebd1adb345b710599
parent8fd101f20bdf771949a8f3a5a779877d09b2fb56
perf_counter: Fix swcounter context invariance

perf_swcounter_is_counting() uses a lock, which means we cannot
use swcounters from NMI or when holding that particular lock,
this is unintended.

The below removes the lock, this opens up race window, but not
worse than the swcounters already experience due to RCU
traversal of the context in perf_swcounter_ctx_event().

This also fixes the hard lockups while opening a lockdep
tracepoint counter.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: stephane eranian <eranian@googlemail.com>
Cc: Corey J Ashford <cjashfor@us.ibm.com>
LKML-Reference: <1250149915.10001.66.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c