aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers
diff options
context:
space:
mode:
authorBrian Norris <[email protected]>2025-06-12 18:32:51 +0000
committerThomas Gleixner <[email protected]>2025-06-13 13:13:35 +0000
commit2b32fc8ff08deac3aa509f321a28e21b1eea5525 (patch)
treef6b0b79b02c15c9298131a164f2639f56ff26bdd /rust/helpers
parentLinux 6.16-rc1 (diff)
downloadkernel-2b32fc8ff08deac3aa509f321a28e21b1eea5525.tar.gz
kernel-2b32fc8ff08deac3aa509f321a28e21b1eea5525.zip
genirq/cpuhotplug: Rebalance managed interrupts across multi-CPU hotplug
Commit 788019eb559f ("genirq: Retain disable depth for managed interrupts across CPU hotplug") intended to only decrement the disable depth once per managed shutdown, but instead it decrements for each CPU hotplug in the affinity mask, until its depth reaches a point where it finally gets re-started. For example, consider: 1. Interrupt is affine to CPU {M,N} 2. disable_irq() -> depth is 1 3. CPU M goes offline -> interrupt migrates to CPU N / depth is still 1 4. CPU N goes offline -> irq_shutdown() / depth is 2 5. CPU N goes online -> irq_restore_affinity_of_irq() -> irqd_is_managed_and_shutdown()==true -> irq_startup_managed() -> depth is 1 6. CPU M goes online -> irq_restore_affinity_of_irq() -> irqd_is_managed_and_shutdown()==true -> irq_startup_managed() -> depth is 0 *** BUG: driver expects the interrupt is still disabled *** -> irq_startup() -> irqd_clr_managed_shutdown() 7. enable_irq() -> depth underflow / unbalanced enable_irq() warning This should clear the managed-shutdown flag at step 6, so that further hotplugs don't cause further imbalance. Note: It might be cleaner to also remove the irqd_clr_managed_shutdown() invocation from __irq_startup_managed(). But this is currently not possible because of irq_update_affinity_desc() as it sets IRQD_MANAGED_SHUTDOWN and expects irq_startup() to clear it. Fixes: 788019eb559f ("genirq: Retain disable depth for managed interrupts across CPU hotplug") Reported-by: Aleksandrs Vinarskis <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Aleksandrs Vinarskis <[email protected]> Link: https://lore.kernel.org/all/[email protected]
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions