Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

genirq: Update request_percpu_nmi() to take an affinity

Continue spreading the notion of affinity to the per CPU interrupt request
code by updating the call sites that use request_percpu_nmi() (all two of
them) to take an affinity pointer. This pointer is firmly NULL for now.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-16-maz@kernel.org

authored by

Marc Zyngier and committed by
Thomas Gleixner
b9c6aa9e 258e7d28

+11 -9
+1 -1
arch/arm64/kernel/smp.c
··· 1094 1094 irq = ipi_irq_base + ipi; 1095 1095 1096 1096 if (ipi_should_be_nmi(ipi)) { 1097 - err = request_percpu_nmi(irq, ipi_handler, "IPI", &irq_stat); 1097 + err = request_percpu_nmi(irq, ipi_handler, "IPI", NULL, &irq_stat); 1098 1098 WARN(err, "Could not request IRQ %d as NMI, err=%d\n", irq, err); 1099 1099 } else { 1100 1100 err = request_percpu_irq(irq, ipi_handler, "IPI", &irq_stat);
+1 -1
drivers/perf/arm_pmu.c
··· 659 659 irq_ops = &pmunmi_ops; 660 660 } 661 661 } else if (armpmu_count_irq_users(irq) == 0) { 662 - err = request_percpu_nmi(irq, handler, "arm-pmu", &cpu_armpmu); 662 + err = request_percpu_nmi(irq, handler, "arm-pmu", NULL, &cpu_armpmu); 663 663 664 664 /* If cannot get an NMI, get a normal interrupt */ 665 665 if (err) {
+2 -2
include/linux/interrupt.h
··· 197 197 } 198 198 199 199 extern int __must_check 200 - request_percpu_nmi(unsigned int irq, irq_handler_t handler, 201 - const char *devname, void __percpu *dev); 200 + request_percpu_nmi(unsigned int irq, irq_handler_t handler, const char *name, 201 + const struct cpumask *affinity, void __percpu *dev_id); 202 202 203 203 extern const void *free_irq(unsigned int, void *); 204 204 extern void free_percpu_irq(unsigned int, void __percpu *);
+7 -5
kernel/irq/manage.c
··· 2527 2527 * @irq: Interrupt line to allocate 2528 2528 * @handler: Function to be called when the IRQ occurs. 2529 2529 * @name: An ascii name for the claiming device 2530 + * @affinity: A cpumask describing the target CPUs for this interrupt 2530 2531 * @dev_id: A percpu cookie passed back to the handler function 2531 2532 * 2532 2533 * This call allocates interrupt resources for a per CPU NMI. Per CPU NMIs ··· 2544 2543 * If the interrupt line cannot be used to deliver NMIs, function 2545 2544 * will fail returning a negative value. 2546 2545 */ 2547 - int request_percpu_nmi(unsigned int irq, irq_handler_t handler, 2548 - const char *name, void __percpu *dev_id) 2546 + int request_percpu_nmi(unsigned int irq, irq_handler_t handler, const char *name, 2547 + const struct cpumask *affinity, void __percpu *dev_id) 2549 2548 { 2550 2549 struct irqaction *action; 2551 2550 struct irq_desc *desc; ··· 2562 2561 !irq_supports_nmi(desc)) 2563 2562 return -EINVAL; 2564 2563 2565 - /* The line cannot already be NMI */ 2566 - if (irq_is_nmi(desc)) 2564 + /* The line cannot be NMI already if the new request covers all CPUs */ 2565 + if (irq_is_nmi(desc) && 2566 + (!affinity || cpumask_equal(affinity, cpu_possible_mask))) 2567 2567 return -EINVAL; 2568 2568 2569 2569 action = create_percpu_irqaction(handler, IRQF_NO_THREAD | IRQF_NOBALANCING, 2570 - name, NULL, dev_id); 2570 + name, affinity, dev_id); 2571 2571 if (!action) 2572 2572 return -ENOMEM; 2573 2573