[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Za6Td6cx3JbTfnCZ@bombadil.infradead.org>
Date: Mon, 22 Jan 2024 08:10:31 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: Helge Deller <deller@....de>
Cc: deller@...nel.org, linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Arnd Bergmann <arnd@...db.de>, linux-modules@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH 2/4] modules: Ensure 64-bit alignment on __ksymtab_*
sections
On Sat, Dec 30, 2023 at 08:33:24AM +0100, Helge Deller wrote:
> Your selftest code is based on perf.
> AFAICS we don't have perf on parisc/hppa,
I see!
> so I can't test your selftest code
> on that architecture.
> I assume you tested on x86, where the CPU will transparently take care of
> unaligned accesses. This is probably why the results are within
> the noise.
> But on some platforms the CPU raises an exception on unaligned accesses
> and jumps into special exception handler assembler code inside the kernel.
> This is much more expensive than on x86, which is why we track on parisc
> in /proc/cpuinfo counters on how often this exception handler is called:
> IRQ: CPU0 CPU1
> 3: 1332 0 SuperIO ttyS0
> 7: 1270013 0 SuperIO pata_ns87415
> 64: 320023012 320021431 CPU timer
> 65: 17080507 20624423 CPU IPI
> UAH: 10948640 58104 Unaligned access handler traps
>
> This "UAH" field could theoretically be used to extend your selftest.
Nice!
> But is it really worth it? The outcome is very much architecture and CPU
> specific, maybe it's just within the noise as you measured.
It's within the noise for x86_64, but given what you suggest
for parisc where it is much more expensive, we should see a non-noise
delta. Even just time on loading the module should likely result in
a considerable delta than on x86_64. You may just need to play a bit
with the default values at build time.
> IMHO we should always try to natively align structures, and if we see
> we got it wrong in kernel code, we should fix it.
This was all motivated by the first review criteria of these patches
as if they were stable worthy or not. Even if we don't consider them
stable material, given the test is now written and easily extended to
test on parisc with just timing information and UAH I think it would
be nice to have this data for a few larger default factor values so we
can compare against x86_64 while we're at it.
If you don't feel like doing that test that's fine too, we can just
ignore that. I'll still apply the patches but, I figured I'd ask to
collect information while the test was already written and it should
now be easy to compare / contrast differences.
Luis
Powered by blists - more mailing lists