Re: [RFC PATCH 0/6] mm/mglru: skip empty PUD subtrees during aging with PUD-level Bloom filter
Baoquan He <[email protected]>
| Newsgroups | org.kvack.linux-mm |
|---|---|
| Message-ID | <anRqew3VikVzxJJb@MiWiFi-R3L-srv> |
On 08/06/26 at 06:29pm, Baoquan He wrote: > 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%. A note on the design background and one limitation. These patches replace my earlier per-mm empty_map approach, which skipped an mm for K generations (default 4) after an empty walk on a node. As Kairui pointed out, that leaves a window of up to K generations during which pages migrated into the node are not scanned by aging until the forced rescan, and it adds 16 bytes of per-mm state with awkward invalidation semantics. Following his suggestion, the series instead adds a PUD-level Bloom filter — a coarser counterpart of the existing PMD-level filter — so a 1GB subtree that had no young entries for this lruvec last generation is skipped, with no per-mm state and no blind window. I will paste the empty_map patches to this thread for reviewers' reference.