[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251020091735.24715A05-hca@linux.ibm.com>
Date: Mon, 20 Oct 2025 11:17:35 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Josephine Pfeiffer <hi@...ie.lol>
Cc: agordeev@...ux.ibm.com, gerald.schaefer@...ux.ibm.com, gor@...ux.ibm.com,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] s390: ptdump: use seq_puts() in pt_dump_seq_puts()
macro
On Sat, Oct 18, 2025 at 07:05:21PM +0200, Josephine Pfeiffer wrote:
> The pt_dump_seq_puts() macro incorrectly uses seq_printf() instead of
> seq_puts(). This is both a performance issue and conceptually wrong,
> as the macro name suggests plain string output (puts) but the
> implementation uses formatted output (printf).
>
> The macro is used in dump_pagetables.c:67-68 and 131 to output
> constant strings. Using seq_printf() adds unnecessary overhead for
> format string parsing.
>
> This bug was introduced in commit 6bf9a639e76e1 ("s390/mm,ptdump: make
> page table dumping seq_file optional") in 2020, which explicitly stated
> it was the "s390 version of commit ae5d1cf358a5 ("arm64: dump: Make the
> page table dumping seq_file optional")", copying the buggy arm64
> implementation.
>
> Fixes: 6bf9a639e76e1 ("s390/mm,ptdump: make page table dumping seq_file optional")
> Signed-off-by: Josephine Pfeiffer <hi@...ie.lol>
...
> - seq_printf(__m, fmt); \
> + seq_puts(__m, fmt); \
So yes, it should have been seq_puts() instead of seq_printf(), but
there really is no _bug_ here, except of wasted CPU cycles for a seq
file which isn't enabled in any production kernel.
I'll apply this and change the commit message accordingly.
Thanks!
Powered by blists - more mailing lists