Re: [chrony-dev] automatic RTC trimming

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


On Mon, 13 Feb 2012, Miroslav Lichvar wrote:

It seems some Linux distributions no longer call hwclock --systohc on
shutdown (e.g. Fedora with systemd as init), so I'm wondering if it
would be possible to use the -s option by default and also have some
automatic RTC trimming to keep it reasonably close to correct time.

The current code seems to have a couple of problems. The RTC frequency
estimate is bad for some time after trimming which makes it difficult
to trim it periodically. The RTC HPET emulation seems to break the
runs test, the number of RTC samples is low and the estimated
frequency is not stable.

There was a proposal to add an option to trim the RTC on start to
improve the chances of having enough time to get a good drift value,
but I think it should possible to improve the code to allow shutdown
at any point after trim without ruining the drift value.

Here is what I'm considering to do:
- after trim keep using the old drift until the new drift has
 stabilized or combine with their skews as weights

This seems OK

- track long-term drift: always keep a maximum number of samples
 (disable the runs test), increase the maximum measurement interval
 or do RTC sampling only on reference updates (NTP polling), decouple
 RTC and system clock drifts (don't slew RTC samples on changes in
 system clock frequency)

I do not know how you can decouple the rtc and system drifts since the only
time which the rtc can be compared with is the system time. If you change the
notion of what the system time is, you also have to change the notion of what
the rtc time is.
- add an option to periodically trim RTC

Seems reasonable. Of course this means that one has to import into chrony, the
notion as to whether the rtc is on UTC of local time. As it is , the rtc can
be off by 8 hours, say (here in BC) and chrony will not object. But if chrony
trims the rtc, it has to know what to trim it to. Sys time ( meaning use of
UTC), local time, of some other time the user might want his rtc to run at.




Any comments or suggestions?



--
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/