Re: [chrony-users] Inaccurate jiffy calculation at boot (x86 & 2.6.37)

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


On Mon, 4 Apr 2011, Ed W wrote:

My device will be only intermittently connected to an internet source,
so I'm trying to keep my clock as accurate as I can during disconnected
periods

At present I'm seeing my RTC is staying moderately consistent (give or

The rtc is not disciplined. And its rate can change quite significantly due to
temperature changes.

take it's computed loss rate).  However, when I reboot my device (Alix
2c from PCEngines) I see the calculated jiffies value vary by up to a
hundred or so ppm each time, eg:

That was a Linux problem in the intermediate Linux 2.6 kernels. I think, but
am not sure, that this has been fixed relatively recently.


[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 498.096 MHz processor.
[    0.001010] Calibrating delay loop (skipped), value calculated using
timer frequency.. 996.19 BogoMIPS (lpj=498096)

[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 498.081 MHz processor.
[    0.002010] Calibrating delay loop (skipped), value calculated using
timer frequency.. 996.16 BogoMIPS (lpj=498081)

[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 498.122 MHz processor.
[    0.003010] Calibrating delay loop (skipped), value calculated using
timer frequency.. 996.24 BogoMIPS (lpj=498122)

[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 498.065 MHz processor.
[    0.003010] Calibrating delay loop (skipped), value calculated using
timer frequency.. 996.13 BogoMIPS (lpj=498065)


As near as I can tell this causes Chrony to re-read it's stored tracking
values which are then quite inaccurate and cause the clock to drift

No. IF chrony has a reasonable source of time, it will converge rapidly to the
new drift rate. If it does not, it will drift due to the large change in the
drift rate of the clock. Chrony cannot fix a broken clock if it has no outside
source of time.

Have you tried a more recent kernel?


quite rapidly?  Each time I reboot chrony needs a network connection to
figure out the actual clock freq?

Any suggestions on how to get my clock more accurate (kernel 2.6.37 /
chrony git)?

OK, that is pretty recent. The problem is that the linux kernel people broke
the initial rate calibration of the clocks.


- Can I patch init/calibrate.c to get it to figure out a better lpj
estimate?
- Can I have chrony use my RTC as a source? My RTC is much more accurate
at boot than the cpu clock? This seems to be possible with ntpd?

Chrony DOES use the rtc to initially set the clock. It also uses the drift
rate of the rtc to try to correct that. It is not clear how useful that is,
since the drift calculationof the rtc is done when the rtc is hot, and the
actually drifting is done when the rtc is cold (computer switched off)


- Could chrony save some knowledge of the last lpj figure and use that
to update it's knowledge of my frequency offset (ie assume that the lpj
is in fact a constant, but avoid hard coding this onto the kernel boot
line?)



...Part of my problem is that the Alix board has an odd high speed clock
running at some multiple of 1024Hz. I think it should be possible to set
my kernel to HZ=1024 instead of HZ-1000, but I can't quite see how to
patch that yet? (Hints appreciated?)

Do you have any otehr possible time sources then TSC?


Thanks for any pointers on this?

Ed W

---
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


--
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

---
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject. For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/