From: tip-bot for Miroslav Lichvar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: prarit@redhat.com, hpa@zytor.com, stephen.boyd@linaro.org,
torvalds@linux-foundation.org, richardcochran@gmail.com,
mlichvar@redhat.com, tglx@linutronix.de, peterz@infradead.org,
john.stultz@linaro.org, linux-kernel@vger.kernel.org,
mingo@kernel.org
Subject: [tip:timers/core] timekeeping/ntp: Don't align NTP frequency adjustments to ticks
Date: Sat, 10 Mar 2018 01:12:56 -0800 [thread overview]
Message-ID: <tip-c2cda2a5bda9f1369c9d1ab54a20571c13cf2743@git.kernel.org> (raw)
In-Reply-To: <1520620971-9567-2-git-send-email-john.stultz@linaro.org>
Commit-ID: c2cda2a5bda9f1369c9d1ab54a20571c13cf2743
Gitweb: https://git.kernel.org/tip/c2cda2a5bda9f1369c9d1ab54a20571c13cf2743
Author: Miroslav Lichvar <mlichvar@redhat.com>
AuthorDate: Fri, 9 Mar 2018 10:42:47 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 10 Mar 2018 09:12:41 +0100
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>
---
kernel/time/timekeeping.c | 3 ---
1 file changed, 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,
* xtime_nsec_2 = xtime_nsec_1 - offset
* Which simplfies to:
* xtime_nsec -= offset
- *
- * XXX - TODO: Doc ntp_error calculation.
*/
if ((mult_adj > 0) && (tk->tkr_mono.mult + mult_adj < mult_adj)) {
/* NTP adjustment caused clocksource mult overflow */
@@ -1872,7 +1870,6 @@ static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk,
tk->tkr_mono.mult += mult_adj;
tk->xtime_interval += interval;
tk->tkr_mono.xtime_nsec -= offset;
- tk->ntp_error -= (interval - offset) << tk->ntp_error_shift;
}
/*
next prev parent reply other threads:[~2018-03-10 9:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 18:42 [GIT PULL][PATCH 0/4] Timekeeping queue for 4.17 John Stultz
2018-03-09 18:42 ` [PATCH 1/4] timekeeping: Don't align frequency adjustments to ticks John Stultz
2018-03-10 9:12 ` tip-bot for Miroslav Lichvar [this message]
2018-03-09 18:42 ` [PATCH 2/4] timekeeping: Determine multiplier directly from NTP tick length John Stultz
2018-03-10 9:13 ` [tip:timers/core] timekeeping/ntp: Determine the " tip-bot for Miroslav Lichvar
2018-03-09 18:42 ` [PATCH 3/4] y2038: time: Introduce struct __kernel_old_timeval John Stultz
2018-03-10 8:11 ` Ingo Molnar
2018-03-14 22:02 ` Arnd Bergmann
2018-03-14 22:04 ` [PATCH] [v2] y2038: introduce " Arnd Bergmann
2018-03-15 8:44 ` Thomas Gleixner
2018-03-15 15:46 ` Arnd Bergmann
2018-03-09 18:42 ` [PATCH 4/4] x86: rtc: Stop using rtc deprecated functions John Stultz
2018-03-15 8:52 ` [tip:x86/cleanups] x86/rtc: Stop using " tip-bot for Benjamin Gaignard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-c2cda2a5bda9f1369c9d1ab54a20571c13cf2743@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mlichvar@redhat.com \
--cc=peterz@infradead.org \
--cc=prarit@redhat.com \
--cc=richardcochran@gmail.com \
--cc=stephen.boyd@linaro.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome