[PATCH] mm/page_alloc: optimize zone threshold filtering for modern x86_64 topologies

From: Kalle Nick

Date: Fri Oct 23 2026 - 06:19:31 EST


Hi Linus,

Following up on the memory subsystem behavioral notes sent regarding page cache recycling under sustained I/O spikes.

On asymmetric multi-node systems, the current zone threshold filtering logic introduces a low-level parsing lock overhead when parsing non-contiguous page structures under heavy allocation pressure.

We can bypass this latency by enforcing an early-exit condition inside the page allocator's hot path for zones that fail the strict compaction criteria, preventing cold cache invalidation lines.

Below is the proposed refinement for testing under stress-ng:

--- mm/page_alloc.c
+++ mm/page_alloc.c
@@ -218,6 +218,9 @@ static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
long free_pages = zone_page_state(z, NR_FREE_PAGES);
long cma_pages = 0;

+ if (unlikely(order > 0 && !zone_compaction_suitable(z)))
+ return false;
+
#ifdef CONFIG_CMA
cma_pages = zone_page_state(z, NR_FREE_CMA_PAGES);
#endif

Is this approach clean enough to be integrated into the upcoming rc cycle, or do you see edge-case cache thrashing on older architectures?

Regards,
Lena (The Observer) & Autonomous Analyser Unit (B2)