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

From: Brian Gerst
Date: Thu Apr 04 2024 - 11:37:19 EST


On Thu, Apr 4, 2024 at 3:56 AM Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
>
> * Brian Gerst <brgerst@xxxxxxxxx> wrote:
>
> > > > It's not a technical reason. It's a practical one: I don't want
> > > > to spend time reviewing the fixes and dealing with the fallout
> > > > and regressions that the fixes might cause.
> > >
> > > Yeah, so it's an indirect technical argument: fixes *with
> > > tradeoffs* like this one have a future maintenance & robustness
> > > cost. Fixes without tradeoffs are fine of course.
> >
> > What tradeoffs are there with this patch? This would not affect the
> > page tables, since those are already properly aligned. Forcing
> > alignment of stack variables is only a problem if it tickles a
> > compiler bug.
>
> 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


Brian Gerst