
From: "Martin J. Bligh" <mbligh@aracnet.com>

Make irqbalance into a config option - some people (jgarzik, arjan, etc)
wanted to be able to disable it and do things from userspace instead.  This
patch allows each camp to do their own thing, which seems fair ;-)



---

 25-akpm/arch/i386/Kconfig          |    8 ++++++++
 25-akpm/arch/i386/kernel/io_apic.c |    8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff -puN arch/i386/Kconfig~CONFIG_IRQBALANCE arch/i386/Kconfig
--- 25/arch/i386/Kconfig~CONFIG_IRQBALANCE	Tue Feb 17 13:08:43 2004
+++ 25-akpm/arch/i386/Kconfig	Tue Feb 17 13:08:43 2004
@@ -836,6 +836,14 @@ config EFI
 	anything about EFI).  However, even with this option, the resultant
 	kernel should continue to boot on existing non-EFI platforms.
 
+config IRQBALANCE
+ 	bool "Enable kernel irq balancing"
+	depends on SMP
+	default y
+	help
+ 	  The defalut yes will allow the kernel to do irq load balancing.
+	  Saying no will keep the kernel from doing irq load balancing.
+
 config HAVE_DEC_LOCK
 	bool
 	depends on (SMP || PREEMPT) && X86_CMPXCHG
diff -puN arch/i386/kernel/io_apic.c~CONFIG_IRQBALANCE arch/i386/kernel/io_apic.c
--- 25/arch/i386/kernel/io_apic.c~CONFIG_IRQBALANCE	Tue Feb 17 13:08:43 2004
+++ 25-akpm/arch/i386/kernel/io_apic.c	Tue Feb 17 13:08:43 2004
@@ -280,7 +280,7 @@ static void set_ioapic_affinity_irq(unsi
 	spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-#if defined(CONFIG_SMP)
+#if defined(CONFIG_IRQBALANCE)
 # include <asm/processor.h>	/* kernel_thread() */
 # include <linux/kernel_stat.h>	/* kstat */
 # include <linux/slab.h>		/* kmalloc() */
@@ -694,9 +694,11 @@ static inline void move_irq(int irq)
 
 __initcall(balanced_irq_init);
 
-#else /* !SMP */
+#else /* !CONFIG_IRQBALANCE */
 static inline void move_irq(int irq) { }
+#endif /* CONFIG_IRQBALANCE */
 
+#ifndef CONFIG_SMP
 void send_IPI_self(int vector)
 {
 	unsigned int cfg;
@@ -711,7 +713,7 @@ void send_IPI_self(int vector)
 	 */
 	apic_write_around(APIC_ICR, cfg);
 }
-#endif /* defined(CONFIG_SMP) */
+#endif /* !CONFIG_SMP */
 
 
 /*

_
