Re: [PATCH] Revert "perf/aux: Allocate non-contiguous AUX pages by default"

From: Will Deacon

Date: Wed Nov 04 2026 - 07:59:52 EST


On Tue, Nov 03, 2026 at 12:46:24PM -0800, Yabin Cui wrote:
> On Sun, Oct 25, 2026 at 04:24:06PM +0000, Leo Yan wrote:
> > The original commit claimed that contiguous AUX pages unnecessarily
> > exacerbate fragmentation for SPE, TRBE and ETR. This is not generally
> > valid: larger allocations can keep pages with the same lifetime together,
> > while order-0 allocations can scatter them across large blocks and prevent
> > free pages from coalescing [1]. The follow-up discussion [2] has not
> > established how forcing order-0 allocations addresses the reported problem.
> ...
> > Restore the previous policy of trying higher-order allocations first.
> > The allocator already uses __GFP_NORETRY and falls back to smaller
> > orders, including order 0, when larger allocations fail.
>
> Sorry for the late reply, and sorry that the commit message in
> 18049c8cff9c ("perf/aux: Allocate non-contiguous AUX pages by default")
> was imprecise about "exacerbating memory fragmentation". You and Dev are
> right that grouping same-lifetime pages into higher-order allocations
> does not itself worsen fragmentation, and the TLB reduction numbers for
> TRBE and SPE with large vmap() mappings make total sense given TRBE's
> tiny TLB.
>
> However, a straight revert will reintroduce a severe production issue we
> hit on Android devices, so I'd like to share what actually happened and
> suggest a way to get large mappings for SPE/TRBE without bringing back
> the regression.

[...]

Thanks, Yabin. This just hardens my stance [1] that the allocation decision
should be driven by userspace and not second-guessed by the kernel. So the
revert is _not_ the right approach, in my view.

Will

[1] https://lore.kernel.org/all/ar4Iuanz_vA4twGP@willie-the-truck/