Skip to content

Commit

Permalink
perf_event: x86: Optimize x86_pmu_disable()
Browse files Browse the repository at this point in the history
x86_pmu_disable() removes the event from the cpuc->event_list[], however
since an event can only be on that list once, stop looking after we found
it.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jan 29, 2010
1 parent c933c1a commit 6c9687a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ static void x86_pmu_disable(struct perf_event *event)
cpuc->event_list[i-1] = cpuc->event_list[i];

--cpuc->n_events;
break;
}
}
perf_event_update_userpage(event);
Expand Down

0 comments on commit 6c9687a

Please sign in to comment.