P4/i845 Strange clock drifting
Quoted 11 lines · Chris Wilson
I've now tried a couple more kernels to no avail - nothing can find APICs. Is it even possible for a P4 to not have a local APIC? System is a supermicro 5012B*.
/proc/cpuinfoshows:flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
(notice no "apic"). Is this normal/correct? If just just removed the check from
apic.cand tried to enable the apic anyway then are bad things going to happen?
Your P4 does contain a local APIC, but your BIOS chose to disable it. The following patch should (re)enable it:
arch/i386/kernel/apic.c renamed from arch/i386/kernel/apic.c.~1~ +2 -2
@@ -603,7 +603,7 @@ goto no_apic;case X86_VENDOR_INTEL :if (boot_cpu_data.x86 ==6 || - (boot_cpu_data.x86 ==15 && cpu_has_apic) || + boot_cpu_data.x86 ==15 || (boot_cpu_data.x86 ==5 && cpu_has_apic))break ; goto no_apic;
@@ -615,7 +615,7 @@/* * Some BIOSes disable the local APIC in the * APIC_BASE MSR. This can only be done in -* software for Intel P6 and AMD K7 (Model > 1). +* software for Intel P6/P4 and AMD K7 (Model > 1). */ rdmsr (MSR_IA32_APICBASE , l, h);if (!(l &MSR_IA32_APICBASE_ENABLE )) {
This should work (and is known to work on many P6 and K7 boards), but your BIOS may have problems with the local APIC.
- does apm --suspend work? does the resume afterwards work?
- if you run something compute-intensive for a while, does it continue working ok or does it hang suddenly?
If your box remained stable, great!
If it experienced problems like unexpected hangs, then we'll need to prevent the local APIC from being enabled on this mainboard. In this case, please apply the patch below, reconfigure without local APIC support, rebuild and send me (not the list) the DMI strings printed during boot -- or the entire boot log if you're not certain which parts are the DMI strings.
/Mikael
arch/i386/kernel/dmi_scan.c renamed from arch/i386/kernel/dmi_scan.c.~1~ +2 -2
@@ -21,8 +21,8 @@u16 handle; }; -#define dmi_printk (x) -//#define dmi_printk(x) printk x +//#define dmi_printk(x) +#define dmi_printk (x) printk xstatic char *__init dmi_string (struct dmi_header *dm,u8 s) {
Hi Mikael,
I've now applied your patch so that APIC's get enabled even though the bios has disabled them.
I really should have saved the dmi messages to another machine when the machine first came up as it appears to have crashed now :(
The machine was completely idle other than for an ssh session running ntpdate every ten minutes (my original problem is that the clock appears to stop/slow down periodically).
Quoted 1 line
From memory the dmi messages just had a bios date, and the mobo model
(Supermicro P4SBE). Once I've got the NOC to reboot the system I'll switch it back to a kernel that doesn't attempt to enable the APIC and send you the full dmi strings.
Quoted 3 lines
This should work (and is known to work on many P6 and K7 boards), but your BIOS may have problems with the local APIC.
- does apm --suspend work? does the resume afterwards work?
I don't have APM support compiled in and will have disabled anything power management related in the BIOS setup.
I guess that I'm not going to get APIC going on this system then - does anyone have any other suggestions on what to try next to debug the clock drift problem? Short of dropping the server into the nearest skip....
Are the APIC thing and the clock thing likely to be related??
Cheers,
Chris
An update...
Quoted 9 lines
I've now applied your patch so that APIC's get enabled even though the bios has disabled them.
I really should have saved the dmi messages to another machine when the machine first came up as it appears to have crashed now :(
The machine was completely idle other than for an ssh session running ntpdate every ten minutes (my original problem is that the clock appears to stop/slow down periodically).
Back without APIC now - and the machine is stable again. Clock is still screwed however.
Quoted 6 lines
Quoted 3 lines
This should work (and is known to work on many P6 and K7 boards), but your BIOS may have problems with the local APIC.
- does apm --suspend work? does the resume afterwards work?I don't have APM support compiled in and will have disabled anything power management related in the BIOS setup.
Last night I set another machine doing:
(while sleep 600; do ssh screwedbox ntpdate goodbox; done) | tee ntp.log
The results (attached) are interesting. It appears that my clock drift problem occurs every hour. Perhaps it is APM related?? Load doesn't seem to make any difference. And there's never two consecutive ntpdate's that are a long way out - suggesting that whenever the problem occurs it's then fixed temporarily when ntpdate sets the clock.
Anyone have any suggestions as to what to try next? Shall I try compiling a kernel with APM support and see if I can turn off anything that might be causing troubs? I'm *sure* I turned off any mention of power management in the BIOS....
Regards,
Chris