[ntp:questions] ntpd -x option

Unruh unruh-spam at physics.ubc.ca
Fri Mar 13 23:42:49 UTC 2009


David Woolley <david at ex.djwhome.demon.co.uk.invalid> writes:

>Unruh wrote:
>> David Woolley <david at ex.djwhome.demon.co.uk.invalid> writes:

>>> I should also have pointed out that the 500ppm slew rate limit is 
>>> imposed by *n*x kernels, not by ntpd.  In the case of -x, which forced 
>> 
>> No it is not. the kernel limit is 1 part per 10, by altering the tick rate.
>> There are two adjustment parameters, the tickrate and the frequency. ntp
>> uses only the frequency adjustment which is limited to 500PPM, and does not
>> adjust the tick rate.

>We are talking about the user space discipline.  That was written for 
>the adjtime (no-x) system call, even if it might sometimes now use 
>adjtimex.  In user discipline mode, it does not directly control the 
>frequency at all.  In V3, it simply divides the phase correction into 4 
>second chunks and asks the kernel to slew by the appropriate amount each 
>4 second interval.  I think v4 does this every second.


This is only if the kenrel does not have the equivalent of the adjtimex
system call. If it does, ntp uses it to slew the kernel, instead of the
"once per second" adjustment. That may be the distinction you are drawing
with the "user space" adjustment. 


>The kernel then runs the clock fast or slow for enough of that period to 
>apply the period's phase correction.  With some kernels, the last tick 
>may be at 100, 200, 300, 400 or 500ppm, although some are limited to 
>just using 500ppm.  The result is that the effective frequency is a 
>three level squarish wave, typically alternating between zero and just 
>one of the polarities, most of the time.  The phase error is the 
>integral of this, so has a sawtooth pattern.

>I think the tick field is there to support another legacy system call 
>tickadj, which allowed one to modify this value and the value that 
>corresponded to the 500ppm slew rate, used during adjtime (no-x) 
>corrections.  I think that tickadj wasn't universal across *n*ces, and 
>it isn't present in Linux 2.6.  adjtime seems to be implemented in libc, 
>presumably in terms of adjtimex.

I only know a bit about Linux. The adjtimex system calls allow both teh
tick and the frequency adjustments ( and has done so since at least 2.2
kernels) Thus on Linux, you can in theory adjust from between plus or minus
100PPK. The old adjtime is implimented in terms of adjtimex. 
Now what happens on other unixes I do not know. 




More information about the questions mailing list