Re: [PATCH v4] mm/page_alloc: avoid direct compaction for costly __GFP_NORETRY allocations

From: Andrew Morton

Date: Thu Sep 10 2026 - 18:03:35 EST


On Thu, 10 Sep 2026 11:46:02 +0000 Salvatore Dipietro <dipiets@xxxxxxxxx> wrote:

>
> On Sat, 05 Sep 2026 17:42:39 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > Is there anything particularly unusual about this test case?
>
> It is a stock pgbench simple-update PostgreSQL workload on a large
> instance (96 vCPUs), using standard PostgreSQL settings and with no huge
> pages assigned to the database. We deliberately overprovision the
> pgbench clients: 1024 clients over 96 threads. That keeps enough writers
> in the buffered write path concurrently to hit the costly-order
> allocation failure path continuously. The memory fragmentation comes from
> page tables: PostgreSQL spawns a new process per client, and those page
> tables consume ~40% of memory, which significantly limits the page cache
> and the free memory available.

OK, thanks.

>
> > > Results (average of 3 runs, TPS):
> > >
> > > Config Avg TPS % vs Baseline
> > > baseline (no patch) 59,408 -
> > > With this patch 155,409 +161.6%
> >
> > Is this back to pre-5d8edfb900d5 performance?
>
> Yes - fully recovered.

Great. That's worth mentioning in the changelog.

>
> > AI review asked a few serious-looking questions:
> > https://sashiko.dev/#/patchset/20260904115629.3993331-1-dipiets@xxxxxxxxx
>
> Thanks for pointing that out. To address them, we can have something
> like the patch below. Performance results are still similar to v4. Happy
> to submit a formal v5 patch with it if you would like.

Yes please, a v5 would be good.