arm64: use cpu_online_mask when using forced irq_set_affinity
PATCH 1/1 arm64: use cpu_online_mask when using forced irq_set_affinity
From: Sudeep Holla <[email protected]>
Commit 01f8fa4f01d8("genirq: Allow forcing cpu affinity of interrupts") enabled the forced irq_set_affinity which previously refused to route an interrupt to an offline cpu.
Commit ffde1de64012("irqchip: Gic: Support forced affinity setting") implements this force logic and disables the cpu online check for GIC interrupt controller.
When __cpu_disable calls migrate_irqs, it disables the current cpu in cpu_online_mask and uses forced irq_set_affinity to migrate the IRQs away from the cpu but passes affinity mask with the cpu being offlined also included in it.
When calling irq_set_affinity with force == true in a cpu hotplug path, the caller must ensure that the cpu being offlined is not present in the affinity mask or it may be selected as the target CPU, leading to the interrupt not being migrated.
This patch uses cpu_online_mask when using forced irq_set_affinity so that the IRQs are properly migrated away.
---
Hi Catalin,
If you are fine with this change, can you pick up this fix ?
Regards,
Sudeep
arch/arm64/kernel/irq.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm64/kernel/irq.c +7 -3
@@ -97,11 +97,15 @@ static bool migrate_one_irq(struct irq_desc *desc)if (irqd_is_per_cpu (d) || !cpumask_test_cpu (smp_processor_id (), affinity))return false; -if (cpumask_any_and (affinity, cpu_online_mask) >= nr_cpu_ids) { - affinity = cpu_online_mask; +if (cpumask_any_and (affinity, cpu_online_mask) >= nr_cpu_ids) ret = true; - } +/* +* when using forced irq_set_affinity we must ensure that the cpu +* being offlined is not present in the affinity mask, it may be +* selected as the target CPU otherwise +*/ + affinity = cpu_online_mask; c =irq_data_get_irq_chip (d);if (!c->irq_set_affinity)pr_debug ("IRQ%u: unable to set affinity\n" , d->irq);
Signature · 1 line
1.8.3.2
PATCH 1/1 arm64: use cpu_online_mask when using forced irq_set_affinity
Quoted 20 lines · Sudeep Holla
From: Sudeep Holla <[email protected]>
Commit 01f8fa4f01d8("genirq: Allow forcing cpu affinity of interrupts") enabled the forced
irq_set_affinitywhich previously refused to route an interrupt to an offline cpu.Commit
ffde1de64012("irqchip: Gic: Support forced affinity setting")implements this force logic and disables the cpu online check for GIC interrupt controller.When
__cpu_disablecallsmigrate_irqs, it disables the current cpu incpu_online_maskand uses forcedirq_set_affinityto migrate the IRQs away from the cpu but passes affinity mask with the cpu being offlined also included in it.When calling
irq_set_affinitywith force == true in a cpu hotplug path, the caller must ensure that the cpu being offlined is not present in the affinity mask or it may be selected as the target CPU, leading to the interrupt not being migrated.
Quoted 7 lines
This patch uses
cpu_online_maskwhen using forcedirq_set_affinityso that the IRQs are properly migrated away.Signed-off-by Sudeep Holla <[email protected]>Acked-by Mark Rutland <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>
Applied, thanks.
Signature · 1 line
Catalin