| Summary: | Time drifting on STABLE SMP when calling gettimeofday(). | ||
|---|---|---|---|
| Product: | Base System | Reporter: | mb <mb> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.4-PRERELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
I've to add: It is a forward timedrifting. And also these lines may be interesting: APIC_IO: Testing 8254 interrupt delivery APIC_IO: Broken MP table detected: 8254 is not connected to IOAPIC #0 intpin 2 APIC_IO: routing 8254 via 8259 and IOAPIC #0 intpin 0 On single CPU on the same CPU there is NO time-drifting. So it is related to SMP. But why does gettimeofday() modify the system counter only on SMP systems ? Martin Thomas Moestl and I have found that the following workaround
makes the clock speedup disappearing:
--- sys/i386/isa/clock.c Thu Aug 30 17:01:31 2001
+++ sys/i386/isa/clock.c.new Thu Aug 30 17:01:29 2001
@@ -1203,7 +1203,7 @@
high = inb(TIMER_CNTR0);
count = timer0_max_count - ((high << 8) | low);
if (count < i8254_lastcount ||
- (!i8254_ticked && (clkintr_pending ||
+ (!i8254_ticked && (/*clkintr_pending || */
((count < 20 || (!(ef & PSL_I) && count < timer0_max_count /
Maybe someone else know more ?
Martin
Martin Blapp, mb@imp.ch
------------------------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 061 826 93 00: +41 61 826 93 01
PGP Fingerprint: 57E 7CCD 2769 E7AC C5FA DF2C 19C6 DCD1 1B3A EC9C
------------------------------------------------------------------
State Changed From-To: open->feedback Tor applied his fix to RELENG_4. Can this be closed? State Changed From-To: feedback->closed Submitter is happy with the applied fix. |
Serverworks Chipset Timecounter "i8254" frequency 1193182 Hz CPU: Pentium III/Pentium III Xeon/Celeron (933.37-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x686 Stepping = 6 Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE> Changing APIC ID for IO APIC #1 from 3 to 1 in MP table Changing APIC ID for IO APIC #1 from 3 to 1 on chip Programming 16 pins in IOAPIC #0 IOAPIC #0 intpin 2 -> irq 0 Programming 16 pins in IOAPIC #1 FreeBSD/SMP: Multiprocessor motherboard cpu0 (BSP): apic id: 3, version: 0x00040011, at 0xfee00000 cpu1 (AP): apic id: 0, version: 0x00040011, at 0xfee00000 io0 (APIC): apic id: 2, version: 0x000f0011, at 0xfec00000 io1 (APIC): apic id: 1, version: 0x000f0011, at 0xfec01000 Fix: Not known. This is really a severe Problem on bigger servers ! Ntpd gives up after some minutes cause the jitter is to big, and calling ntpdate all 10 seconds is not really a solution. How-To-Repeat: If you produce 100% load with this program on one CPU, the time drifting happens. The drift is about 10% !!! It seems that gettimeofday() produces the effect. Other load does not make anything and seems to be harmless. #include <sys/types.h> #include <sys/time.h> #include <err.h> int main(void) { for(;;) { struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); } return (0); }