]> 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 09:03:04 +0000 (17:03 +0800)
commit1ecf58256194384908dc2ec31f4ca92c1bd73077
treeefa8b35a94092edc6db1e577fc5200e1d75297e5
parent4e10b2708962a44c7373aaa2152adc847e73fabc
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