time: Fix CLOCK_MONOTONIC inconsistency during leapsecond
PATCH 1/1 time: Fix CLOCK_MONOTONIC inconsistency during leapsecond
Make sure we update wall_to_monotonic when adding a leapsecond. This could otherwise cause discontinuities in CLOCK_MONOTONIC.
This fixes a regression caused by6b43ae8a619d17c4935c3320d2ef9e92bdeed05d
CC Thomas Gleixner <[email protected]>
Reported-by Richard Cochran <[email protected]>
Tested-by Richard Cochran <[email protected]>
Signed-off-by John Stultz <[email protected]>
--- kernel/time/timekeeping.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/time/timekeeping.c +2 -0
@@ -962,6 +962,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 */
@@ -1077,6 +1078,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);
Signature · 1 line
1.7.3.2.146.gca209
[tip:timers/urgent] timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond
Commit-ID: fad0c66c4bb836d57a5f125ecd38bed653ca863a Gitweb: http://git.kernel.org/tip/fad0c66c4bb836d57a5f125ecd38bed653ca863a Author: John Stultz <[email protected]> AuthorDate: Wed, 30 May 2012 10:54:57 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Mon, 4 Jun 2012 21:46:29 +0200
timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond
Commit 6b43ae8a61 (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 <[email protected]>
Signed-off-by John Stultz <[email protected]>
Tested-by Richard Cochran <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- kernel/time/timekeeping.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/time/timekeeping.c +2 -0
@@ -962,6 +962,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 */
@@ -1077,6 +1078,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);