Skip to content

Commit d2a5f10

Browse files
zq-david-wangglaubitz
authored andcommitted
sh: irq: Use seq_put_decimal_ull_width() for decimal values
On a system with n CPUs and m interrupts, there will be n*m decimal values yielded via seq_printf(.."%10u "..) which has significant costs parsing format string and is less efficient than seq_put_decimal_ull_width(). Stress reading /proc/interrupts indicates ~30% performance improvement with this patch. Signed-off-by: David Wang <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent 40384c8 commit d2a5f10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/sh/kernel/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ int arch_show_interrupts(struct seq_file *p, int prec)
4343
{
4444
int j;
4545

46-
seq_printf(p, "%*s: ", prec, "NMI");
46+
seq_printf(p, "%*s:", prec, "NMI");
4747
for_each_online_cpu(j)
48-
seq_printf(p, "%10u ", per_cpu(irq_stat.__nmi_count, j));
48+
seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat.__nmi_count, j), 10);
4949
seq_printf(p, " Non-maskable interrupts\n");
5050

5151
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));

0 commit comments

Comments
 (0)