From: Peter Zijlstra Date: Mon, 25 Jan 2010 10:57:25 +0000 (+0100) Subject: perf_event: x86: Optimize x86_pmu_disable() X-Git-Tag: v2.6.34-rc1~197^2~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c9687abeb24d5b7aae7db5be070c2139ad29e29;p=platform%2Fkernel%2Flinux-3.10.git perf_event: x86: Optimize x86_pmu_disable() 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 Cc: Stephane Eranian LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 33c889f..66de282 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -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);