nohz: Prevent clocksource wrapping during idle
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>
This commit is contained in:
committed by
Thomas Gleixner
parent
529eaccd90
commit
98962465ed
@@ -151,6 +151,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
|
||||
* subtraction of non 64 bit counters
|
||||
* @mult: cycle to nanosecond multiplier
|
||||
* @shift: cycle to nanosecond divisor (power of two)
|
||||
* @max_idle_ns: max idle time permitted by the clocksource (nsecs)
|
||||
* @flags: flags describing special properties
|
||||
* @vread: vsyscall based read
|
||||
* @resume: resume function for the clocksource, if necessary
|
||||
@@ -168,6 +169,7 @@ struct clocksource {
|
||||
cycle_t mask;
|
||||
u32 mult;
|
||||
u32 shift;
|
||||
u64 max_idle_ns;
|
||||
unsigned long flags;
|
||||
cycle_t (*vread)(void);
|
||||
void (*resume)(void);
|
||||
|
Reference in New Issue
Block a user