v1
2026-08-28
抑制 MGLRU 跨节点空遍历 · v1
MGLRU 补丁抑制跨 NUMA 空扫描:empty_map 跳过无页 mm,PUD 级 Bloom filter 跳过无年轻项的冷区。
原始补丁链接
子 Patch(9)
1/9
mm/mglru: add MM_WALK_EMPTY stats and tracepoint
Add per-walk counters to measure empty aging walks which traverse an mm’s page tables but find no folio for the current lruvec (node+memcg). These are common on multi-NUMA node systems because lru_gen
2/9
mm/mglru: suppress cross-node empty page table walks
In the current MGLRU, lru_gen_use_mm() will mark one process’s mm used on all nodes at each context switch. So each nodes’s aging walks into each mm’s page tables. For an mm with memory on one or only
3/9
mm/mglru: add debugfs knob for the empty-walk skip threshold
Change the hardcoded MGLRU_EMPTY_SKIP_GENS to a runtime-tunable mglru_empty_skip_gens (default 4), set by: echo “skip_empty ” > /sys/kernel/debug/lru_gen (0 = disable) The current value is sh
4/9
mm/mglru: invalidate empty-walk skip on page fault and migration
empty_map skips an mm on a node for up to K generations after an empty walk. Notify MGLRU when a page of the mm appears: set the node’s bitmap bit and clear its empty_map bit, so the next aging pass w
5/9
mm/mglru: add PUD-level Bloom filter state
Add a coarser double-buffered Bloom filters to struct lru_gen_mm_state, one level up from the PMD-level filters. They operate at 1GB (PUD) granularity, whose 512 PMDs would all fail the PMD-level filt
6/9
mm/mglru: refactor Bloom filter helpers for two filter levels
Split functions test/update/reset_bloom_filter() into __ prefixed helpers that operate on a generic filters array, and wrappers (test/update/reset_pmd_bloom_filter()) that pass PMD-level mm_state->pmd
7/9
mm/mglru: skip PUD subtrees during aging
The aging walk into present PUD and iterates all its 512 PMDs, testing the PMD-level Bloom filter on each. Add a coarser PUD-level filter (pud_filters) one level up: - walk_pmd_range() now reports wh
8/9
mm/mglru: report hot PUDs from the rmap feedback path
lru_gen_look_around() marks the PMD of a young PTE found during the eviction rmap walk, feeding hot regions back to the aging walker. Mark the covering PUD as well, so regions whose hotness is only ob
9/9
mm/mglru: count PUD subtrees skipped by the PUD-level filter
Add MM_PUD_EMPTY_SKIPPED, incremented in walk_pud_range() whenever a PUD subtree is skipped by the filter. Like other counters accumulated per walk, shown in debugfs lru_gen output (the “S” column of