From: Thomas Gleixner <tglx@linutronix.de>
To: "David Laight" <David.Laight@ACULAB.COM>,
"Mahesh Bandewar (महेश बंडेवार)" <maheshb@google.com>
Cc: Netdev <netdev@vger.kernel.org>,
Linux <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Sagi Maimon <maimon.sagi@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
John Stultz <jstultz@google.com>,
Mahesh Bandewar <mahesh@bandewar.net>
Subject: RE: [PATCHv2 next] ptp: update gettimex64 to provide ts optionally in mono-raw base.
Date: Tue, 23 Apr 2024 15:22:00 +0200 [thread overview]
Message-ID: <875xw8uscn.ffs@tglx> (raw)
In-Reply-To: <f2ac461445f44addb521ef79ecedc584@AcuMS.aculab.com>
On Tue, Apr 23 2024 at 09:22, David Laight wrote:
> From: Thomas Gleixner
>> The quantity of the initial frequency adjustments depends on the
>> accuracy of the initial clock frequency calibration which is on most
>> sane systems within +/- 500ppm.
>>
>> 500ppm of 20ms == 10us
>>
>> If the clock calibration is off by a larger margin then that needs to be
>> fixed.
>
> The initial adjustment depends on the accuracy of the initial RTC
> value read from the local hardware.
The initial value of CLOCK_REALTIME depends on the RTC value, but not
the initial frequency and the frequency is the only thing which matters
for CLOCK_MONOTONIC.
> This is unlikely to be more accurate than 1 second and can easily
> be a few seconds out.
Halfways sane RTCs drift in the range of +/- 5 seconds per day. But
that's not a problem if your NTP daemon is configured correctly because
it will step CLOCK_REALTIME right away when it's off more than 1 second.
Also correctly configured NTP daemons keep track of the drift and reuse
the last observed drift value which makes them stabilize quickly if the
initial frequency value which has been calibrated / determined by the
kernel is halfways accurate. It takes 5 seconds on my laptop from
starting chrony until it's stable.
Sure you can configure NTP in weird ways, but that's not a kernel
problem.
Thanks,
tglx
prev parent reply other threads:[~2024-04-23 13:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 4:27 [PATCHv2 next] ptp: update gettimex64 to provide ts optionally in mono-raw base Mahesh Bandewar
2024-04-19 1:55 ` Jakub Kicinski
2024-04-19 22:14 ` Mahesh Bandewar (महेश बंडेवार)
2024-04-19 4:56 ` Thomas Gleixner
2024-04-19 22:32 ` Mahesh Bandewar (महेश बंडेवार)
2024-04-21 18:27 ` David Laight
2024-04-22 22:04 ` Mahesh Bandewar (महेश बंडेवार)
2024-04-23 0:24 ` Thomas Gleixner
2024-04-23 9:22 ` David Laight
2024-04-23 13:22 ` Thomas Gleixner [this message]
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=875xw8uscn.ffs@tglx \
--to=tglx@linutronix.de \
--cc=David.Laight@ACULAB.COM \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jstultz@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mahesh@bandewar.net \
--cc=maheshb@google.com \
--cc=maimon.sagi@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).