Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Yinghai Lu and committed by
Ingo Molnar
15e957d0 56b581ea

+15 -8
+4
arch/x86/Kconfig
··· 274 274 275 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 281 config X86_MPPARSE 278 282 bool "Enable MPS table" if ACPI 279 283 default y
+1 -5
arch/x86/kernel/apic/io_apic.c
··· 3197 3197 if (cfg_new->vector != 0) 3198 3198 continue; 3199 3199 3200 - #ifdef CONFIG_NUMA_IRQ_DESC 3201 - /* different node ?*/ 3202 - if (desc_new->node != node) 3203 - desc = move_irq_desc(desc, node); 3204 - #endif 3200 + desc_new = move_irq_desc(desc_new, node); 3205 3201 3206 3202 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) 3207 3203 irq = new;
+9 -2
include/linux/irq.h
··· 206 206 207 207 #ifndef CONFIG_SPARSE_IRQ 208 208 extern struct irq_desc irq_desc[NR_IRQS]; 209 - #else /* CONFIG_SPARSE_IRQ */ 209 + #endif 210 + 211 + #ifdef CONFIG_NUMA_IRQ_DESC 210 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 220 extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); 214 221
+1 -1
kernel/irq/Makefile
··· 3 3 obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o 4 4 obj-$(CONFIG_PROC_FS) += proc.o 5 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 7 obj-$(CONFIG_PM_SLEEP) += pm.o