[ntp:questions] NTPD can take 10 hours to achieve stability

unruh unruh at wormhole.physics.ubc.ca
Tue Apr 19 00:33:52 UTC 2011


On 2011-04-18, Mike S <mikes at flatsurface.com> wrote:
> At 03:51 PM 4/18/2011, Harlan Stenn wrote...
>>David wrote:
>> > Well, if Linux is that badly behaved (altering its clock on each
>> > boot), I would have said that was an OS defect which needed
>> > correction, not altering ntpd to accommodate faulty software!
>>
>>I think, and I am really not sure, that the linux kernel calibrates 
>>its
>>clock on each boot, and that calibration can be different in the
>>low-order bit (or few) each time.
>
> Yes, and that's what makes it broken. While it certainly doesn't effect 
> most users, it does some. At a minimum, there should be a mechanism to 
> find out what (clock divisors?) the kernel has used for calibration, 
> and lock them in for use with subsequent boots. Maybe there is, but 
> after searching for a while, I couldn't find any way to do that. 

This is all going on more of less before the file system has come up. It
is very early in the bootup. The problem is that Linux does not want to
spend a long time (<< 1sec)calibrating its clock speed, and suffers from exactly
the problem you described in your other posts. 
The other problem is, what do you use as the time base to calibrate the
speed of your CPU counter? If the computer has an HPET, you could use
that, but not all do. If it has a soundcard, you could try that, but it
takes a while. 

What is a bit weird is that things have gotten so much worse. It used to
be (2.6.10) that the calibration of the tsc was pretty consistant. It is not
anymore. 




More information about the questions mailing list