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

Serge Bets serge.bets at NOSPAM.laposte.invalid
Tue Apr 8 15:04:47 UTC 2008


 On Tuesday, April 8, 2008 at 10:01:59 +0200, Noob wrote:

> After setting the RTC, hwclock reports:
> Hardware clock ended up -0.001261 seconds from intended set time.
> And this "offset" is always approximately -1.25 ms
> What is the problem here? Is it even a problem?

Yes and no. This offset is mainly due to the RTC oscillator restarting
a little bit late, ie the difference between the 500 ms in data sheets
and reality. This value (and its jitter) is specific to a given RTC
chip. Yours is quite low. I typically see between -1.7 and -2.3 ms,
affected by 30 to 200 µs of jitter, depending on RTC brand and model.

It is *not* a problem, because the recent hwclocks include a feedback
scheme measuring and compensating any write error, including this one.
This feedback makes the few µs accuracy available to hwclock, adjtimex,
and any other RTC reading tools supporting the /etc/adjtime file.

However you may like to precompensate the mean part of this delay when
writing. For that, call once:

| # hwclock --utc --systohc --cpupriority=99 --correct=+0.001233

Following --systohc calls will remember and apply the same
precorrection (you were using -0.000028).


> even though hwclock thinks the kernel is in 11-minute mode, I've
> removed the code where the kernel writes to the RTC.

There is a problem though: hwclock is not aware that the kernel is
patched. You will have to patch hwclock too. :-(

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
--- hwclock/hwclock.c	Sun Sep 21 22:24:03 2003
+++ hwclock/hwclock.c	Sun Mar 21 10:41:48 2004
@@ -426,4 +426,5 @@ eleven_minute_mode(void) {
     if (debug)
         printf("Kernel %s in 11 minute mode\n", retval ? "IS" : "IS NOT");
+    retval = 0;	/* Force no eleven mode (disabled in kernel) */
     return retval;
 }
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


> hwclock 2.30

Better upgrade to hwclock 2.32, which includes several important
improvements to accuracy.


Cordialement, Serge.
-- 
Serge point Bets arobase laposte point net




More information about the questions mailing list