mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Miroslav Lichvar <mlichvar@redhat.com>,
	Rodolfo Giometti <giometti@enneenne.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
	John Stultz <jstultz@google.com>,
	 Stephen Boyd <sboyd@kernel.org>, Ryan Luu <rluu@amazon.com>,
	Julien Ridoux <ridouxj@amazon.com>,
		linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] timekeeping: Reduce magnitude of ntp_error
Date: Thu, 22 Oct 2026 17:17:58 +0100	[thread overview]
Message-ID: <dcd54b0dee114929415a9573d3bd64eeb95225bd.camel@infradead.org> (raw)
In-Reply-To: <atoVLqWfyJtCfci2@localhost>

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

On Thu, 2026-10-22 at 15:52 +0200, Miroslav Lichvar wrote:
> On Thu, Oct 22, 2026 at 11:05:18AM +0200, Rodolfo Giometti wrote:
> > On 21/10/26 16:37, David Woodhouse wrote:
> > > Ping? Patches 1-4 of this should be ready to merge now.
> > > 
> > > So is number 5 as far as I'm concerned, but I'm happy to entertain
> > > further discussion if anyone has an opinion they want to share.
> > 
> > Number 5 changes the timestamps PPS_FETCH returns to userspace, so I'd
> > still like an explicit OK from its users, such as chrony and others,
> > before it goes in.
> 
> I'm ok with it. As described, I don't think it's going to cause any
> issues, especially for low-rate PPS, but I don't like much that the
> clock is inconsistent with other sources of timestamps that the
> application is getting. That can be addressed later.

Yeah, I do wonder if at least adjtimex() should report a 'corrected'
time. But as you say, we can address that later. I'm still trying to
work out the get/set reference stuff which is what I need to do next.

> For the PTP_SYS_OFFSET_EXTENDED ioctl, is there a possibility the
> application could see an out-of-order system clock timestamp in the
> list?

Theoretically, the snapshot correction is trading monotonicity for
accuracy — it asks ktime_get_snapshot_id() to tell the *truth* by
compensating for the known ntp_error, even if the time reported is
"earlier" than a timestamp which was previously reported.

So the time reported by a tickless kernel can wander around the "ideal"
all it likes, and userspace still gets to discipline the ideal. 

In practice, it's only going to be non-monotonic w.r.t. the "fast" time
reported by clock_gettime(), not with other samples obtained through
ktime_get_snapshot_id(). 

The first patch in this series fixes the known case where ntp_error
retrospectively jumps, which would cause such a non-monotonicity in the
snapshots themselves.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6179 bytes --]

      reply	other threads:[~2026-10-22 16:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 20:21 David Woodhouse
2026-10-01 20:21 ` [PATCH 1/5] timekeeping: Allow tick_length changes to apply mid-tick David Woodhouse
2026-10-21 19:01   ` John Stultz
2026-10-22 13:39     ` David Woodhouse
2026-10-22 19:40       ` John Stultz
2026-10-01 20:21 ` [PATCH 2/5] ntp: Recalculate skew_delta when the phase offset changes David Woodhouse
2026-10-21 19:05   ` John Stultz
2026-10-01 20:21 ` [PATCH 3/5] timekeeping: Bound idle sleep while a phase slew is in flight David Woodhouse
2026-10-22 21:14   ` John Stultz
2026-10-22 21:49     ` David Woodhouse
2026-10-01 20:21 ` [PATCH 4/5] timekeeping: Reinstate proportional correction of ntp_error David Woodhouse
2026-10-05 10:04   ` Miroslav Lichvar
2026-10-05 13:17     ` David Woodhouse
2026-10-22 21:09   ` John Stultz
2026-10-01 20:21 ` [PATCH 5/5] [DO NOT MERGE] timekeeping: Apply extrapolated ntp_error to clock snapshots David Woodhouse
2026-10-02  8:30   ` Rodolfo Giometti
2026-10-02  9:14     ` David Woodhouse
2026-10-02 10:26       ` Rodolfo Giometti
2026-10-02 22:47         ` David Woodhouse
2026-10-05  8:15           ` Rodolfo Giometti
2026-10-05  8:49             ` David Woodhouse
2026-10-05 10:15               ` Rodolfo Giometti
2026-10-05 10:49                 ` David Woodhouse
2026-10-21 14:37 ` [PATCH 0/5] timekeeping: Reduce magnitude of ntp_error David Woodhouse
2026-10-22  9:05   ` Rodolfo Giometti
2026-10-22 13:52     ` Miroslav Lichvar
2026-10-22 16:17       ` David Woodhouse [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=dcd54b0dee114929415a9573d3bd64eeb95225bd.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=giometti@enneenne.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=ridouxj@amazon.com \
    --cc=rluu@amazon.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@kernel.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

all inboxes | Powered by JetHome®