diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-04-14 21:08:37 +0000 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-04-22 17:06:49 +0200 |
commit | 868a3e915f7f5eba8f8cb4f7da2276760807c51c (patch) | |
tree | dcec10d02c9613b5cad4f32d6d3ed7352825b1c8 /kernel/time/hrtimer.c | |
parent | 21d6d52a1b7028e6a6840bd82e354aefa9a5e203 (diff) | |
download | linux-stable-868a3e915f7f5eba8f8cb4f7da2276760807c51c.tar.gz linux-stable-868a3e915f7f5eba8f8cb4f7da2276760807c51c.tar.bz2 linux-stable-868a3e915f7f5eba8f8cb4f7da2276760807c51c.zip |
hrtimer: Make offset update smarter
On every tick/hrtimer interrupt we update the offset variables of the
clock bases. That's silly because these offsets change very seldom.
Add a sequence counter to the time keeping code which keeps track of
the offset updates (clock_was_set()). Have a sequence cache in the
hrtimer cpu bases to evaluate whether the offsets must be updated or
not. This allows us later to avoid pointless cacheline pollution.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/20150414203501.132820245@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r-- | kernel/time/hrtimer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 9e111dd83ca3..8ce9b3138017 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -451,7 +451,8 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; - return ktime_get_update_offsets_now(offs_real, offs_boot, offs_tai); + return ktime_get_update_offsets_now(&base->clock_was_set_seq, + offs_real, offs_boot, offs_tai); } /* High resolution timer related functions */ |