nohz: Prevent clocksource wrapping during idle
authorJon Hunter <jon-hunter@ti.com>
Tue, 18 Aug 2009 17:45:10 +0000 (12:45 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:01:12 +0000 (15:01 -0800)
commita9238ce3bb0fda6e760780b702c6cbd3793087d3
tree962991169ea804da0f817fd4e400e96648ca0670
parentdb47a1671a787a27a6f9ef780f1865fa4372f361
nohz: Prevent clocksource wrapping during idle

commit 98962465ed9e6ea99c38e0af63fe1dcb5a79dc25 upstream.

The dynamic tick allows the kernel to sleep for periods longer than a
single tick, but it does not limit the sleep time currently. In the
worst case the kernel could sleep longer than the wrap around time of
the time keeping clock source which would result in losing track of
time.

Prevent this by limiting it to the safe maximum sleep time of the
current time keeping clock source. The value is calculated when the
clock source is registered.

[ tglx: simplified the code a bit and massaged the commit msg ]

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Cc: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <1250617512-23567-2-git-send-email-jon-hunter@ti.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/clocksource.h
include/linux/time.h
kernel/time/clocksource.c
kernel/time/tick-sched.c
kernel/time/timekeeping.c