tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PSA: Clock drift and pkgin



On 2023-12-23 17:39, Taylor R Campbell wrote:
Date: Fri, 22 Dec 2023 23:41:47 -0500 (EST)
From: Mouse <mouse%Rodents-Montreal.ORG@localhost>

Specifically, under a kernel built with HZ=100, requesting signals at
100Hz actually delivers them at 50Hz.  This is behind the clock running
at half speed on my VAX emulator, and quite likely behind similar
behaviour from simh (which emulates VAXen, among other things) on 9.3.
I suspect it will happen on any port when requesting signals one timer
tick apart (ie, at HZ Hz).

This is the well-known problem that we don't have timers with sub-tick
resolution, PR kern/43997: https://gnats.netbsd.org/43997

You are somewhat missing the point. What Mouse is asking for is not at all about sub-tick resolution. What he asks for is exactly tick resolution. And the important second half of this point is that with an interval timer, it automatically is reset every time it has fired, which means it happens exactly at the tick, and then you want a new trigger at the next tick. And currently, that is not possible. Because the reset of the interval timer rounds one tick up to two ticks (it basically always add one tick, no matter what interval you ask for, which implies that if you ask for 1s, it will actually be after 101 ticks (if we have a 10ms tick)). So nothing is sub-tick about this.

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index