Skip to contentSkip to conversation

Time precision, adjtime(x) vs. gettimeofday

DISCUSSION Bill Fink 3 participants 4 messages Oct 10, 2003 PowerPC

lore
Share & tools
lore

Bill Fink

author
#0 lore raw
Quoted 13 lines · Benjamin Herrenschmidt
Quoted 2 lines

I repeat the question: what are the values of drift on the machines that encounter the problem ? Is this drift stable or unstable?

So far, there is no problem. The problem that was happening was a via_calibrate_decr() bug with HZ != 100, but when investigating, I figured out that we had a potential problem there, that's all and that's why I want people like you who know those problems well to state if it's worth bothering ;)

Quoted 4 lines
Quoted 3 lines

On all cases, those will drift some way from what the NTP server will give, either a lot or not, it will. So we may end up adjusting our kernel rate and thus opening a window for the problem.

Quoted 5 lines
Quoted 3 lines

The worst variations of drift I've seen are a few ppm for a given machine, barring the occasional boot-time calibration problems that I have encountered.

OK.

This discussion prompted me to finally ask about another clock related problem I see on the 867 MHz G4 systems at work. The clocks on these systems continuously run 0.2% slow (about 3 minutes per day). Apparently this is more than ntp can adjust for (using scaling), as I get many of these error messages in the log:

Oct 10 00:11:29 clifford ntpd[425]: time reset 2.641342 s
Oct 10 00:11:29 clifford ntpd[425]: synchronisation lost
Oct 10 00:32:07 clifford ntpd[425]: time reset 2.671741 s
Oct 10 00:32:07 clifford ntpd[425]: synchronisation lost
Oct 10 00:52:46 clifford ntpd[425]: time reset 2.671729 s
Oct 10 00:52:46 clifford ntpd[425]: synchronisation lost

This causes problems if I take these systems off the network for a few hours, if I forget to reset them to the correct time when I reconnect them, since we use Kerberos for security, and the time difference between the system and the Kerberos KDC will prevent remote logins.

These systems are using a 2.4.20-ben1 kernel.

-Bill

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 20 lines · Bill Fink
Quoted 17 lines · Benjamin Herrenschmidt
Quoted 2 lines

I repeat the question: what are the values of drift on the machines that encounter the problem ? Is this drift stable or unstable?

So far, there is no problem. The problem that was happening was a via_calibrate_decr() bug with HZ != 100, but when investigating, I figured out that we had a potential problem there, that's all and that's why I want people like you who know those problems well to state if it's worth bothering ;)

Quoted 7 lines
Quoted 3 lines

On all cases, those will drift some way from what the NTP server will give, either a lot or not, it will. So we may end up adjusting our kernel rate and thus opening a window for the problem.

The worst variations of drift I've seen are a few ppm for a given machine, barring the occasional boot-time calibration problems that I have encountered.

Quoted 7 lines
Quoted 1 line

OK.

This discussion prompted me to finally ask about another clock related problem I see on the 867 MHz G4 systems at work. The clocks on these systems continuously run 0.2% slow (about 3 minutes per day). Apparently this is more than ntp can adjust for (using scaling), as I get many of these error messages in the log:

Indeed, the limit of NTP is about 500ppm (0.05%) AFAIR. Anything higher and you go into period time steps like the one you report.

2.4.20 is recent enough and should not have this kind of problems.

What is the initial decrementer frequency from boot messages log?

What is the timebase frequency from OF?
(od -td4 /proc/device-tree/cpus/PowerPC,G4/timebase-frequency)

Gabriel

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

author
#2 lore raw
Quoted 8 lines · Gabriel Paubert
Quoted 6 lines · Bill Fink

This discussion prompted me to finally ask about another clock related problem I see on the 867 MHz G4 systems at work. The clocks on these systems continuously run 0.2% slow (about 3 minutes per day). Apparently this is more than ntp can adjust for (using scaling), as I get many of these error messages in the log:

Quoted 6 lines

Indeed, the limit of NTP is about 500ppm (0.05%) AFAIR. Anything higher and you go into period time steps like the one you report.

2.4.20 is recent enough and should not have this kind of problems.

What is the initial decrementer frequency from boot messages log?

clifford% dmesg | grep -i decr
time_init: decrementer frequency = 33.290001 MHz

Quoted 2 lines

What is the timebase frequency from OF?
(od -td4 /proc/device-tree/cpus/PowerPC,G4/timebase-frequency)

clifford% od -td4 /proc/device-tree/cpus/PowerPC,G4/timebase-frequency
0000000 33290001
0000004

-Bill

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to Bill Fink
Quoted 6 lines · Bill Fink

This discussion prompted me to finally ask about another clock related problem I see on the 867 MHz G4 systems at work. The clocks on these systems continuously run 0.2% slow (about 3 minutes per day). Apparently this is more than ntp can adjust for (using scaling), as I get many of these error messages in the log:

is it a quicksilver G4? i maintain one of those and its time goes off much faster then that (3 minutes within a couple hours).

the fix is rather simple:

arch/ppc/platforms/pmac_time.c renamed from arch/ppc/platforms/pmac_time.c.orig +2 -0
@@ -262,7 +262,9 @@
 	 * calibration. That's better since the VIA itself seems
 	 * to be slightly off. --BenH
 	 */
+#if 0
 	if (!machine_is_compatible("MacRISC2"))
+#endif
 		if (via_calibrate_decr())
 			return;
 

in the case of the quicksilver VIA is FAR better then whatever it uses instead.

--
Ethan Benson
http://www.alaska.net/~erbenson/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/