mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 17:54:55 +0200	[thread overview]
Message-ID: <a34133df-224e-4cea-b574-097ad37a791a@app.fastmail.com> (raw)
In-Reply-To: <20261020-nice-turquoise-dinosaur-3079bc-mkl@pengutronix.de>

On Tue, Oct 20, 2026, at 16:56, Marc Kleine-Budde wrote:
> On 20.10.2026 10:24:51, Arnd Bergmann wrote:
>> > FYI: there is the kconfig Symbol HAVE_EFFICIENT_UNALIGNED_ACCESS. Can we
>> > make use of it?
>
> Just noticed that sashiko's review contained the same remark, but the
> bot only posts to the linux-perf-users@vger.kernel.org list, where I'm
> not subscribed:
>
> https://lore.kernel.org/all/sashiko-outbox-178182@kernel.org/
>
>> 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?
>
> When booted via NFS-root to the login prompt, we have about 570k System
> alignment fixups, all in the IP stack: :/
>
> __udp4_lib_rcv+0x78/0xc6c
> icmpv6_echo_reply+0x160/0x504
> ip_send_unicast_reply+0xf0/0x3f8
> ndisc_send_skb+0x15c/0x40c
> rawv6_recvmsg+0x114/0x3b4
> tcp_rcv_established+0x3ec/0xba0
> tcp_v4_fill_cb+0x70/0xec
> tcp_validate_incoming+0x540/0x868

That is usually a bug in the ethernet driver, which should take care of
aligning the IP header in the rx skb. Many drivers do this using
netdev_alloc_skb_ip_align(), but I see that fec has its own buffer
management, so it may not be that easy to address here but would
boost performance quite a bit if you do.

> Comparing v7.0.12 with mainline "unaligned.h" and reverting commit
> a339671db64b ("vdso: Switch get/put_unaligned() from packed struct to
> memcpy()") brings no difference with respect to alignment problems. But
> I see the increase in I/O performance (measured with "fio" [1]) on a
> UBIFS/NAND file system:
>
> - v7.0.12 NFS root
>   User:           0
>   System:         573956 (tcp_measure_rcv_mss+0xe4/0x1e0)
>   Skipped:        0
>   Half:           4
>   Word:           573940
>   DWord:          0
>   Multi:          34
>   User faults:    0 (ignored)
>
>   WRITE: bw=272KiB/s (278kB/s), 272KiB/s-272KiB/s (278kB/s-278kB/s), 
> io=32.0MiB (33.6MB), run=120532-120532msec
>
> - v7.0.12 NFS root, reverted
>   User:           0
>   System:         574214 (tcp_measure_rcv_mss+0xe4/0x1e0)
>   Skipped:        0
>   Half:           4
>   Word:           574183
>   DWord:          0
>   Multi:          27
>   User faults:    0 (ignored)
>
>   WRITE: bw=343KiB/s (352kB/s), 343KiB/s-343KiB/s (352kB/s-352kB/s), 
> io=32.0MiB (33.6MB), run=95439-95439msec

Ok, so about the same improvement that you saw on ubifs.

> Booting from UBIFS, so only the lab background IP noise...
>
> - v7.0.12 UBIFS/NAND root, reverted
>   User:           0
>   System:         164 (rawv6_recvmsg+0x114/0x3b4)
>   Skipped:        0
>   Half:           0
>   Word:           127
>   DWord:          0
>   Multi:          37
>   User faults:    0 (ignored)

At least it seems fairly safe to assume that your original
finding is correct and my worry about adding more faults is
unfounded.

       Arnd

  parent reply	other threads:[~2026-10-20 15:55 UTC|newest]

Thread overview: 11+ 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
2026-10-20  8:41       ` Marc Kleine-Budde
2026-10-20  9:06         ` Arnd Bergmann
2026-10-20 14:56       ` Marc Kleine-Budde
2026-10-20 15:51         ` David Laight
2026-10-20 15:54         ` Arnd Bergmann [this message]
2026-10-20 14:00 ` David Laight

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=a34133df-224e-4cea-b574-097ad37a791a@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®