mm: multi-gen LRU: Have secondary MMUs participate in MM_WALK
Status from this message: [merged mm-hotfixes-stable] mm-multi-gen-lru-use-pteppmdp_clear_young_notify.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm: multi-gen LRU: remove MM_LEAF_OLD and MM_NONLEAF_TOTAL statsinclude/ mm/ | +5 | 2 replies | Applied |
| 2/2 | mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()include/ mm/ mm/ | +55 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] mm: multi-gen LRU: Have secondary MMUs participate in MM_WALK
Today, the MM_WALK capability causes MGLRU to clear the young bit from PMDs and PTEs during the page table walk before eviction, but MGLRU does not call the clear_young() MMU notifier in this case. By not calling this notifier, the MM walk takes less time/CPU, but it causes pages that are accessed mostly through KVM / secondary MMUs to appear younger than they should be.
We do call the clear_young() notifier today, but only when attempting to evict the page, so we end up clearing young/accessed information less frequently for secondary MMUs than for mm PTEs, and therefore they appear younger and are less likely to be evicted. Therefore, memory that is *not* being accessed mostly by KVM will be evicted *more* frequently, worsening performance.
ChromeOS observed a tab-open latency regression when enabling MGLRU with a setup that involved running a VM:
Tab-open latency histogram (ms)
Version p50 mean p95 p99 max
base 1315 1198 2347 3454 10319
mglru 2559 1311 7399 12060 43758
fix 1119 926 2470 4211 6947
This series replaces the final non-selftest patchs from this series[1], which introduced a similar change (and a new MMU notifier) with KVM optimizations. I'll send a separate series (to Sean and Paolo) for the KVM optimizations.
This series also makes proactive reclaim with MGLRU possible for KVM memory. I have verified that this functions correctly with the selftest from [1], but given that that test is a KVM selftest, I'll send it with the rest of the KVM optimizations later. Andrew, let me know if you'd like to take the test now anyway.
[1]: https://lore.kernel.org/linux-mm/[email protected]/
Yu Zhao (2):
mm: multi-gen LRU: remove MM_LEAF_OLD and MM_NONLEAF_TOTAL stats
mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()
include/linux/mmzone.h | 7 ++- mm/rmap.c | 9 ++-- mm/vmscan.c | 105 +++++++++++++++++++++-------------------- 3 files changed, 60 insertions(+), 61 deletions(-)
base-commit: b5d43fad926a3f542cd06f3c9d286f6f489f7129
Signature · 1 line
2.47.0.105.g07ac214952-goog