Re: [PATCH v1 1/2] vdso: Add VDSO_UNALIGNED_PACKED config option for ARMv5

From: Marc Kleine-Budde

Date: Wed Oct 21 2026 - 02:54:53 EST


On 20.10.2026 16:51:01, David Laight wrote:
> On Tue, 20 Oct 2026 16:56:40 +0200
> Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx list, where I'm
> > not subscribed:
> >
> > https://lore.kernel.org/all/sashiko-outbox-178182@xxxxxxxxxx/
> >
> > > 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
> >
> > 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:
>
> So the nand fs is hit by the memcpy() but there are misaligned transfers
> in the network stack.

Yes, I came to the same conclusion.

> > - v7.0.12 NFS root
> > User: 0
> > System: 573956 (tcp_measure_rcv_mss+0xe4/0x1e0)
>
> I can't find __udp_lib_rcv(), but that looks like it could be from expanding
> tcp_flag_word(tcp_hdr(skb)).

yes

> Which would rather imply that the network driver isn't correctly aligning
> all receive packets (honouring NET_IP_ALIGN).

ACK

> When I were a lad the kernel just paniced and userspace core dumped :-)

I still remember the good old days with OABI, without driver model, nptl
and git :)

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |

Attachment: signature.asc
Description: PGP signature