From 092aa78c11f08b1e1915392286241fc03ffd9903 Mon Sep 17 00:00:00 2001 From: Jianchao Wang Date: Wed, 9 Jan 2019 03:20:24 -0500 Subject: [PATCH] x86/apic/x2apic: set affinity of a single interrupt to one cpu Customer want to offline the cpus to 2 per node. And finally, a lpfc HBA cannot work any more due to no available irq vectors. [ 51.031812] IRQ 284 set affinity failed because there are no available vectors. The device assigned to this IRQ is unstable. [ 51.031817] IRQ 285 set affinity failed because there are no available vectors. The device assigned to this IRQ is unstable. [ 51.031822] IRQ 286 set affinity failed because there are no available vectors. The device assigned to this IRQ is unstable. [ 51.031827] IRQ 287 set affinity failed because there are no available vectors. The device assigned to this IRQ is unstable. It was due to cluster_vector_allocation_domain which want to set interrupt affinity of a single interrupt to multiple CPUs and need a same irq vector to be available on multiple cpus. This is difficult for customer's case where there are a lot of HBAs on node 0 and only 2 or 4 cpus online there. And actually, this feature has been discarded by the upstream. https://lkml.org/lkml/2017/9/13/576 We close this feature by just set one cpu in retmask in cluster_vector_allocation_domain. Customer that encountered this issue used RHCK, since UEK4 also has the same code, post a same patch for UEK4 Orabug: 29196396 Reviewed-by: Zhenzhong Duan Signed-off-by: Jianchao Wang Signed-off-by: Brian Maly --- arch/x86/kernel/apic/x2apic_cluster.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index ab3219b3fbda..fb2edecc470a 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -219,19 +219,7 @@ static const struct cpumask *x2apic_cluster_target_cpus(void) static void cluster_vector_allocation_domain(int cpu, struct cpumask *retmask, const struct cpumask *mask) { - /* - * To minimize vector pressure, default case of boot, device bringup - * etc will use a single cpu for the interrupt destination. - * - * On explicit migration requests coming from irqbalance etc, - * interrupts will be routed to the x2apic cluster (cluster-id - * derived from the first cpu in the mask) members specified - * in the mask. - */ - if (mask == x2apic_cluster_target_cpus()) - cpumask_copy(retmask, cpumask_of(cpu)); - else - cpumask_and(retmask, mask, per_cpu(cpus_in_cluster, cpu)); + cpumask_copy(retmask, cpumask_of(cpu)); } static struct apic apic_x2apic_cluster = { -- 2.50.1