[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADj8K+M9qjLGAKcsV_9YoPQ5SGXe3vmi69Y65m1RUyLOMrJeHg@mail.gmail.com>
Date: Fri, 10 May 2024 14:27:46 -0700
From: Yuliang Li <yuliangli@...gle.com>
To: Mahesh Bandewar (महेश बंडेवार) <maheshb@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Don Hatchett <hatch@...gle.com>,
Netdev <netdev@...r.kernel.org>, Linux <linux-kernel@...r.kernel.org>,
David Miller <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>, Arnd Bergmann <arnd@...db.de>,
Sagi Maimon <maimon.sagi@...il.com>, Jonathan Corbet <corbet@....net>, John Stultz <jstultz@...gle.com>,
Mahesh Bandewar <mahesh@...dewar.net>
Subject: Re: [PATCHv4 net-next] ptp/ioctl: support MONOTONIC_RAW timestamps
for PTP_SYS_OFFSET_EXTENDED
Thank you Mahesh. Please see my answers below.
The mono_raw allows PHC to correlate with a non-adjusted time. This
enables other types of clock sync algorithms to be developed.
For example, if we want to measure the drift rate between CPU
oscillator and PHC. We could run a linear regression over multiple
pairs of <phc, sys>. But if sys time itself is being adjusted (e.g.,
clock_realtime), the linear regression is running over a polyline
hence less effective. With mono_raw, linear regression truly measures
the drift rate of the CPU oscillator.
This capability allows more types of clock sync algorithms to be developed.
Thanks,
Yuliang
On Wed, May 8, 2024 at 7:54 PM Mahesh Bandewar (महेश बंडेवार)
<maheshb@...gle.com> wrote:
>
> On Wed, May 8, 2024 at 12:35 AM Thomas Gleixner <tglx@...utronix.de> wrote:
> >
> > On Thu, May 02 2024 at 14:10, Mahesh Bandewar wrote:
> > > The ability to read the PHC (Physical Hardware Clock) alongside
> > > multiple system clocks is currently dependent on the specific
> > > hardware architecture. This limitation restricts the use of
> > > PTP_SYS_OFFSET_PRECISE to certain hardware configurations.
> > >
> > > The generic soultion which would work across all architectures
> > > is to read the PHC along with the latency to perform PHC-read as
> > > offered by PTP_SYS_OFFSET_EXTENDED which provides pre and post
> > > timestamps. However, these timestamps are currently limited
> > > to the CLOCK_REALTIME timebase. Since CLOCK_REALTIME is affected
> > > by NTP (or similar time synchronization services), it can
> > > experience significant jumps forward or backward. This hinders
> > > the precise latency measurements that PTP_SYS_OFFSET_EXTENDED
> > > is designed to provide.
> >
> > This is really a handwavy argument.
> >
> > Fact is that the time jumps of CLOCK_REALTIME caused by NTP (etc) are
> > rare and significant enough to be easily filtered out. That's why this
> > interface allows you to retrieve more than one sample.
> >
> > Can you please explain which problem you are actually trying to solve?
> >
> > It can't be PTP system time synchronization as that obviously requires
> > CLOCK_REALTIME.
> >
> Let me add a couple of folks from the clock team. @Yuliang Li @Don Hatchett
> I'm just a nomad-kernel-net guy trying to fill-in gaps :(
>
> > Thanks,
> >
> > tglx
Powered by blists - more mailing lists