Re: [PATCH v2 4/4] mm: page_alloc: fix non-movable reclaim storm in defrag_mode

From: Johannes Weiner

Date: Mon Jul 27 2026 - 13:02:11 EST


On Sat, Jul 25, 2026 at 12:34:29PM +0000, Brendan Jackman wrote:
> On Wed Jul 22, 2026 at 2:56 PM UTC, Johannes Weiner wrote:
> > @@ -4169,8 +4185,8 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> > barrier();
> > WRITE_ONCE(current->capture_control, &capc);
> >
> > - *compact_result = try_to_compact_pages(gfp_mask, order, alloc_flags, ac,
> > - prio, &capc);
> > + *compact_result = try_to_compact_pages(gfp_mask, compact_order,
> > + alloc_flags, ac, prio, &capc);
> >
>
> Nit: the comment for try_to_compact_pages() is falsified by this,
> we need something like:

Yes, good catch. Thanks.

Andrew, would you mind folding this difflet in place?

> diff --git i/mm/compaction.c w/mm/compaction.c
> index 0568623d9384d..ca57403dc1522 100644
> --- i/mm/compaction.c
> +++ w/mm/compaction.c
> @@ -2823,7 +2823,7 @@ static enum compact_result compact_zone_order(struct zone *zone, int order,
> /**
> * try_to_compact_pages - Direct compact to satisfy a high-order allocation
> * @gfp_mask: The GFP mask of the current allocation
> - * @order: The order of the current allocation
> + * @order: The order to try and make available
> * @alloc_flags: The allocation flags of the current allocation
> * @ac: The context of current allocation
> * @prio: Determines how hard direct compaction should try to succeed