mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
perf_counter: Robustify counter-free logic
This fixes a nasty crash and highlights a bug that we were freeing failed-fork() counters incorrectly. (the fix for that will come separately) [ Impact: fix crashes/lockups with inherited counters ] Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
3f4dee2273
commit
012b84dae1
1 changed files with 4 additions and 0 deletions
|
@ -1004,6 +1004,10 @@ static void __perf_counter_task_sched_out(struct perf_counter_context *ctx)
|
||||||
|
|
||||||
if (!cpuctx->task_ctx)
|
if (!cpuctx->task_ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (WARN_ON_ONCE(ctx != cpuctx->task_ctx))
|
||||||
|
return;
|
||||||
|
|
||||||
__perf_counter_sched_out(ctx, cpuctx);
|
__perf_counter_sched_out(ctx, cpuctx);
|
||||||
cpuctx->task_ctx = NULL;
|
cpuctx->task_ctx = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue