mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond
commitfad0c66c4bupstream. Commit6b43ae8a61(ntp: Fix leap-second hrtimer livelock) broke the leapsecond update of CLOCK_MONOTONIC. The missing leapsecond update to wall_to_monotonic causes discontinuities in CLOCK_MONOTONIC. Adjust wall_to_monotonic when NTP inserted a leapsecond. Reported-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Tested-by: Richard Cochran <richardcochran@gmail.com> Link: http://lkml.kernel.org/r/1338400497-12420-1-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3410afedcd
commit
d913c02b0a
|
|
@ -964,6 +964,7 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift)
|
|||
timekeeper.xtime.tv_sec++;
|
||||
leap = second_overflow(timekeeper.xtime.tv_sec);
|
||||
timekeeper.xtime.tv_sec += leap;
|
||||
timekeeper.wall_to_monotonic.tv_sec -= leap;
|
||||
}
|
||||
|
||||
/* Accumulate raw time */
|
||||
|
|
@ -1079,6 +1080,7 @@ static void update_wall_time(void)
|
|||
timekeeper.xtime.tv_sec++;
|
||||
leap = second_overflow(timekeeper.xtime.tv_sec);
|
||||
timekeeper.xtime.tv_sec += leap;
|
||||
timekeeper.wall_to_monotonic.tv_sec -= leap;
|
||||
}
|
||||
|
||||
timekeeping_update(false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user