Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b986d7ec authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

perf_counter: Optimize disable of time based sw counters



Currently we call hrtimer_cancel() unconditionally on disable of time based
software counters. Avoid when possible.

[ Impact: micro-optimize the code ]

Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <20090520102553.388185031@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 26b119bc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2716,6 +2716,7 @@ static int cpu_clock_perf_counter_enable(struct perf_counter *counter)

static void cpu_clock_perf_counter_disable(struct perf_counter *counter)
{
	if (counter->hw.irq_period)
		hrtimer_cancel(&counter->hw.hrtimer);
	cpu_clock_perf_counter_update(counter);
}
@@ -2767,6 +2768,7 @@ static int task_clock_perf_counter_enable(struct perf_counter *counter)

static void task_clock_perf_counter_disable(struct perf_counter *counter)
{
	if (counter->hw.irq_period)
		hrtimer_cancel(&counter->hw.hrtimer);
	task_clock_perf_counter_update(counter, counter->ctx->time);