From: Heiko Carstens <hca@linux.ibm.com>
To: Josephine Pfeiffer <hi@josie.lol>
Cc: agordeev@linux.ibm.com, gerald.schaefer@linux.ibm.com,
gor@linux.ibm.com, linux-s390@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] s390: ptdump: use seq_puts() in pt_dump_seq_puts() macro
Date: Mon, 20 Oct 2025 11:17:35 +0200 [thread overview]
Message-ID: <20251020091735.24715A05-hca@linux.ibm.com> (raw)
In-Reply-To: <20251018170521.3355738-1-hi@josie.lol>
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@josie.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!
prev parent reply other threads:[~2025-10-20 9:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 17:05 Josephine Pfeiffer
2025-10-20 9:17 ` Heiko Carstens [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251020091735.24715A05-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hi@josie.lol \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®