Messages in this thread | | | Date | Wed, 15 Dec 1999 14:16:09 +0100 (MET) | From | "Maciej W. Rozycki" <> | Subject | Since 2.3.20: APIC timer calibration race + patch |
| |
Linus, Ingo,
Got it, finally! Since APIC code rewrite in 2.3.20, there was an annoying problem with APIC timer calibration, which tended to underestimate the clock heavily (such as getting half of its real value), which in turn ended in APIC timer interrupts being asserted too frequently (with all nasty effects resulting).
It turned out that there is a race condition in get_8254_timer_count(), which accesses 8254's ports directly, using no mutex means even though interrupts are enabled on all CPUS at this stage, and regardless of timer_interrupt() accessing the very same port. Looks like a simple overlook, though, as timer_interrupt() has all necessary bits already in place.
With the attached patch, get_8254_timer_count() has them too. Apart from being "obviously correct", the patch has been tested across several reboots and the calibrated APIC clock rates were within 1e-5 accuracy. The same accuracy was observed when comparing NMI and LOC interrupt counters after about two days of uptime. All tests were performed on a dual-P5MMX/233 system using the i430HX chipset, running 2.3.31.
Maciej
-- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + [unhandled content-type:application/octet-stream] | |