x86/irq: use move_irq_desc() in create_irq_nr()
authorYinghai Lu <yinghai@kernel.org>
Thu, 30 Apr 2009 08:17:50 +0000 (01:17 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 1 May 2009 17:01:12 +0000 (19:01 +0200)
move_irq_desc() will try to move irq_desc to the home node if
the allocated one is not correct, in create_irq_nr().

( This can happen on devices that are on different nodes that
  are using MSI, when drivers are loaded and unloaded randomly. )

v2: fix non-smp build
v3: add NUMA_IRQ_DESC to eliminate #ifdefs

[ Impact: improve irq descriptor locality on NUMA systems ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <49F95EAE.2050903@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/Kconfig
arch/x86/kernel/apic/io_apic.c
include/linux/irq.h
kernel/irq/Makefile

index e1b2543f8ed3ff06b0d7a6a885692b152c9d21ac..674e21e9f0a0c9555d353586645784b47152bc58 100644 (file)
@@ -274,6 +274,10 @@ config SPARSE_IRQ
 
          If you don't know what to do here, say N.
 
+config NUMA_IRQ_DESC
+       def_bool y
+       depends on SPARSE_IRQ && NUMA
+
 config X86_MPPARSE
        bool "Enable MPS table" if ACPI
        default y
index 9cd4806cdf5f6f04b992ae16041df9d2ed5a5ac2..e583291fe6c36aeb952fb562c555e65f291bb1ad 100644 (file)
@@ -3197,11 +3197,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
                if (cfg_new->vector != 0)
                        continue;
 
-#ifdef CONFIG_NUMA_IRQ_DESC
-               /* different node ?*/
-               if (desc_new->node != node)
-                       desc = move_irq_desc(desc, node);
-#endif
+               desc_new = move_irq_desc(desc_new, node);
 
                if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
                        irq = new;
index 4b95ddb5304b5fc3491483ad0caf97f0d34ffddb..eedbb8e5e0ccff99c79594b6485fd9259049d088 100644 (file)
@@ -206,9 +206,16 @@ extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc
 
 #ifndef CONFIG_SPARSE_IRQ
 extern struct irq_desc irq_desc[NR_IRQS];
-#else /* CONFIG_SPARSE_IRQ */
+#endif
+
+#ifdef CONFIG_NUMA_IRQ_DESC
 extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node);
-#endif /* CONFIG_SPARSE_IRQ */
+#else
+static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
+{
+       return desc;
+}
+#endif
 
 extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
 
index 2f065277f8ee2b5bd6f3c492b8eefcf393a8073e..7d047808419da88e273fba8cd1efd88d9aaa5bcd 100644 (file)
@@ -3,5 +3,5 @@ obj-y := handle.o manage.o spurious.o resend.o chip.o devres.o
 obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o
-obj-$(CONFIG_SPARSE_IRQ) += numa_migrate.o
+obj-$(CONFIG_NUMA_IRQ_DESC) += numa_migrate.o
 obj-$(CONFIG_PM_SLEEP) += pm.o