Re: [PATCH v3] mm: page_alloc: make defrag_mode retries follow the promoted order

From: Kiryl Shutsemau

Date: Wed Oct 21 2026 - 05:34:16 EST


On Mon, Oct 19, 2026 at 12:28:40PM +0530, Dev Jain wrote:
>
>
> On 15/10/26 6:25 pm, Kiryl Shutsemau wrote:
> > On Thu, Oct 15, 2026 at 09:16:36AM +0200, Vlastimil Babka (SUSE) wrote:
> >>> And agree 7.4-rc1 with CC stable is fine. Sadly, not sure if anyone
> >>> but Meta is using the feature right now.
> >>
> >> I thought it was there for a long time but it was only added in 2025 :) At
> >> least the enterprise world is slow to adopt things, AFAICS.
> >
> > I was thinking to propose a patch after merge window to make defrag_mode
> > default. Do you think it is too early? I don't think it is ever going
> > to be truly stabilized without wider exposure.
>
> AFAIU defrag mode is not going to improve mTHP allocation success.
>
> I ran a synthetic benchmark faulting in lots of 64k mTHP with swap enabled,
> defrag mode caused me to enter a warn_alloc (and 8 times more compact_stalls),
> which didn't happen without defrag.

Could you share the benchmark? I would like to play with it.

Which THP defrag setting, and was the range MADV_HUGEPAGE?

With the default "madvise" and no MADV_HUGEPAGE, a 64k fault cannot
reclaim and does not wake kswapd.

How is your system setup?

> So perhaps bundle the default with pageblock_order eagerness etc.

What do you mean by pageblock_order eagerness?

--
Kiryl Shutsemau / Kirill A. Shutemov