[ntp:questions] stepping and slewing

David L. Mills mills at udel.edu
Mon May 14 03:31:23 UTC 2007


Serge,

No; it's not the right thing to do.

Why complicate the beast? If the program does not compute the frequency 
file, then it shouldn't use it. The only case where it even works is if 
the kernel desipline is available, since that is the only way to 
discipline frequency between updates.

It is conceivable to run ntpd without -gq for a time in order to train 
the frequency offset, then kill the daemon leaving the kernel variables 
behind, and henceforth use only ntpd -gq.

To support reading the frequency file, the ntpd -gq would have to figure 
out whether the kernel is available, read the frequency file and then do 
a ntp_adjtime() to initialize the frequency. But, we just did that 
during the training period.

Dave

 > David L. Mills wrote:
 >
 >> Serge,
 >>
 >> The current ntpd -gq code does not set the kernel frequency from the
 >> frequency file, but it can be set using ntptime -f.
 >>
 >> Dave
 >>
 >
 > Dae,
 >
 > Maybe the code should be changed to do that? Or doesn't it have enough
 > information to do that when setting the initial time or is it that
 > slewing prevents you doing that?
 >
 > Danny


Serge Bets wrote:
> Hello David,
> 
>  On Sunday, May 13, 2007 at 1:49:00 +0000, David L. Mills wrote:
> 
> 
>>The current ntpd -gq code does not set the kernel frequency from the
>>frequency file, but it can be set using ntptime -f.
> 
> 
> It would be the right thing for ntpd -gq to set the frequency by itself.
> And of course it's well designed, so it does it. :-)
> 
> | # ntptime -f 0 > /dev/null
> | # ntpd -gq
> | ntpd: time slew +0.047229s
> | # ntptime | grep ", frequency"
> |   offset 0.000 us, frequency -2.218 ppm, interval 4 s,
> 
> Corresponding syslog:
> 
> | May 13 18:22:01 Ummon ntpd[126]: ntpd 4.2.5p20-o Mon Apr  2 17:32:22 UTC 2007 (3)
> | May 13 18:22:01 Ummon ntpd[126]: precision = 7.000 usec
> | May 13 18:22:01 Ummon ntpd[126]: ntp_io: estimated max descriptors: 256, initial socket boundary: 48
> | May 13 18:22:01 Ummon ntpd[126]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
> | May 13 18:22:01 Ummon ntpd[126]: Listening on interface #1 lo, 127.0.0.1#123 Enabled
> | May 13 18:22:01 Ummon ntpd[126]: Listening on interface #2 eth0, 192.168.7.7#123 Enabled
> | May 13 18:22:01 Ummon ntpd[126]: kernel time sync status 0040
> | May 13 18:22:01 Ummon ntpd[126]: frequency initialized -2.218 PPM from /var/lib/ntp/ntp.drift
> | May 13 18:22:08 Ummon ntpd[126]: synchronized to 192.168.7.3, stratum 1
> | May 13 18:22:08 Ummon ntpd[126]: time slew +0.047229 s
> 
> 
> Serge.




More information about the questions mailing list