[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241201124244.997754-3-costa.shul@redhat.com>
Date: Sun, 1 Dec 2024 14:42:42 +0200
From: Costa Shulyupin <costa.shul@...hat.com>
To: longman@...hat.com,
ming.lei@...hat.com,
pauld@...hat.com,
juri.lelli@...hat.com,
vschneid@...hat.com,
Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Costa Shulyupin <costa.shul@...hat.com>,
linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org
Subject: [RFC PATCH v4 2/4] genirq/cpuhotplug: Dynamically isolate CPUs from managed interrupts
After change of housekeeping_cpumask(HK_TYPE_MANAGED_IRQ) during runtime
managed interrupts continue to run on isolated CPUs.
Dynamic CPUs isolation is complex task. One of approaches is:
1. Set affected CPUs offline and disable relevant interrupts
2. Change housekeeping_cpumask
3. Set affected CPUs online and enable relevant interrupts
irq_restore_affinity_of_irq() restores managed interrupts
during complex CPU hotplug process of bringing back a CPU online.
Leave the interrupts disabled those affinity doesn't intersect
with new housekeeping_cpumask thereby ensuring isolation
of the CPU from managed intrrupts.
Signed-off-by: Costa Shulyupin <costa.shul@...hat.com>
---
kernel/irq/cpuhotplug.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index ec2cdcd20bee..839d3e879c0d 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -218,6 +218,9 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
if (desc->istate & IRQS_SUSPENDED)
return;
+ if (!cpumask_intersects(affinity, housekeeping_cpumask(HK_TYPE_MANAGED_IRQ)))
+ return;
+
if (irqd_is_managed_and_shutdown(data))
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
--
2.47.0
Powered by blists - more mailing lists