[ntp:questions] Linux 11-minute mode (RTC update)
Ulrich Windl
Ulrich.Windl at RZ.Uni-Regensburg.DE
Fri May 9 08:21:44 UTC 2008
Serge Bets <serge.bets at NOSPAM.laposte.invalid> writes:
> Hello Ulrich,
>
> On Friday, May 2, 2008 at 16:16:53 +0200, Ulrich Windl wrote:
>
>> Bill Unruh <unruh at physics.ubc.ca> writes:
>>>>> Real men don't want the eleven-minutes mode.
>
> The words you attribute to Bill are mine.
You'll have to count the '>' characters...
>
>
>> IMHO the idea to update the RTC during shutdown is broken, because if
>> the system crashes, the RTC time may be wrong.
>
> The RTC has been good the last time it was written, but has drifted
> since then. Only hwclock can compensate this drift at best. Eleven-mode
> and kernel initialisation alone can't.
How does hwclock know when the RTC was updated last?
>
> Under normal conditions without crash, the hwclock method clearly wins,
> by very very far. It permits to reboot and stay at some tens of
> microseconds of UTC; halt for the night and stay at some milliseconds...
> Eleven-minutes mode does almost 1000 times less good.
IMHO exchanging systemtime with the RTC by a user-program is broken.
>
> In case of crash, the hwclock method still wins, though much less
> clearly. It compensates the drift since the previous clean shutdown,
> counting that the RTC drifted at a fixed rate. But the rate really
> can vary. That's why a good evaluation of the rate is so important. And
> that's why an hwclock-in-cron is a good optional addition to
> hwclock-in-shutdown.
Did you consider that on Multi-Boot systems a different OS might have run that
also updates the RTC? In these cases hwclock kills the correct time.
>
> Conclusion: crash or no-crash, with cron or without, instant reboot or
> halt for the night, a well used hwclock always wins.
hwclock is unnecessary if NTP is used and the kernel handles the RTC properly
(IMHO).
>
>
>> Likewise the concept of a user program getting the system time from
>> the RTC during boot is broken. The kernel needs correct time as early
>> as possible.
>
> The kernel initialisation already reads the RTC once at startup. Hwclock
> rereads the RTC a little later, in the startup scripts. Hwclock is
> extremely more accurate at that. And hwclock compensates drift; the
> kernel doesn't.
I may be stupid, but how does hwclock know the drift? Asuming it has exclusive
ownership of the RTC?
>
> So what you say is very true. But is not an argument against hwclock;
> It is an argument to call hwclock at the earliest.
>
>
> Please note that I'm talking about the latest hwclock 2.32 from BJH,
> whose accuracy has been considerably improved across the years. The
> version forked for util-linux is far behind, somewhere between 200 and
> 500 times less good.
>
> Also note that the eleven-minutes mode and hwclock are incompatible:
> the former perturbates the later. To use hwclock well, you have to
> disable the eleven-minutes mode.
My opinion still is to disable hwclock and fix the kernel. Sorry.
Regards,
Ulrich
More information about the questions
mailing list