aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2018-03-09 13:42:47 -0500
committerIngo Molnar <mingo@kernel.org>2018-03-10 03:12:41 -0500
commitc2cda2a5bda9f1369c9d1ab54a20571c13cf2743 (patch)
treec15708e16f272c90ec5a2632b4c9c47b11fcdf8f
parent27263e8dc0f6fe27540a843611ec14a000591c41 (diff)
timekeeping/ntp: Don't align NTP frequency adjustments to ticks
When the timekeeping multiplier is changed, the NTP error is updated to correct the clock for the delay between the tick and the update of the clock. This error is corrected in later updates and the clock appears as if the frequency was changed exactly on the tick. Remove this correction to keep the point where the frequency is effectively changed at the time of the update. This removes a major source of the NTP error. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Stephen Boyd <stephen.boyd@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1520620971-9567-2-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/time/timekeeping.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index cd03317e7b57..c1a0ac17336e 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1860,8 +1860,6 @@ static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk,
1860 * xtime_nsec_2 = xtime_nsec_1 - offset 1860 * xtime_nsec_2 = xtime_nsec_1 - offset
1861 * Which simplfies to: 1861 * Which simplfies to:
1862 * xtime_nsec -= offset 1862 * xtime_nsec -= offset
1863 *
1864 * XXX - TODO: Doc ntp_error calculation.
1865 */ 1863 */
1866 if ((mult_adj > 0) && (tk->tkr_mono.mult + mult_adj < mult_adj)) { 1864 if ((mult_adj > 0) && (tk->tkr_mono.mult + mult_adj < mult_adj)) {
1867 /* NTP adjustment caused clocksource mult overflow */ 1865 /* NTP adjustment caused clocksource mult overflow */
@@ -1872,7 +1870,6 @@ static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk,
1872 tk->tkr_mono.mult += mult_adj; 1870 tk->tkr_mono.mult += mult_adj;
1873 tk->xtime_interval += interval; 1871 tk->xtime_interval += interval;
1874 tk->tkr_mono.xtime_nsec -= offset; 1872 tk->tkr_mono.xtime_nsec -= offset;
1875 tk->ntp_error -= (interval - offset) << tk->ntp_error_shift;
1876} 1873}
1877 1874
1878/* 1875/*