genirq/cpuhotplug: Retry with cpu_online_mask when migration fails
authorDongli Zhang <dongli.zhang@oracle.com>
Tue, 23 Apr 2024 07:34:13 +0000 (00:34 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 24 Apr 2024 18:42:57 +0000 (20:42 +0200)
commit88d724e2301a69c1ab805cd74fc27aa36ae529e0
tree2b28cbeaca7d419193957264449297954f6fc18c
parenta60dd06af674d3bb76b40da5d722e4a0ecefe650
genirq/cpuhotplug: Retry with cpu_online_mask when migration fails

When a CPU goes offline, the interrupts affine to that CPU are
re-configured.

Managed interrupts undergo either migration to other CPUs or shutdown if
all CPUs listed in the affinity are offline. The migration of managed
interrupts is guaranteed on x86 because there are interrupt vectors
reserved.

Regular interrupts are migrated to a still online CPU in the affinity mask
or if there is no online CPU to any online CPU.

This works as long as the still online CPUs in the affinity mask have
interrupt vectors available, but in case that none of those CPUs has a
vector available the migration fails and the device interrupt becomes
stale.

This is not any different from the case where the affinity mask does not
contain any online CPU, but there is no fallback operation for this.

Instead of giving up, retry the migration attempt with the online CPU mask
if the interrupt is not managed, as managed interrupts cannot be affected
by this problem.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240423073413.79625-1-dongli.zhang@oracle.com
kernel/irq/cpuhotplug.c