hrtimer: Eliminate needless reprogramming of clock events device
authorAshwin Chaugule <ashwinc@quicinc.com>
Wed, 2 Sep 2009 03:03:33 +0000 (23:03 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Sep 2009 15:09:44 +0000 (17:09 +0200)
commit7403f41f19574d6805197e9b97dfa7592003be10
tree8d849ac38a64a60fbe06f9f2c8c6b26697fad74f
parent12e09337fe238981cb0c87543306e23775d1a143
hrtimer: Eliminate needless reprogramming of clock events device

On NOHZ systems the following timers,

-  tick_nohz_restart_sched_tick (tick_sched_timer)
-  hrtimer_start (tick_sched_timer)

are reprogramming the clock events device far more often than needed.
No specific test case was required to observe this effect. This
occurres because there was no check to see if the currently removed or
restarted hrtimer was:

1) the one which previously armed the clock events device.
2) going to be replaced by another timer which has the same expiry time.

Avoid the reprogramming in hrtimer_force_reprogram when the new expiry
value which is evaluated from the clock bases is equal to
cpu_base->expires_next. This results in faster application startup
time by ~4%.

[ tglx: simplified initial solution ]

Signed-off-by: Ashwin Chaugule <ashwinc@quicinc.com>
LKML-Reference: <4AA00165.90609@codeaurora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/hrtimer.c