All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mm: fix reclaim storms in defrag_mode
@ 2026-07-22 14:56 Johannes Weiner
  2026-07-22 14:56 ` [PATCH v2 1/4] mm: page_alloc: __GFP_FS lockdep annotation for direct compaction Johannes Weiner
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Johannes Weiner @ 2026-07-22 14:56 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka
  Cc: Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Zi Yan,
	David Hildenbrand, Lorenzo Stoakes, Liam R . Howlett,
	Mike Rapoport, Shakeel Butt, linux-mm, linux-kernel

As we deployed vm.defrag_mode=1 in 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 - meaning, they will
invoke direct reclaim and direct compaction with pageblock_order.

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 several weeks and restores the OOM kill rate to !defrag_mode baseline.

v1: https://lore.kernel.org/20260626182215.1107966-1-hannes@cmpxchg.org/

Changes in v2:
- Patch 3 is now Vlastimil's version of the capture_control move: the
  allocator owns and arms the capture control entirely, and compaction
  just aims it at the zone being compacted.
- Comments on the migration source scan restrictions in patch 2, and
  spelled out "small" as <pageblock_order (Vlastimil, Zi Yan)
- Corrected the Fixes tag in patch 4 - the referenced SHA was from an
  old development branch (Zi Yan)
- Clarified in the cover letter what block production means (Shakeel)
- Added review/ack tags
- Cc stable on the fix (Vlastimil)
- Rebased onto mm-stable

Based on mm-stable (2026-07-06).

 include/linux/compaction.h |  3 +-
 mm/compaction.c            | 96 +++++++++++++++++++++++++---------------------
 mm/internal.h              | 10 ++++-
 mm/page_alloc.c            | 76 ++++++++++++++++++++++++++++++------
 4 files changed, 129 insertions(+), 56 deletions(-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-07-22 23:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 14:56 [PATCH v2 0/4] mm: fix reclaim storms in defrag_mode Johannes Weiner
2026-07-22 14:56 ` [PATCH v2 1/4] mm: page_alloc: __GFP_FS lockdep annotation for direct compaction Johannes Weiner
2026-07-22 14:56 ` [PATCH v2 2/4] mm: compaction: support non-movable compaction for pageblock requests Johannes Weiner
2026-07-22 16:23   ` Gregory Price
2026-07-22 14:56 ` [PATCH v2 3/4] mm: page_alloc: move capture_control to the page allocator Johannes Weiner
2026-07-22 16:59   ` Gregory Price
2026-07-22 14:56 ` [PATCH v2 4/4] mm: page_alloc: fix non-movable reclaim storm in defrag_mode Johannes Weiner
2026-07-22 17:10   ` Brendan Jackman
2026-07-22 23:22   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.