Re: [RFC PATCH v2 3/8] timekeeping: Clamp time_offset delta to prevent infinite tail

From: Miroslav Lichvar

Date: Tue May 19 2026 - 09:29:03 EST


On Sun, May 17, 2026 at 10:25:40PM +0100, David Woodhouse wrote:
> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> ntp_offset_chunk() computes delta as time_offset >> (SHIFT_PLL +
> time_constant), which exponentially decays toward zero but never
> reaches it. This means time_offset asymptotically approaches zero
> without ever completing — the clock never fully converges.

That's how the NTP PLL was designed to work. It is an infinite impulse
response filter.

> Fix by clamping delta:
> - Minimum: 20ns/sec (NTP_OFFSET_DELTA_MIN), ensuring the tail
> converges in finite time

I don't think that is an acceptable change of the filter. The impact
could be measured on a sufficiently stable clock.

To me that looks like using a wrong tool for the job.

--
Miroslav Lichvar