* [PATCH] time: Fix CLOCK_MONOTONIC inconsistency during leapsecond
@ 2012-05-30 17:54 John Stultz
2012-06-04 19:52 ` [tip:timers/urgent] timekeeping: " tip-bot for John Stultz
0 siblings, 1 reply; 2+ messages in thread
From: John Stultz @ 2012-05-30 17:54 UTC (permalink / raw)
To: linux-kernel; +Cc: John Stultz, stable, Thomas Gleixner
Make sure we update wall_to_monotonic when adding a leapsecond.
This could otherwise cause discontinuities in CLOCK_MONOTONIC.
This fixes a regression caused by
6b43ae8a619d17c4935c3320d2ef9e92bdeed05d
CC: stable@kernel.org
CC: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Richard Cochran <richardcochran@gmail.com>
Tested-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
kernel/time/timekeeping.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6e46cac..6f46a00 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -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);
--
1.7.3.2.146.gca209
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:timers/urgent] timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond
2012-05-30 17:54 [PATCH] time: Fix CLOCK_MONOTONIC inconsistency during leapsecond John Stultz
@ 2012-06-04 19:52 ` tip-bot for John Stultz
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for John Stultz @ 2012-06-04 19:52 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, john.stultz, hpa, mingo, richardcochran, tglx
Commit-ID: fad0c66c4bb836d57a5f125ecd38bed653ca863a
Gitweb: http://git.kernel.org/tip/fad0c66c4bb836d57a5f125ecd38bed653ca863a
Author: John Stultz <john.stultz@linaro.org>
AuthorDate: Wed, 30 May 2012 10:54:57 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
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 <richardcochran@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Tested-by: Richard Cochran <richardcochran@gmail.com>
Cc: stable@kernel.org
Link: http://lkml.kernel.org/r/1338400497-12420-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/timekeeping.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6e46cac..6f46a00 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-04 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 17:54 [PATCH] time: Fix CLOCK_MONOTONIC inconsistency during leapsecond John Stultz
2012-06-04 19:52 ` [tip:timers/urgent] timekeeping: " tip-bot for John Stultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).