Commit 64ce3126 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf: De-schedule a task context when removing the last event

Since perf_install_in_context() will now install a context when we
add the first event, we can de-schedule the context when the last
event is removed.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110409192142.090431763@chello.nlSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e03a9a55
...@@ -1120,6 +1120,10 @@ static int __perf_remove_from_context(void *info) ...@@ -1120,6 +1120,10 @@ static int __perf_remove_from_context(void *info)
raw_spin_lock(&ctx->lock); raw_spin_lock(&ctx->lock);
event_sched_out(event, cpuctx, ctx); event_sched_out(event, cpuctx, ctx);
list_del_event(event, ctx); list_del_event(event, ctx);
if (!ctx->nr_events && cpuctx->task_ctx == ctx) {
ctx->is_active = 0;
cpuctx->task_ctx = NULL;
}
raw_spin_unlock(&ctx->lock); raw_spin_unlock(&ctx->lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment