summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorDavid Wang <00107082@163.com>2024-11-08 17:07:17 +0100
committerThomas Gleixner <tglx@linutronix.de>2024-11-13 17:36:35 +0100
commitf9ed1f7c2e26fcd19781774e310a6236d7525c11 (patch)
tree55310f85d20098f0714ae331d05f207583339e87 /kernel/irq
parentsoftirq: Use a dedicated thread for timer wakeups on PREEMPT_RT. (diff)
downloadlinux-f9ed1f7c2e26fcd19781774e310a6236d7525c11.tar.xz
linux-f9ed1f7c2e26fcd19781774e310a6236d7525c11.zip
genirq/proc: Use seq_put_decimal_ull_width() for decimal values
seq_printf() is more expensive than seq_put_decimal_ull_width() due to the format string parsing costs. Profiling on a x86 8-core system indicates seq_printf() takes ~47% samples of show_interrupts(). Replacing it with seq_put_decimal_ull_width() yields almost 30% performance gain. [ tglx: Massaged changelog and fixed up coding style ] Signed-off-by: David Wang <00107082@163.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20241108160717.9547-1-00107082@163.com
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/proc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index d226282c5b66..f36c33bd2da4 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -495,9 +495,12 @@ int show_interrupts(struct seq_file *p, void *v)
if (!desc->action || irq_desc_is_chained(desc) || !desc->kstat_irqs)
goto outsparse;
- seq_printf(p, "%*d: ", prec, i);
- for_each_online_cpu(j)
- seq_printf(p, "%10u ", desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j) : 0);
+ seq_printf(p, "%*d:", prec, i);
+ for_each_online_cpu(j) {
+ unsigned int cnt = desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j) : 0;
+
+ seq_put_decimal_ull_width(p, " ", cnt, 10);
+ }
raw_spin_lock_irqsave(&desc->lock, flags);
if (desc->irq_data.chip) {