Re: [PATCH] seqlock: Allow UBSAN_ALIGNMENT to fail optimizing

From: Arnd Bergmann

Date: Tue May 19 2026 - 07:54:18 EST


On Tue, May 19, 2026, at 13:03, Heiko Carstens wrote:
> With gcc-15 and gcc-16 with UBSAN_ALIGNMENT enabled the compiler fails to
> inline and optimize __scoped_seqlock_bug() away on s390:

technically

s/on s390//

since I have been able to reproduce the problem across architectures
now.

> s390x-16.1.0-ld: kernel/sched/build_policy.o: in function
> `__scoped_seqlock_next':
> /.../seqlock.h:1286:(.text+0x22030): undefined reference to
> `__scoped_seqlock_bug'
>
> Fix this by adding UBSAN_ALIGNMENT to the list of config options where a
> not inlined empty __scoped_seqlock_bug() is allowed.
>
> Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
> Closes: https://lore.kernel.org/r/20260515092057.810542-1-arnd@xxxxxxxxxx/
> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>

I was about to send the same patch.

Tested-by: Arnd Bergmann <arnd@xxxxxxxx>

Arnd