[chrony-dev] automatic RTC trimming |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
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
- 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)
- add an option to periodically trim RTC
Any comments or suggestions?
--
Miroslav Lichvar
--
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.