2004-11-11 09:35:00

by Mikael Pettersson

[permalink] [raw]
Subject: [PATCH][2.6.10-rc1-mm4][0/4] perfctr interrupt fixes

This set of patches fixes a problem where a perfctr
overflow interrupt can be delayed and be "handled"
in the context of the wrong task, which doesn't work.

Bug 1 is that the perfctr core patches on x86 and
x86-64 perform the suspend action too late, when the
task owning the perfctr state no longer is current.
This creates a time window where interrupts can be
delivered even though 'current' isn't the owner.
Fixed by moving the suspend action to an earlier
point in switch_to(), when the owner still is current.

Bug 2 is a hardware quirk, confirmed to exist at least
on P3s. There appears to be a time window where a
pending counter overflow can be delivered as a local
APIC interrupt _after_ the counters have been disabled.
Disabling the counters is a serializing operation
so this shouldn't happen, but it does.
Fixed by masking interrupts before stopping the counters,
and checking in software for pending overflows.

/Mikael