]> www.infradead.org Git - users/jedix/linux-maple.git/commit
3.0.x: hrtimer: Update hrtimer base offsets each hrtimer_interrupt
authorJohn Stultz <johnstul@us.ibm.com>
Mon, 2 Jul 2012 23:28:54 +0000 (19:28 -0400)
committerJoe Jin <joe.jin@oracle.com>
Fri, 6 Jul 2012 11:01:29 +0000 (19:01 +0800)
commit54b16ee687c86dfd6c94e49bdaa1535a3bf3cc9f
tree45dce7365f22ddac47a5df95c8ab7c8bd8876c84
parentaac67aba83c32bd03f4b59bdd932a076afbee089
3.0.x: hrtimer: Update hrtimer base offsets each hrtimer_interrupt

This patch introduces a new funciton which captures the
CLOCK_MONOTONIC time, along with the CLOCK_REALTIME and
CLOCK_BOOTTIME offsets at the same moment. This new function
is then used in place of ktime_get() when hrtimer_interrupt()
is expiring timers.

This ensures that any changes to realtime or boottime offsets
are noticed and stored into the per-cpu hrtimer base structures,
prior to doing any hrtimer expiration. This should ensure that
timers are not expired early if the offsets changes under us.

This is useful in the case where clock_was_set() is called from
atomic context and have to schedule the hrtimer base offset update
via a timer, as it provides extra robustness in the face of any
possible timer delay.

CC: Prarit Bhargava <prarit@redhat.com>
CC: stable@vger.kernel.org
CC: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Backported-by: Joe Jin <joe.jin@oracle.com>
include/linux/hrtimer.h
kernel/hrtimer.c
kernel/time/timekeeping.c