[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260102152637.25377-1-imran.f.khan@oracle.com>
Date: Fri, 2 Jan 2026 23:26:37 +0800
From: Imran Khan <imran.f.khan@...cle.com>
To: tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: [RFC PATCH] genirq/cpuhotpug: notify of irq affinity change for offlined cpu.
During cpu offlining the irqs with broken_affinity are affined
to other CPU but this affinity change is not accounted for by
desc::affinity_notify (if available).
This can leave users of irq_set_affinity_notifier, with old
affinity information.
Signed-off-by: Imran Khan <imran.f.khan@...cle.com>
---
I have kept the patch as RFC because I am not sure, if there is
some specific reason (and I have missed that) behind not getting
affinity change notification for cpus being offlined.
kernel/irq/cpuhotplug.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index 755346ea98196..0ab0919f2cb57 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -177,8 +177,16 @@ void irq_migrate_all_off_this_cpu(void)
bool affinity_broken;
desc = irq_to_desc(irq);
- scoped_guard(raw_spinlock, &desc->lock)
+ scoped_guard(raw_spinlock_irqsave, &desc->lock)
affinity_broken = migrate_one_irq(desc);
+ if (affinity_broken && desc->affinity_notify) {
+ kref_get(&desc->affinity_notify->kref);
+ if (!schedule_work(&desc->affinity_notify->work)) {
+ /* Work was already scheduled, drop our extra ref */
+ kref_put(&desc->affinity_notify->kref,
+ desc->affinity_notify->release);
+ }
+ }
if (affinity_broken) {
pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n",
base-commit: f8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da
--
2.34.1
Powered by blists - more mailing lists