[ntp:hackers] Time constant too large?

David L. Mills mills at udel.edu
Fri Jan 4 14:01:39 UTC 2008


Hal,

That's exactly my point. The nanokernel code that left here in 1998 had 
no provision to change the Hz other than defined, since at that time no 
OS had provisions to change it. In the Tru64 and FreeBSD kernel, the 
constant is SHIFT_PLL in kern_ntptime.c or kern_ntpclock.c, depending on 
system. The value 4 is appropriate for 100 Hz and should be decreased by 
one for every approximate doubling in frequency. Actually, the 
calcualtion is crude and uses shifts to keep the multiply/divide unit 
cool, especially in the Alpha, which does not have a divide instruction. 
It probably should be a full multiply.

Dave

Hal Murray wrote:

> [Sorry about the blank msg]
>
>> Linux should behave exactly like your reference implementation.
>
>
> I've poked around in the Linux and the FreeBSD kernels. I was 
> expecting to see some constant or line of code that references HZ in 
> the timekeeping code, but I haven't found it. Probably I'm just not 
> looking in the right place.
>
> Where is the code in Linux, FreeBSD, and/or the reference 
> implementation that does the scaling by HZ? (Where is the reference 
> implementation for the kernel code?)
>
>
>
> Is there an easy way to tell if my system is working correctly? Some 
> simple test case?
>
> What should happen if I introduce a small step in the offset? I'd 
> expect the system to recover with an exponential decay. If so, what's 
> the time constant? What happens when this bug is present and HZ is not 
> 100? 250 and 1000 are common choices.
>
> What should happen if I introduce a small step in the drift? ...
>
> I'm quite interested in the drift-step case. There is a bug/glitch in 
> the Linux 2.6 kernels that generates them. Several Linux/Intel systems 
> that I work with use the TSC counter for timekeeping. The calibration 
> routine doesn't get a consistent answer. It varies over a range of 
> roughly 50 ppm. That's not enough to be horrible but it is big enough 
> to give ntpd some exercise when you reboot.
>
>



More information about the hackers mailing list