[PATCH 0/4] mm: fix reclaim storms in defrag_mode
From: Johannes Weiner
Date: Fri Jun 26 2026 - 14:22:42 EST
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 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; 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.
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(-)