diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-04-30 04:17:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-01 13:01:12 -0400 |
commit | 15e957d08dd4a841359cfec59ecb74041e0097aa (patch) | |
tree | e18a8b70751c552ba2bd7248660f137a735938ea | |
parent | 56b581ea9591b5767b1e0204c6a06c7d0c49396e (diff) |
x86/irq: use move_irq_desc() in create_irq_nr()
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>
-rw-r--r-- | arch/x86/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 6 | ||||
-rw-r--r-- | include/linux/irq.h | 11 | ||||
-rw-r--r-- | kernel/irq/Makefile | 2 |
4 files changed, 15 insertions, 8 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e1b2543f8ed3..674e21e9f0a0 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -274,6 +274,10 @@ config SPARSE_IRQ | |||
274 | 274 | ||
275 | If you don't know what to do here, say N. | 275 | If you don't know what to do here, say N. |
276 | 276 | ||
277 | config NUMA_IRQ_DESC | ||
278 | def_bool y | ||
279 | depends on SPARSE_IRQ && NUMA | ||
280 | |||
277 | config X86_MPPARSE | 281 | config X86_MPPARSE |
278 | bool "Enable MPS table" if ACPI | 282 | bool "Enable MPS table" if ACPI |
279 | default y | 283 | default y |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 9cd4806cdf5f..e583291fe6c3 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3197,11 +3197,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node) | |||
3197 | if (cfg_new->vector != 0) | 3197 | if (cfg_new->vector != 0) |
3198 | continue; | 3198 | continue; |
3199 | 3199 | ||
3200 | #ifdef CONFIG_NUMA_IRQ_DESC | 3200 | desc_new = move_irq_desc(desc_new, node); |
3201 | /* different node ?*/ | ||
3202 | if (desc_new->node != node) | ||
3203 | desc = move_irq_desc(desc, node); | ||
3204 | #endif | ||
3205 | 3201 | ||
3206 | if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) | 3202 | if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) |
3207 | irq = new; | 3203 | irq = new; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 4b95ddb5304b..eedbb8e5e0cc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -206,9 +206,16 @@ extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc | |||
206 | 206 | ||
207 | #ifndef CONFIG_SPARSE_IRQ | 207 | #ifndef CONFIG_SPARSE_IRQ |
208 | extern struct irq_desc irq_desc[NR_IRQS]; | 208 | extern struct irq_desc irq_desc[NR_IRQS]; |
209 | #else /* CONFIG_SPARSE_IRQ */ | 209 | #endif |
210 | |||
211 | #ifdef CONFIG_NUMA_IRQ_DESC | ||
210 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node); | 212 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node); |
211 | #endif /* CONFIG_SPARSE_IRQ */ | 213 | #else |
214 | static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | ||
215 | { | ||
216 | return desc; | ||
217 | } | ||
218 | #endif | ||
212 | 219 | ||
213 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); | 220 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); |
214 | 221 | ||
diff --git a/kernel/irq/Makefile b/kernel/irq/Makefile index 2f065277f8ee..7d047808419d 100644 --- a/kernel/irq/Makefile +++ b/kernel/irq/Makefile | |||
@@ -3,5 +3,5 @@ obj-y := handle.o manage.o spurious.o resend.o chip.o devres.o | |||
3 | obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o | 3 | obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o |
4 | obj-$(CONFIG_PROC_FS) += proc.o | 4 | obj-$(CONFIG_PROC_FS) += proc.o |
5 | obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o | 5 | obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o |
6 | obj-$(CONFIG_SPARSE_IRQ) += numa_migrate.o | 6 | obj-$(CONFIG_NUMA_IRQ_DESC) += numa_migrate.o |
7 | obj-$(CONFIG_PM_SLEEP) += pm.o | 7 | obj-$(CONFIG_PM_SLEEP) += pm.o |