Re: [PATCH v2 1/4] seqlock: introduce scoped_seqlock_read() and scoped_seqlock_read_irqsave()

From: Linus Torvalds
Date: Thu Oct 09 2025 - 19:26:54 EST


On Thu, 9 Oct 2025 at 16:20, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> The moment I use a union gcc-14 creates the whole structure on the
> stack, while without the union it mostly manages to keep the things
> in registers without too much spilling.

Ouch.

Do the union manually like I did by just using a "unsigned long" for
both 'seq' and 'flags'.

I bet that works fine - it seemed to work well for my - admittedly
somewhat different - version.

Linus