Re: ntp discipline of local time?



Unruh wrote:
David Woolley <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:


If you are using the kernel time discipline, which you should be using for high accuracy, nptd doesn't discipline the clock; it is the kernel code that does that, based on measurements provided by ntpd.

I do not think that this is right, unless you are referring to a PPS
sounce. ntp sets the frequency of the kerhel clock (Is that change in
frequency what you mean by kernel time discipline) by a very simple second
order PDE feedback, and the offset by and exponential first order feedback
scheme. At least that is what it looks like to me trying to read
ntp_loopfilter.c


2.4 kernel (2.4.33): /usr/src/linux/kernel/timer.c

417 /*
418 * Compute the phase adjustment for the next second. In
419 * PLL mode, the offset is reduced by a fixed factor
420 * times the time constant. In FLL mode the offset is
421 * used directly. In either mode, the maximum phase
422 * adjustment for each second is clamped so as to spread
423 * the adjustment over not more than the number of
424 * seconds between updates.
425 */

loopfilter.c feeds the kernel with offset when it has a time update and it is in PLL mode. Note that a simple exponential decay is an IIR filter:

From ntp v4.2p4: ntpd/ntp_loopfilter.c

172 #define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \
173 MOD_STATUS | MOD_TIMECONST)

gives the default set of ntpadjtime mode options.
.



Relevant Pages

  • Time Drift Compensation on Linux Clusters
    ... While working on a Linux cluster with kernel version 2.4.27 we've ... for this problem which is based on the Pentium's TSC clock. ... Following is a detailed description of the problem and the fix, ... The number of interrupt per second is defined by ...
    (Linux-Kernel)
  • Re: ntp discipline of local time?
    ... The kernel discipline is almost identical to the daemon discipline with the exception that the fancy code to combine the PLL and FLL near the Allan intercept is absent. ... like the clock state machine and poll-adjust algorithm continue in the daemon. ... The phase error is probably being filtered using an IIR filter, and that is what you are seeing, and also the mechanism ntpd uses to stop wandering off if it stops receiving updates (the frequency measurement error can produce unbounded phase errors, but the phase error correction is bounded). ...
    (comp.protocols.time.ntp)
  • CLOCK_TICK_RATE for slowing down the system clock?
    ... the Linux kernel. ... The idea is to slow down 10 times the clock maintained by the Linux ... running 10 times slower. ...
    (Linux-Kernel)
  • Re: ntp and hwclock
    ... I have set up clock in my Ericsson mobile phone more than 3 years ... Maybe the new RTC class lets one change ... |kernel will write the time back to the CMOS clock every 11 minutes. ...
    (Debian-User)
  • Re: OEM Adaption Layer and OAL stubs
    ... > function build into the kernel at image creation time). ... >> Currently im using the latest VIA cepc twister bsp for my target. ... >> Among other things I want to be able to call the realtime clock to get ... >> Can anyone help me clearify or send a link that can explain the structure ...
    (microsoft.public.windowsce.embedded)