Re: [chrony-dev] Let the kernel write the sys clock to RTC

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


On Fri, 14 May 2010, Piotr Grudzinski wrote:

> > > 3. In an extreme case, the only permanent storage, with r/w access, > > > is a small > > > NVRAM in RTC. The estimated system clock error/drift ca be stored > > > there. > > > > No, there is no linux way of putting the drift rate into the rtc that > > I
> >   know
> >   of.
> > I read it from NVRAM and create a drift file in a RAM FS for chronyd
>  to use and vice versa.
>
 OK. But then the 11 min rule is a disaster.
 (I assume you are talking about the drift of the rtc, not of the system
 clock)

So, the drift in chrony.drift file is the drift of RTC and is not used to
adjust the system clock driven by the CPU crystal?

No, the drift in chrony.drift is the drift of the system clock. The driftg in
the rtc is in chony.rtc The two clocks are completely decoupled. The system
clock is run by the CPU crystal essentially, whiel the rtc has its own crystal
run by the onboard little battery. The two drift rates are decoupled ( except
of course that the internal temp. affects them both). The rtc is used ONLY to
set the system clock when the computer is switched on. neither chrony not ntp
affect the rtc, unless you run the 11 min rule (it is as if ntp acted like the
old rdate protocol, where your computer went out and asked the server for the
time and set your compueter's system time to that reading, with no rate
control etc.) The problem with the rtc is that the only thing you can control
is the time. You cannot control the ra. But then you do not need it to read
the right time, only that you know how much to correct its time when setting
the system. ntp and the old hwclock simply set the system time to the rtc. chrony and the
new hwclock calibrate the drift and the offset of the rtc, and set the system
to the corrected time.
(system(now)= rtc(now)-Offset(then)-drift(then)*(now-then)
where Offset and drift are saved in chrony.rtc (in the case of chrony).
Thus it does not matter that the rtc is off (for example because you run
Windows and want the rtc to display local time, not utc for windows) chrony
corrects.

The correction is not perfect (the drift rate is temp dependent, and an off
computer is colder than a running one, meaning the drift rate while the
computer is off is different from what the measurements indicated while it was
on) but it is much better than nothing (the temp drift is probably a few PPM,
rather than a few 10s or 100s of PPM that the rtc crystal usually suffers)



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