summaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-04-14 21:08:37 +0000
committerThomas Gleixner <tglx@linutronix.de>2015-04-22 17:06:49 +0200
commit868a3e915f7f5eba8f8cb4f7da2276760807c51c (patch)
treedcec10d02c9613b5cad4f32d6d3ed7352825b1c8 /include/linux/hrtimer.h
parent21d6d52a1b7028e6a6840bd82e354aefa9a5e203 (diff)
downloadblackbird-obmc-linux-868a3e915f7f5eba8f8cb4f7da2276760807c51c.tar.gz
blackbird-obmc-linux-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 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index e292830b58f0..5e04f8fc26f6 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -163,7 +163,7 @@ enum hrtimer_base_type {
* and timers
* @cpu: cpu number
* @active_bases: Bitfield to mark bases with active timers
- * @clock_was_set: Indicates that clock was set from irq context.
+ * @clock_was_set_seq: Sequence counter of clock was set events
* @expires_next: absolute time of the next event which was scheduled
* via clock_set_next_event()
* @in_hrtirq: hrtimer_interrupt() is currently executing
@@ -179,7 +179,7 @@ struct hrtimer_cpu_base {
raw_spinlock_t lock;
unsigned int cpu;
unsigned int active_bases;
- unsigned int clock_was_set;
+ unsigned int clock_was_set_seq;
#ifdef CONFIG_HIGH_RES_TIMERS
ktime_t expires_next;
int in_hrtirq;
OpenPOWER on IntegriCloud