[ntp:questions] Linux 11-minute mode (RTC update)

Bill Unruh unruh at physics.ubc.ca
Fri Apr 4 16:16:22 UTC 2008

Noob <root at localhost> writes:

>Serge Bets wrote:

>> Noob wrote:
>>> STA_UNSYNC (0x0040, clock unsynchronized) is 0. [...] Thus the kernel
>>> should write the system time to the RTC every 11 minutes; but it does
>>> not.
>> Fine! Don't touch anything, happy man, or it might well "tomber en
>> marche".

>Hello Serge, I was hoping you'd comment!

>If I don't want the kernel to update the RTC, I can always undef 

>> Real men don't want the eleven-minutes mode.


>> It is not only extremely inaccurate by itself, but it also steps on
>> the toes of those tools that are able to manage the RTC properly.

>Our equipment is supposed to run 24/7 for months / years.
>I need to keep the RTC synchronized, in case of power failure.

>Do you believe that running hwclock --systohc periodically is better 
>than using the kernel's 11-minute mode?

>> I previously posted some figures, comparing the accuracy of writing the
>> RTC (not counting drift). Mean offset and dispersion:
>>  - eleven-minutes mode:           -2150 µs +-5000
>>  - hwclock util-linux-ng 2.13.1:  -2500 µs  +-170
>>  - hwclock 2.32 from BJH:             0 µs   +-10

>Point taken.

>( I use http://giraffe-data.com/software/about_hwclock.html )

>If I use hwclock to update the RTC, how often should I do it?

>What do you think about the following script?

>while true
>   sleep 660  # or some other value?
>   hwclock --utc --systohc

>> Furthermore both hwclocks are able to evaluate and compensate the drift
>> of the RTC. The eleven-minutes mode cannot do that, and instead it can
>> perturbate hwclock's calculations.

>Is the crystal of the RTC supposed to be more stable than the crystal 
>of the CPU?

Nope. It is less stable. But what you really want is the drift rate of the
crystal when the computer is shut off ( ie cooling or cold) and all you can
measure is the drift rate when it is on (warm and constant) 
The sensitivity of the rtc crystal to temp can be up to 10 times worse than
the cpu clock's sensitivity.

However, even a crude drift compensation is probably better than none. Just
don't expect any miracles from the RTC.


More information about the questions mailing list