mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
perf: Optimize perf_event_task_sched_out
Remove an update_context_time() call from the perf_event_task_sched_out() path and into the branch its needed. The call was both superfluous, because __perf_event_sched_out() already does it, and wrong, because it was done without holding ctx->lock. Place it in perf_event_sync_stat(), which is the only place it is needed and which does already hold ctx->lock. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20091120212508.779516394@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
abf4868b85
commit
02ffdbc866
1 changed files with 2 additions and 2 deletions
|
@ -1120,6 +1120,8 @@ static void perf_event_sync_stat(struct perf_event_context *ctx,
|
||||||
if (!ctx->nr_stat)
|
if (!ctx->nr_stat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
update_context_time(ctx);
|
||||||
|
|
||||||
event = list_first_entry(&ctx->event_list,
|
event = list_first_entry(&ctx->event_list,
|
||||||
struct perf_event, event_entry);
|
struct perf_event, event_entry);
|
||||||
|
|
||||||
|
@ -1163,8 +1165,6 @@ void perf_event_task_sched_out(struct task_struct *task,
|
||||||
if (likely(!ctx || !cpuctx->task_ctx))
|
if (likely(!ctx || !cpuctx->task_ctx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
update_context_time(ctx);
|
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
parent = rcu_dereference(ctx->parent_ctx);
|
parent = rcu_dereference(ctx->parent_ctx);
|
||||||
next_ctx = next->perf_event_ctxp;
|
next_ctx = next->perf_event_ctxp;
|
||||||
|
|
Loading…
Reference in a new issue