The patch titled x86_64 irq: make affinity work for genapic_flat mode has been removed from the -mm tree. Its filename was x86_64-irq-make-affinity-works-for-genapic_flat-mode.patch This patch was dropped because it was nacked by the maintainer ------------------------------------------------------ Subject: x86_64 irq: make affinity work for genapic_flat mode From: "Yinghai Lu" <yinghai.lu@xxxxxxx> For AMD dual socket system with two IO Hypertransort chain on differenct cpu. We still can use apic_flat mode instead of apic_physflat mode, and like to CPUs on second socket to handle irq for device on its chain. When apic_flat mode is used, the domain will be the same (all CPUS). We need to check the old affinity in addition to domain, otherwise we can not set affinity from 0x0f to 0x0c, or from 0xff to 0xf0. Also need to make sure vector is changed when we set affinity from 0x03 to 0x0c or 0x0f to 0xf0. [akpm@xxxxxxxxxxxxxxxxxxxx: cleanups] Signed-off-by: Yinghai Lu <yinghai.lu@xxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Andi Kleen <ak@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86_64/kernel/io_apic.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff -puN arch/x86_64/kernel/io_apic.c~x86_64-irq-make-affinity-works-for-genapic_flat-mode arch/x86_64/kernel/io_apic.c --- a/arch/x86_64/kernel/io_apic.c~x86_64-irq-make-affinity-works-for-genapic_flat-mode +++ a/arch/x86_64/kernel/io_apic.c @@ -673,8 +673,28 @@ static int __assign_irq_vector(int irq, if (old_vector) { cpumask_t tmp; cpus_and(tmp, cfg->domain, mask); - if (!cpus_empty(tmp)) - return 0; + + /* only exact same mask can return directly */ + for_each_cpu_mask(cpu, mask) { + cpumask_t domain; + + domain = vector_allocation_domain(cpu); + if (cpus_equal(domain, cfg->domain)) { +#ifdef CONFIG_SMP + /* + * We don't need lock for desc here for + * apic_flat can not be used with + * CONFIG_HOTPLUG_CPU others only have one cpu + * set in domain or affinity + */ + if (cpus_equal(tmp, irq_desc[irq].affinity)) + return 0; +#else + return 0; +#endif + } + + } } for_each_cpu_mask(cpu, mask) { @@ -683,7 +703,6 @@ static int __assign_irq_vector(int irq, int vector, offset; domain = vector_allocation_domain(cpu); - cpus_and(new_mask, domain, cpu_online_map); vector = current_vector; offset = current_offset; @@ -698,9 +717,17 @@ next: continue; if (vector == IA32_SYSCALL_VECTOR) goto next; + + cpus_and(new_mask, domain, cpu_online_map); for_each_cpu_mask(new_cpu, new_mask) if (per_cpu(vector_irq, new_cpu)[vector] != -1) goto next; + + /* Make sure vector is changed when domain is not changed */ + if (unlikely(vector == old_vector)) + if (cpus_equal(domain, cfg->domain)) + goto next; + /* Found one! */ current_vector = vector; current_offset = offset; _ Patches currently in -mm which might be from yinghai.lu@xxxxxxx are x86_64-irq-remove-extra-smp_processor_id-calling.patch x86_64-irq-make-affinity-works-for-genapic_flat-mode.patch x86_64-irq-keep-consistent-for-changing-irq0_vector-from-0x20-to-0x30.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html