Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] mm/mglru: skip empty PUD subtrees during aging with PUD-level Bloom filter
@ 2026-08-06 10:29 Baoquan He
  2026-08-06 10:29 ` [RFC PATCH 1/6] mm/mglru: add PUD-level Bloom filter state Baoquan He
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Baoquan He @ 2026-08-06 10:29 UTC (permalink / raw)
  To: linux-mm
  Cc: akpm, kasong, qi.zheng, shakeel.butt, baohua, axelrasmussen,
	yuanchu, weixugc, Baoquan He

Problem
=======

MGLRU's aging walks every present PUD of every mm in the mm_list.  When
an mm has no pages on a given NUMA node, all 512 PMDs in each PUD fail
the existing PMD-level Bloom filter test, yet the walker still descends
every PUD and iterates every PMD — pure waste.

These cross-node empty walks are structural: lru_gen_use_mm() sets
mm->lru_gen.bitmap to -1 (all nodes) at each context switch, so every
node's kswapd independently walks the same mm.  On a 2-node KVM guest,
~80% of all aging walks are empty; the worst-case leaf-traversal waste
with a fully resident remote mm is ~73%.

Approach
========

Add a PUD-level Bloom filter (one level above the existing PMD filter).
The walker now:

  1. Checks the PUD filter before descending into a PUD subtree.
  2. If the filter says the PUD had no young entries last generation,
     skips the entire 1GB region — avoiding 512 PMD lookups.
  3. walk_pmd_range() reports upward whether it found any young leaf
     entries; walk_pud_range() records that in the double-buffered
     PUD filter.
  4. The rmap feedback path (lru_gen_look_around()) marks hot PUDs in
     the filter, so newly hot or migrated-in regions are re-examined
     promptly rather than suppressed indefinitely.
  5. force_scan walks bypass the PUD test, so manual aging and newly
     added mm's always populate the filter.

The double-buffered filter flips each aging generation, and the eviction
feedback keeps hot regions marked, so correctness holds naturally without
tracking per-page residency or requiring changes to page fault / rmap
hot paths.

The testing results are from a 2-node KVM guest.  Real-hardware results on
a  ≥4-socket system, would be valuable. I will update the statistics
here if have.

Baoquan He (6):
  mm/mglru: add PUD-level Bloom filter state
  mm/mglru: refactor Bloom filter helpers for two filter levels
  mm/mglru: skip empty PUD subtrees during aging
  mm/mglru: report hot PUDs from the rmap feedback path
  mm/mglru: add MM_WALK_EMPTY stats and tracepoint for cross-node
    measurement
  mm/mglru: count PUD subtrees skipped by the PUD-level filter

 include/linux/mmzone.h        |  15 +++-
 include/trace/events/vmscan.h |  30 ++++++++
 mm/vmscan.c                   | 126 +++++++++++++++++++++++++++++-----
 3 files changed, 153 insertions(+), 18 deletions(-)

--
2.54.0


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

end of thread, other threads:[~2026-08-07  9:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 10:29 [RFC PATCH 0/6] mm/mglru: skip empty PUD subtrees during aging with PUD-level Bloom filter Baoquan He
2026-08-06 10:29 ` [RFC PATCH 1/6] mm/mglru: add PUD-level Bloom filter state Baoquan He
2026-08-06 10:29 ` [RFC PATCH 2/6] mm/mglru: refactor Bloom filter helpers for two filter levels Baoquan He
2026-08-06 10:29 ` [RFC PATCH 3/6] mm/mglru: skip empty PUD subtrees during aging Baoquan He
2026-08-06 10:29 ` [RFC PATCH 4/6] mm/mglru: report hot PUDs from the rmap feedback path Baoquan He
2026-08-06 10:29 ` [RFC PATCH 5/6] mm/mglru: add MM_WALK_EMPTY stats and tracepoint for cross-node measurement Baoquan He
2026-08-06 11:05 ` [RFC PATCH 0/6] mm/mglru: skip empty PUD subtrees during aging with PUD-level Bloom filter Baoquan He
2026-08-07  9:23   ` [PATCH 1/4] mm/mglru: add MM_WALK_EMPTY stats and tracepoint for cross-node measurement Baoquan He
2026-08-07  9:23     ` [PATCH 2/4] mm/mglru: suppress cross-node empty page table walks Baoquan He
2026-08-07  9:23     ` [PATCH 3/4] mm/mglru: add debugfs knob to control cross-node empty walk skip threshold Baoquan He
2026-08-07  9:23     ` [PATCH 4/4] mm/mglru: invalidate empty-walk skip on page fault and migration Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox