Skip to contentSkip to conversation

loongarch/irq: use seq_put_decimal_ull_width() for decimal values

PATCH Applied David Wang 2 participants 2 messages Nov 8, 2024 – Dec 2, 2024 LoongArch

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

David Wang

author
#0 lore raw

PATCH 9/13 loongarch/irq: use seq_put_decimal_ull_width() for decimal values

Performance improvement for reading /proc/interrupts on arch loongarch

---
 arch/loongarch/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/kernel/smp.c +1 -1
index 9afc2d8b3414..86664adfb3cf 100644
@@ -82,7 +82,7 @@ void show_ipi_list(struct seq_file *p, int prec)
 	for (i = 0; i < NR_IPI; i++) {
 		seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " : "");
 		for_each_online_cpu(cpu)
-			seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).ipi_irqs[i]);
+			seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat, cpu).ipi_irqs[i], 10);
 		seq_printf(p, " LoongArch  %d  %s\n", i + 1, ipi_types[i]);
 	}
 }
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw

Applied, thanks.

Huacai

Quoted 24 lines · David Wang

Performance improvement for reading /proc/interrupts on arch loongarch

---
 arch/loongarch/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/kernel/smp.c +1 -2
index 9afc2d8b3414..86664adfb3cf 100644
@@ -82,7 +82,7 @@ void show_ipi_list(struct seq_file *p, int prec)
        for (i = 0; i < NR_IPI; i++) {
                seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " : "");
                for_each_online_cpu(cpu)
-                       seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).ipi_irqs[i]);
+                       seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat, cpu).ipi_irqs[i], 10);
                seq_printf(p, " LoongArch  %d  %s\n", i + 1, ipi_types[i]);
        }
 }
--

2.39.2