x86_64/ioapic_abi: Disable interrupt load balance by default
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 25 Nov 2011 06:17:43 +0000 (14:17 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 25 Nov 2011 06:17:43 +0000 (14:17 +0800)
Add hw.ioapic.gsi.balance tunable to enable/disable interrupt
load balance.  It is disabled by default.

sys/platform/pc64/apic/ioapic_abi.c

index a744118..4908438 100644 (file)
@@ -511,6 +511,7 @@ struct machintr_abi MachIntrABI_IOAPIC = {
 
 static int     ioapic_abi_extint_irq = -1;
 static int     ioapic_abi_line_irq_max;
+static int     ioapic_abi_gsi_balance;
 
 struct ioapic_irqinfo  ioapic_irqs[IOAPIC_HWI_VECTORS];
 
@@ -670,6 +671,8 @@ ioapic_abi_initmap(void)
 {
        int cpu;
 
+       kgetenv_int("hw.ioapic.gsi.balance", &ioapic_abi_gsi_balance);
+
        /*
         * NOTE: ncpus is not ready yet
         */
@@ -981,6 +984,9 @@ ioapic_abi_gsi_cpuid(int irq, int gsi)
 
        KKASSERT(gsi >= 0);
 
+       if (!ioapic_abi_gsi_balance)
+               return 0;
+
        if (irq == 0 || gsi == 0) {
                if (bootverbose) {
                        kprintf("IOAPIC: irq %d, gsi %d -> cpu0 (0)\n",