[PATCH 18/25] perf: arm_pmu: Request specific affinities for percpu NMI/IRQ

Marc Zyngier
2025-09-08T16:31:52Z

Let the PMU driver request both NMI and normal IRQs with an affinity
mask matching the PMU affinity.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
drivers/perf/arm_pmu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 044c9c6296997..0d64e929d9bf0 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -679,13 +679,14 @@ int armpmu_request_irq(struct arm_pmu * __percpu *armpmu, int irq, int cpu)
}
} else if (armpmu_count_irq_users(cpu, irq) == 0) {
err = request_percpu_nmi(irq, handler, "arm-pmu",
- NULL,
- &cpu_armpmu);
+ per_cpu(pmu_affinity, cpu),
+ armpmu);

/* If cannot get an NMI, get a normal interrupt */
if (err) {
- err = request_percpu_irq(irq, handler, "arm-pmu",
- &cpu_armpmu);
+ err = request_percpu_irq_affinity(irq, handler, "arm-pmu",
+ per_cpu(pmu_affinity, cpu),
+ armpmu);
irq_ops = &percpu_pmuirq_ops;
} else {
has_nmi = true;
--
2.39.2