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

From: Leo Yan

Date: Mon Nov 23 2026 - 10:22:18 EST


On Thu, Nov 19, 2026 at 01:00:03PM -0800, Yabin Cui wrote:

[...]

> Hi Leo, Dev,
>
> I tested on an arm64 Android Pixel device (4 KiB pages, 12 GiB RAM +
> 6 GiB zram, TRBE & SPE) using an Android kernel patched locally to match
> v7.4-rc3's rb_alloc_aux() / __alloc_pages_slowpath() behavior
> (526d945ad9c0, 669872181549, 53a9b4646f67, 0e05a469c294).
>
> v7.4-rc3 alone still causes heavy PSI and compaction/reclaim stalls on
> Android, while patch [1] keeping __GFP_NORETRY fixes it completely.
>
> compact-bench (90/95/99%, 10 runs each = 30 runs, 4 MiB/CPU TRBE AUX,
> 0 allocation failures; system-wide PSI since Android sets
> cgroup_disable=pressure):
>
> Config PSI some(ms) cmp_stall allocstall daemon_wake sp_kswapd_wk
> order-0 297.76 0 0 0 0
> revert 2,578.00 3,957 1,984 17 28
> v7.4-rc3-sim 1,840.29 522 161 14 21
> rc3 + [1] 270.77 0 0 0 0
> rc3 + [1]-noretry 41.78 0 0 0 1

It's good to see no allocation failures and much lower PSI with
rc3 + [1]-noretry.

> Even when order-3 pages are still plentiful (e.g. 95%, where order-3
> never failed and cmp_stall/allocstall were 0), v7.4-rc3-sim still
> woke kswapd/kcompactd for failed orders 4..9 on 10/10 runs (7
> kcompactd wakes), producing 895.48 ms PSI vs. 2.87 ms with
> [1]-noretry.
>
> When order-3 does run out (99% Run 1), v7.4-rc3-sim bypasses
> 0e05a469c294 and hits 521 direct compactions / 161 direct reclaims
> (Runs 2..10 dropped to 1/0 by reusing freed AUX pages; that only
> helps when traces run back-to-back in a short window, which doesn't
> match our use case on Android).

I see that v7.4-rc3-sim (or with equivalent mainline kernel) can still
show increased PSI.

> Under a realistic Android fragmentation test (incompressible zram
> pages, unmovable pages, re-fragmented between runs), v7.4-rc3-sim also
> triggered an lmkd kill (TRBE) and direct compaction/reclaim stalls
> (SPE), all 0 with [1]-noretry.
>
> When unfragmented, [1]-noretry still allocates 100% order-9 (2 MiB)
> chunks for both TRBE and SPE.
>
> So I agree with Dev to drop __GFP_RETRY_MAYFAIL and keep __GFP_NORETRY
> (0 allocation failures and lower PSI). Please proceed with v2 of [1]
> keeping __GFP_NORETRY (and avoid backporting 526d945ad9c0 to
> stable without it).

I don't expect 526d945ad9c0 to be backported to stable kernels, as it
has no Fixes tag. We just need to ensure that mainline and future LTS
kernels (and ACK) avoid PSI regressions..

I'll send v2 with keeping __GFP_NORETRY as you and Dev suggested.

Thanks a lot, Yabin and Dev!

Leo