Re: [PATCH 0/4] mm: fix reclaim storms in defrag_mode
From: Shakeel Butt
Date: Wed Jul 01 2026 - 20:31:45 EST
On Fri, Jun 26, 2026 at 02:21:16PM -0400, Johannes Weiner wrote:
> As we deployed vm.defrag_mode=1 into Meta production, some workloads
> regressed with recurring pressure spikes and swap storms (which in turn
> triggered userspace OOM rules on pressure and swap utilization levels).
>
> Tracing pinned this to non-movable
allocation?
> requests spinning and reclaiming
> unproductively when kswapd/kcompactd are overwhelmed. Direct reclaim
> predominantly frees up pages in movable blocks, but those requests
> cannot use that space under defrag_mode rules;
Do we have these rules documented somewhere?
> and it is unlikely to
> free up whole blocks incidentally for __rmqueue_claim() to work.
>
> This series fixes it by making non-movable requests participate in
> pageblock production in the allocator slowpath.
Sorry after reading above sentence I didn't get what those allocators will do
things differently after the series (I still have to go through the series).
>
> That requires some small-ish adjustments up front in the allocator and
> the compaction code: three prep patches and the fix last.
>
> The series has been in production against one of the affected workloads
> for two weeks and restores the OOM kill rate to !defrag_mode baseline.
>
> Based on mm-new (2026-06-22).
>
> include/linux/compaction.h | 3 +-
> mm/compaction.c | 68 ++++++++++++++++++++++++--------------------
> mm/internal.h | 7 +++++
> mm/page_alloc.c | 59 ++++++++++++++++++++++++++++++------
> 4 files changed, 98 insertions(+), 39 deletions(-)
>