Skip to content

Commit 916b93f

Browse files
Jinjie Ruanctmarinas
authored andcommitted
arm64: smp: Fix missing IPI statistics
commit 83cfac9 ("genirq: Allow interrupts to be excluded from /proc/interrupts") is to avoid IPIs appear twice in /proc/interrupts. But the commit 331a1b3 ("arm64: smp: Add arch support for backtrace using pseudo-NMI") and commit 2f5cd0c("arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup") set CPU_BACKTRACE and KGDB_ROUNDUP IPIs "IRQ_HIDDEN" flag but not show them in arch_show_interrupts(), which cause the interrupt kstat_irqs accounting is missing in display. Before this patch, CPU_BACKTRACE and KGDB_ROUNDUP IPIs are missing: / # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 11: 466 600 309 332 GICv3 27 Level arch_timer 13: 24 0 0 0 GICv3 33 Level uart-pl011 15: 64 0 0 0 GICv3 78 Edge virtio0 16: 0 0 0 0 GICv3 79 Edge virtio1 17: 0 0 0 0 GICv3 34 Level rtc-pl031 18: 3 3 3 3 GICv3 23 Level arm-pmu 19: 0 0 0 0 9030000.pl061 3 Edge GPIO Key Poweroff IPI0: 7 14 9 26 Rescheduling interrupts IPI1: 354 93 233 255 Function call interrupts IPI2: 0 0 0 0 CPU stop interrupts IPI3: 0 0 0 0 CPU stop (for crash dump) interrupts IPI4: 0 0 0 0 Timer broadcast interrupts IPI5: 1 0 0 0 IRQ work interrupts Err: 0 After this pacth, CPU_BACKTRACE and KGDB_ROUNDUP IPIs are displayed: / # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 11: 393 281 532 449 GICv3 27 Level arch_timer 13: 15 0 0 0 GICv3 33 Level uart-pl011 15: 64 0 0 0 GICv3 78 Edge virtio0 16: 0 0 0 0 GICv3 79 Edge virtio1 17: 0 0 0 0 GICv3 34 Level rtc-pl031 18: 2 2 2 2 GICv3 23 Level arm-pmu 19: 0 0 0 0 9030000.pl061 3 Edge GPIO Key Poweroff IPI0: 11 19 4 23 Rescheduling interrupts IPI1: 279 347 222 72 Function call interrupts IPI2: 0 0 0 0 CPU stop interrupts IPI3: 0 0 0 0 CPU stop (for crash dump) interrupts IPI4: 0 0 0 0 Timer broadcast interrupts IPI5: 1 0 0 1 IRQ work interrupts IPI6: 0 0 0 0 CPU backtrace interrupts IPI7: 0 0 0 0 KGDB roundup interrupts Err: 0 Fixes: 331a1b3 ("arm64: smp: Add arch support for backtrace using pseudo-NMI") Signed-off-by: Jinjie Ruan <[email protected]> Suggested-by: Doug Anderson <[email protected]> Acked-by: Will Deacon <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent cf938f9 commit 916b93f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/arm64/kernel/smp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,13 +762,15 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
762762
}
763763
}
764764

765-
static const char *ipi_types[NR_IPI] __tracepoint_string = {
765+
static const char *ipi_types[MAX_IPI] __tracepoint_string = {
766766
[IPI_RESCHEDULE] = "Rescheduling interrupts",
767767
[IPI_CALL_FUNC] = "Function call interrupts",
768768
[IPI_CPU_STOP] = "CPU stop interrupts",
769769
[IPI_CPU_CRASH_STOP] = "CPU stop (for crash dump) interrupts",
770770
[IPI_TIMER] = "Timer broadcast interrupts",
771771
[IPI_IRQ_WORK] = "IRQ work interrupts",
772+
[IPI_CPU_BACKTRACE] = "CPU backtrace interrupts",
773+
[IPI_KGDB_ROUNDUP] = "KGDB roundup interrupts",
772774
};
773775

774776
static void smp_cross_call(const struct cpumask *target, unsigned int ipinr);
@@ -779,7 +781,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
779781
{
780782
unsigned int cpu, i;
781783

782-
for (i = 0; i < NR_IPI; i++) {
784+
for (i = 0; i < MAX_IPI; i++) {
783785
seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
784786
prec >= 4 ? " " : "");
785787
for_each_online_cpu(cpu)

0 commit comments

Comments
 (0)