mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Mahesh Bandewar' <maheshb@google.com>,
	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>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Richard Cochran" <richardcochran@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"Sagi Maimon" <maimon.sagi@gmail.com>
Cc: 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: Sun, 21 Apr 2024 18:27:01 +0000	[thread overview]
Message-ID: <163538a0495840eca34f6fbd09533ae1@AcuMS.aculab.com> (raw)
In-Reply-To: <20240418042706.1261473-1-maheshb@google.com>

From: Mahesh Bandewar
> Sent: 18 April 2024 05:27
> 
> The current implementation of PTP_SYS_OFFSET_EXTENDED provides
> PHC reads in the form of [pre-TS, PHC, post-TS]. These pre and
> post timestamps are useful to measure the width of the PHC read.
> However, the current implementation provides these timestamps in
> CLOCK_REALTIME only. Since CLOCK_REALTIME is disciplined by NTP
> or NTP-like service(s), the value is subjected to change. This
> makes some applications that are very sensitive to time change
> have these timestamps delivered in different time-base.
...

Isn't using CLOCK_REALTIME just a big bug?
As well as minor 'corrections' done by NTP it suffers from
major time-warps that can jump in either direction by arbitrary amounts.

If I understand the intent of the UAPI, a possibly solution is
to get the offset between CLOCK_REALTIME and CLOCK_MONATONIC and
ensure the same offset is added CLOCK_MONATONIC for the pre- and
post- timestamps.

This doesn't solve the problem of the NTP adjusted clock always
running slightly slow or fast.
The big NTP errors happen in the first (IIRC up to ~20 mins after boot)
when the system clock is being synchronised.
It really would be nice if those big adjustments didn't affect
CLOCK_MONATONIC.
(as an example try sending RTP audio every 20ms)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  parent reply	other threads:[~2024-04-21 18:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  4:27 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 [this message]
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

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=163538a0495840eca34f6fbd09533ae1@AcuMS.aculab.com \
    --to=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 \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®