linux-2.4.22_ioapic-affinity-fix_A0

From: john stultz
Date: Mon Aug 25 2003 - 19:51:18 EST


Marcelo, All,

In set_ioapic_affinity() we take a cpu mask which we normally pass into
the apic. However, on xapics in clustered physical mode (ie: x440s) we
need to convert this mask into a physical apicid before sending it to
the apic. If clustered_apic_mode is XAPIC, this patch selects the lowest
cpu in the mask and routes the interrupts there. This avoids
timedoubling and other interrupt misdirection seen on x440s after
playing with /proc/irq/x/smp_affinity.

Please apply.

thanks
-john


diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c Fri Aug 22 19:05:33 2003
+++ b/arch/i386/kernel/io_apic.c Fri Aug 22 19:05:33 2003
@@ -1365,6 +1365,13 @@
static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
{
unsigned long flags;
+
+ /* pick a single cpu for clustered xapics */
+ if(clustered_apic_mode == CLUSTERED_APIC_XAPIC){
+ int cpu = ffs(mask)-1;
+ mask = cpu_to_physical_apicid(cpu);
+ }
+
/*
* Only the first 8 bits are valid.
*/



-
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/