Re: [chrony-dev] frequency fallback when running unsynchronised

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


On Fri, 9 Apr 2010, Miroslav Lichvar wrote:

I was thinking it would be nice to have a frequency fallback mechanism
when running unsynchronised for long time to avoid quickly drifting
away if there was a short-term deviation in drift just before the
synchronisation was lost. Something better than using longer polling
intervals.

The attached patch implements a series of exponential moving averages
of absolute clock frequencies that are calculated over exponentially
increasing intervals. When chronyd is unsynchronised for some
specified interval, it will start switching the clock frequency to the
long-term averages.

Interesting idea. The place that really really needs this most is the rtc.
at present, the system saves the instantaneous rtc rate offset to use to
correct the rtc next time it is turned on. But that rate is an "instantaneous
rate", while typically the computer is left off for a long period. (of course
the bigger problem is that when the computer is off, the rtc is cold, and the
cold rate is probably significantly different from the hot, but I have no idea
how to get around that problem!)



It can be configured with a new directive:

fallbackdrift 10 16

This configures chronyd to maitain 7 averages for intervals from 2^10
to 2^16 seconds.

The default values are quite conservative, the intervals are set to 16
(18 hours) and 19 (6 days). When chronyd is running unsynchronised for
18 hours it will set the clock frequency to the first average computed
over about 15-40 hours before the synchronisation was lost and to the
last after 6 days. I'm hoping this will cover the usual daily and
weekly temperature cycles.

What do you think? Is it useful?

I'd appreciate if it could receive more testing before I push it.
Maybe tweaking of some of the constatns would be good. Suggestions
welcomed.

The frequency changes are reported in tracking.log. For example:

2010-04-09 07:42:04 PPS0             1     97.613      0.004  2.189e-08
2010-04-09 07:42:08 PPS0             1     97.614      0.004  6.226e-08
2010-04-09 07:42:12 PPS0             1     97.614      0.004  5.617e-08
2010-04-09 07:42:16 PPS0             1     97.614      0.004 -7.244e-08
2010-04-09 07:42:56 0.0.0.0          0     97.614      0.004  0.000e+00
2010-04-09 07:43:20 0.0.0.0          0     97.610      0.004  0.000e+00
2010-04-09 07:44:24 0.0.0.0          0     97.609      0.004  0.000e+00
2010-04-09 07:46:32 0.0.0.0          0     97.611      0.004  0.000e+00
2010-04-09 07:50:48 0.0.0.0          0     97.621      0.004  0.000e+00
2010-04-09 07:59:20 0.0.0.0          0     97.647      0.004  0.000e+00
2010-04-09 08:16:24 0.0.0.0          0     97.703      0.004  0.000e+00
2010-04-09 08:50:32 0.0.0.0          0     97.767      0.004  0.000e+00
2010-04-09 09:58:48 0.0.0.0          0     97.801      0.004  0.000e+00



--
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-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


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