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

From: Brendan Jackman

Date: Sat Jul 25 2026 - 08:38:25 EST


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:

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