[RFC PATCH v1 2/2] genirq/proc: Show NMI interrupt counts in /proc/interrupts

Ashok Raj ashok.raj at oss.qualcomm.com
Sat Nov 14 15:49:46 PST 2026


NMI flow handlers update only the per-CPU counters because
irq_desc::tot_count is not safe to update in NMI context. As a result,
/proc/interrupts shows zero counts for a non-per-CPU NMI.

Display the per-CPU counters for NMI descriptors, matching
kstat_irqs_desc().

Signed-off-by: Ashok Raj <ashok.raj at oss.qualcomm.com>
---
 kernel/irq/proc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 0c0df16de581..490b2df9c105 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -559,11 +559,12 @@ static int irq_seq_show(struct seq_file *p, void *v)
 	seq_putc(p, ':');
 
 	/*
-	 * Always output per CPU interrupts. Output device interrupts only when
-	 * desc::tot_count is not zero.
+	 * Always output per CPU interrupts and NMIs, which only account in
+	 * per-CPU counters. Output device interrupts only when desc::tot_count
+	 * is not zero.
 	 */
 	if (irq_settings_is_per_cpu(desc) || irq_settings_is_per_cpu_devid(desc) ||
-	    data_race(desc->tot_count))
+	    irq_is_nmi(desc) || data_race(desc->tot_count))
 		irq_proc_emit_counts(p, &desc->kstat_irqs->cnt);
 	else
 		irq_proc_emit_zero_counts(p, num_online_cpus());
-- 
2.43.0




More information about the linux-arm-kernel mailing list