[PATCH][2.6.10-rc1-mm4][0/4] perfctr interrupt fixes

From: Mikael Pettersson
Date: Thu Nov 11 2004 - 04:36:47 EST

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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/