Netdev List
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Rodolfo Giometti <giometti@enneenne.com>,
	Richard Cochran	 <richardcochran@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	John Stultz <jstultz@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	 Stephen Boyd <sboyd@kernel.org>,
	Miroslav Lichvar <mlichvar@redhat.com>,
	linux-kernel@vger.kernel.org, 	netdev@vger.kernel.org,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH v4 2/4] pps: Drop the !NO_HZ_COMMON dependency from NTP_PPS
Date: Wed, 30 Sep 2026 15:05:23 +0100	[thread overview]
Message-ID: <6a529b5fe8c5bbb664748b85be011f5cf2e6c44d.camel@infradead.org> (raw)
In-Reply-To: <fc473eab-c72e-4641-b617-8f22389c8f68@enneenne.com>

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

On Wed, 2026-09-30 at 14:57 +0200, Rodolfo Giometti wrote:
> Hi David,
> 
> On 30/09/2026 12:37, David Woodhouse wrote:
> > Three parts of the 2x2 grid are now at
> >  • https://david.woodhou.se/ntptest-r64/tickful-1hz/
> >  • https://david.woodhou.se/ntptest-r64/tickless-1hz/
> >  • https://david.woodhou.se/ntptest-r64/tickless-5s/
> > 
> > The fourth is running now, about 90 minutes in. After which I might
> > play with that IRQF_HWTIMESTAMP thing, because they're *all* seeing a
> > bunch of late pulses (and the tickless ones are doing all the
> > timekeeping catchup before they even capture the pulse timestamp, some
> > of which gets hidden as common mode latency):
> > 
> >   ┌────────────────┬────────┬─────────┬─────────┬────────┐
> >   │      cell      │  p50   │   p95   │   p99   │ >3 µs  │
> >   ├────────────────┼────────┼─────────┼─────────┼────────┤
> >   │ tickless, 5 s  │ 728 ns │ 4188 ns │ 4847 ns │ 14.5 % │
> >   ├────────────────┼────────┼─────────┼─────────┼────────┤
> >   │ tickless, 1 Hz │ 294 ns │ 2258 ns │ 4837 ns │ 3.6 %  │
> >   ├────────────────┼────────┼─────────┼─────────┼────────┤
> >   │ tickful, 1 Hz  │ 84 ns  │ 1206 ns │ 4012 ns │ 2.0 %  │
> >   └────────────────┴────────┴─────────┴─────────┴────────┘
> > 
> > But ultimately, the hardpps discipline appears to be working fine with
> > full nohz idle, even when we dial down the pulse *itself* to 0.2Hz to
> > actually let the box sleep for 5s at a time.
> 
> Thanks for running the whole grid.
> 
> Could you put these numbers, with the fourth cell once it is done, in
> the commit message of 2/4? They show both that hardpps works on a
> tickless kernel and what it costs in timestamp latency, which is what
> someone enabling NTP_PPS there will want to know.

Ack. I've still got a few more passes to do for cosmetics, and working
out precisely how to order things (including putting 'use
ktime_get_snapshot_id() for pps_get_ts()' before 'Apply extrapolated
ntp_error', qv).

I think it ends up as a timekeeping series which can be posted
immediately, and the rest is held back for a future posting when it can
identify specific commit IDs for the dependencies.

I also realised that all four runs were capturing the actual IRQ
handler latency — from entry.S to pps_gpio_irq_hardirq(). With the
standard 1Hz PPS it's 2-3µs in the tickful kernels, 4-5µs in tickless.
I've added the distribution chart and CDF to all four result pages.

So: With the ntp_error fixes in the earlier part of the series which
could be posted as bugfixes today, ntp_error itself is completely in
the *noise* for PPS by some orders of magnitude, compared with the
latency of the IRQ handling path itself. Which means I think we can
actually enable PPS for tickless kernels without depending on the
'Apply extrapolated ntp_error' patch at all.

Just for fun, I've also implemented the code to use the entry.S
timestamp in pps_gpio_irq_hardirq() (when it eventually gets to run, 4-
6µs later). It's been running for an hour now on the the previous worst
case (5s, tickless). The per-minute average phase offset is around 10-
20ns, max mostly around 100-200ns. So the jitter is basically gone. But
I don't think we're ever going to be allowed to do it that way in
entry.S but the *hardware-captured* stamps will want the same handling,
so I wanted to prototype it anyway.

> At this point it could be fine for me, but before acking I'd like to
> hear from the userland side, Miroslav for chrony and the ntpd folks,
> since the change in ts_real is theirs to judge.

Yep. I think that one wants to go under separate cover and be properly
considered, after the prior timekeeping *fixes*.

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

  reply	other threads:[~2026-09-30 14:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 20:56 [PATCH v4 0/4] Add ntp_error to clock snapshot, enable NTP_PPS on tickless kernel David Woodhouse
2026-08-29 20:56 ` [PATCH v4 1/4] timekeeping: Apply extrapolated ntp_error to clock snapshots David Woodhouse
2026-08-29 20:57 ` [PATCH v4 2/4] pps: Drop the !NO_HZ_COMMON dependency from NTP_PPS David Woodhouse
2026-09-01 15:35   ` Rodolfo Giometti
2026-09-02  0:13     ` David Woodhouse
2026-09-28 13:37     ` David Woodhouse
2026-09-28 16:41       ` Rodolfo Giometti
2026-09-28 19:28         ` David Woodhouse
2026-09-29  6:33           ` Rodolfo Giometti
2026-09-29  9:32             ` David Woodhouse
2026-09-29 11:48               ` Rodolfo Giometti
2026-09-29 12:02                 ` David Woodhouse
2026-09-30  1:28                 ` David Woodhouse
2026-09-30 12:57                   ` Rodolfo Giometti
2026-09-30 10:37                 ` David Woodhouse
2026-09-30 12:57                   ` Rodolfo Giometti
2026-09-30 14:05                     ` David Woodhouse [this message]
2026-09-30 18:24                       ` David Woodhouse
2026-10-01  8:20                         ` Rodolfo Giometti
2026-10-01  9:08                           ` David Woodhouse
2026-08-29 20:57 ` [PATCH v4 3/4] pps: Always use ktime_get_snapshot_id() for pps_get_ts() David Woodhouse
2026-09-01 15:35   ` Rodolfo Giometti
2026-09-01 23:56     ` David Woodhouse
2026-09-26 20:38     ` David Woodhouse
2026-09-28  7:58       ` Rodolfo Giometti
2026-09-28 12:59         ` David Woodhouse
2026-09-28 16:41           ` Rodolfo Giometti
2026-10-01 13:14         ` Miroslav Lichvar
2026-10-01 15:38           ` David Woodhouse
2026-10-02  7:04           ` Rodolfo Giometti
2026-10-02  9:07             ` David Woodhouse
2026-10-02 12:29               ` David Woodhouse
2026-10-02 13:44                 ` David Woodhouse
2026-10-03 11:29                   ` David Woodhouse
2026-10-05  9:16                   ` Miroslav Lichvar
2026-08-29 20:57 ` [PATCH v4 4/4] [DO NOT MERGE] ptp: ptp_vmclock: Add simulated 1PPS support David Woodhouse
2026-09-01 15:35 ` [PATCH v4 0/4] Add ntp_error to clock snapshot, enable NTP_PPS on tickless kernel Rodolfo Giometti
2026-09-01 23:37   ` David Woodhouse

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=6a529b5fe8c5bbb664748b85be011f5cf2e6c44d.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=agordeev@linux.ibm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=giometti@enneenne.com \
    --cc=jstultz@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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