mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
perf_counter: Fix an ipi-deadlock
perf_pending_counter() is called from IRQ context and will call perf_counter_disable(), however perf_counter_disable() uses smp_call_function_single() which doesn't fancy being used with IRQs disabled due to IPI deadlocks. Fix this by making it use the local __perf_counter_disable() call and teaching the counter_sched_out() code about pending disables as well. This should cover the case where a counter migrates before the pending queue gets processed. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Corey J Ashford <cjashfor@us.ibm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: stephane eranian <eranian@googlemail.com> LKML-Reference: <20090813103655.244097721@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
3dab77fb1b
commit
970892a903
1 changed files with 5 additions and 1 deletions
|
@ -307,6 +307,10 @@ counter_sched_out(struct perf_counter *counter,
|
|||
return;
|
||||
|
||||
counter->state = PERF_COUNTER_STATE_INACTIVE;
|
||||
if (counter->pending_disable) {
|
||||
counter->pending_disable = 0;
|
||||
counter->state = PERF_COUNTER_STATE_OFF;
|
||||
}
|
||||
counter->tstamp_stopped = ctx->time;
|
||||
counter->pmu->disable(counter);
|
||||
counter->oncpu = -1;
|
||||
|
@ -2343,7 +2347,7 @@ static void perf_pending_counter(struct perf_pending_entry *entry)
|
|||
|
||||
if (counter->pending_disable) {
|
||||
counter->pending_disable = 0;
|
||||
perf_counter_disable(counter);
|
||||
__perf_counter_disable(counter);
|
||||
}
|
||||
|
||||
if (counter->pending_wakeup) {
|
||||
|
|
Loading…
Reference in a new issue