[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c7393a5-ad1a-4740-b454-a9b85682a78f@ghiti.fr>
Date: Tue, 25 Feb 2025 16:10:26 +0100
From: Alexandre Ghiti <alex@...ti.fr>
To: David Wang <00107082@....com>, paul.walmsley@...ive.com,
palmer@...belt.com, aou@...s.berkeley.edu
Cc: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 12/13] riscv/irq: use seq_put_decimal_ull_width() for
decimal values
Hi David,
On 08/11/2024 17:25, David Wang wrote:
> Performance improvement for reading /proc/interrupts on arch riscv
>
> Signed-off-by: David Wang <00107082@....com>
> ---
> arch/riscv/kernel/smp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
> index c180a647a30e..f1e9c3db094c 100644
> --- a/arch/riscv/kernel/smp.c
> +++ b/arch/riscv/kernel/smp.c
> @@ -226,7 +226,8 @@ void show_ipi_stats(struct seq_file *p, int prec)
> seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
> prec >= 4 ? " " : "");
> for_each_online_cpu(cpu)
> - seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu));
> + seq_put_decimal_ull_width(p, " ",
> + irq_desc_kstat_cpu(ipi_desc[i], cpu), 10);
> seq_printf(p, " %s\n", ipi_names[i]);
> }
> }
Very late answer sorry!
I don't have the same output before and after your patch because
seq_put_decimal_ull_width() second argument is placed *before* the
number, not after as it was before.
The following diff fixes the issue:
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index
f1e9c3db094c3..4b80ee4e5b2c0 100644 --- a/arch/riscv/kernel/smp.c +++
b/arch/riscv/kernel/smp.c @@ -225,9 +225,11 @@ void
show_ipi_stats(struct seq_file *p, int prec) for (i = 0; i < IPI_MAX;
i++) { seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " :
""); - for_each_online_cpu(cpu) - seq_put_decimal_ull_width(p, " ", +
for_each_online_cpu(cpu) { + seq_put_decimal_ull_width(p, NULL,
irq_desc_kstat_cpu(ipi_desc[i], cpu), 10); + seq_putc(p, ' '); + }
seq_printf(p, " %s\n", ipi_names[i]); } }
Will you respin a new version?
Thanks,
Alex
Powered by blists - more mailing lists