From: Jirka Hladky <jhladky@redhat.com>
To: dockseed@proton.me
Cc: will@kernel.org, catalin.marinas@arm.com,
kristina.martsenko@arm.com, luyang@redhat.com, jmario@redhat.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: clear_user: align __arch_clear_user() to 128B for I-cache efficiency
Date: Wed, 25 Nov 2026 00:54:20 +0100 [thread overview]
Message-ID: <20261124235420.1299547-1-jhladky@redhat.com> (raw)
In-Reply-To: <h2Yz7IeYKGRjKTvtyae9lgHZIlzgU1Ze5lPbucMya5_pi5-E78h2z8BgJHbZ0JG3ufYHoIE_2ax0hUF-_TDkXfXnPwhLilCyFV0NHh4GML4=@proton.me>
Hi Norman,
Thank you for the excellent analysis, and for pinpointing that the
root cause is in clear_user.S itself rather than in where the
function lands.
We reproduced your findings on bare-metal Ampere Altra (Neoverse N1,
no FEAT_MOPS) and can confirm them end to end.
Disassembling __arch_clear_user() out of /proc/kcore on the running
kernels, both the ELN 7.3.0-65 and 7.4.0-0.rc3 builds we tested carry
exactly two NOPs between the loop-back branch target and the first
sttr, i.e. the padding you described.
To isolate the change, we built two kernels from the same tree, same
config and toolchain, differing only in the label move (your one-line
fix): the unpatched build has the two NOPs in the loop, the patched
build branches directly to the sttr. Reading 4 GiB from /dev/zero
(performance governor, pinned CPU, median of 3 runs):
unpatched patched
kernel instr/MiB 797.5k 536.4k
throughput 11.6 GB/s 22.3 GB/s
The instruction counts match your measurements almost exactly, and
the delta (261.1k per MiB) is precisely the two NOPs at 8 bytes per
iteration (2 x 131072). On N1 the throughput effect is even larger
than on your A76: +92%.
The unpatched rebuild also reproduces the stock ELN kernel's numbers
exactly, so the only variable in the comparison above is the
one-line fix.
I have posted the reworked patch as [PATCH v2] in this thread:
https://lore.kernel.org/all/20261124233043.1289050-1-jhladky@redhat.com/
with your diagnosis credited in the commit message and a Suggested-by
trailer.
Thanks again,
Jirka
next prev parent reply other threads:[~2026-11-24 23:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 16:52 Norman Herms
2026-11-24 23:54 ` Jirka Hladky [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-11-21 5:04 Luke Yang
2025-11-24 13:38 ` Will Deacon
2025-11-25 3:45 ` Luke Yang
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=20261124235420.1299547-1-jhladky@redhat.com \
--to=jhladky@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=dockseed@proton.me \
--cc=jmario@redhat.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luyang@redhat.com \
--cc=will@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®