From: "Arnd Bergmann" <arnd@arndb.de>
To: "Marc Kleine-Budde" <mkl@pengutronix.de>
Cc: "Ian Rogers" <irogers@google.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Andy Lutomirski" <luto@kernel.org>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"Stefan Kerkmann" <s.kerkmann@pengutronix.de>,
"Christophe Leroy" <chleroy@kernel.org>,
"David Laight" <david.laight.linux@gmail.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Eric Biggers" <ebiggers@google.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/2] vdso: Add VDSO_UNALIGNED_PACKED config option for ARMv5
Date: Tue, 20 Oct 2026 10:24:51 +0200 [thread overview]
Message-ID: <d2afb4cb-145e-488b-8f6e-c83e38735526@app.fastmail.com> (raw)
In-Reply-To: <20261020-succinct-zebu-of-vigor-6cb2cd-mkl@pengutronix.de>
On Tue, Oct 20, 2026, at 08:44, Marc Kleine-Budde wrote:
> On 20.10.2026 00:12:57, Arnd Bergmann wrote:
>> On Mon, Oct 19, 2026, at 22:12, Ian Rogers wrote:
>> > +
>> > +config VDSO_UNALIGNED_PACKED
>> > + bool
>> > + default CPU_32v5
>> > + help
>> > + Use packed structs rather than memcpy() in include/vdso/unaligned.h
>> > + for unaligned memory accesses. Enabled on ARMv5 where GCC may emit
>> > + out-of-line memcpy() calls instead of inlining byte accesses.
>>
>> As explained, I think this misrepresents the problem as Arm specific and
>> isn't the correct method for -munaligned-access targets on Arm, which
>> include CPU_32v3, CPU_32v4 and CPU_32v4T along with CPU_32v5.
>>
>> I still hope we can use a version that just produces the intended code
>> on both -munaligned-access and -mno-unaligned-access targets like the
>> old version did.
>
> FYI: there is the kconfig Symbol HAVE_EFFICIENT_UNALIGNED_ACCESS. Can we
> make use of it?
That would be better, but I still hope we can just get back to the
portable code across all architectures for the in-kernel version.
I have one more request for you: can you check /proc/cpu/alignment
on the system that shows the performance regression with and without
the patch? In your original report, you have shown that Ian's patch
caused the drop in performance and that it caused the added function
calls, but I don't see any sufficiently hot code path that would
actually explain the scale of the regression, unless there is now
also a case where get_unaligned() ends up doing the wrong case and
running into a fixup handler. If this happens, you should see a
nontrivial number of fixups listed in /proc/cpu/alignment. On
a working system, the numbers should all be low but likely nonzero
because there tend to be callers that still lack get_unaligned()
wrappers and just access misaligned pointers directly.
Arnd
next prev parent reply other threads:[~2026-10-20 8:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 20:12 Ian Rogers
2026-10-19 20:12 ` [PATCH v1 2/2] tools headers: Update the vdso/unaligned.h copy with the kernel sources Ian Rogers
2026-10-19 22:12 ` [PATCH v1 1/2] vdso: Add VDSO_UNALIGNED_PACKED config option for ARMv5 Arnd Bergmann
2026-10-20 6:44 ` Marc Kleine-Budde
2026-10-20 8:24 ` Arnd Bergmann [this message]
2026-10-20 8:41 ` Marc Kleine-Budde
2026-10-20 9:06 ` Arnd Bergmann
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=d2afb4cb-145e-488b-8f6e-c83e38735526@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Jason@zx2c4.com \
--cc=acme@kernel.org \
--cc=chleroy@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=ebiggers@google.com \
--cc=irogers@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mkl@pengutronix.de \
--cc=namhyung@kernel.org \
--cc=s.kerkmann@pengutronix.de \
--cc=tglx@kernel.org \
--cc=vincenzo.frascino@arm.com \
--cc=viro@zeniv.linux.org.uk \
/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®