Re: [PATCH 1/1] x86/mm/pae: Align up pteval_t, pmdval_t and pudval_t to avoid split locks

From: Dave Hansen
Date: Thu Apr 04 2024 - 12:30:18 EST


On 4/4/24 08:36, Brian Gerst wrote:
>> It creates extra constraints on stack layout that wasn't there before,
>> so it can only be an invariant if the compiler can reorder variables,
>> or make the stack layout worse (introducing more holes).
> For the record, stack alignments are not rare.
>
> objdump -dr vmlinux | grep "and.*,%.sp$" | wc -l
>
> 64-bit defconfig: 646
> 32-bit defconfig: 449

It's not about stack alignment for me.

The bigger question is: are we going to *maintain* the 32-bit code base
to keep it free of split locks.

It's not even just a question of how many more of these are lurking
today. Any future code that (for instance) checks
system_has_cmpxchg64() and then goes to do something fancy on the stack,
or with structure members that aren't carefully aligned will need
maintenance.

Sean is basically saying, "Please keep this feature so that it's easy to
find these on 32-bit and maintain the code base to preserve
performance". That's a perfectly reasonable argument, but only if we
decide that it's worth maintaining the 32-bit code base in this way.