summaryrefslogtreecommitdiffstats
path: root/Documentation/mm
diff options
context:
space:
mode:
authorT.J. Alumbaugh <talumbau@google.com>2023-01-18 00:18:22 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-02-02 22:33:26 -0800
commitdb19a43d9b3a8876552f00f656008206ef9a5efa (patch)
tree292b4d2091feacee998b664eeac0e5a3fdfc20be /Documentation/mm
parent7b8144e63d84716f16a1b929e0c7e03ae5c4d5c1 (diff)
downloadlinux-db19a43d9b3a8876552f00f656008206ef9a5efa.tar.gz
linux-db19a43d9b3a8876552f00f656008206ef9a5efa.tar.bz2
linux-db19a43d9b3a8876552f00f656008206ef9a5efa.zip
mm: multi-gen LRU: section for rmap/PT walk feedback
Add a section for lru_gen_look_around() in the code and the design doc. Link: https://lkml.kernel.org/r/20230118001827.1040870-3-talumbau@google.com Signed-off-by: T.J. Alumbaugh <talumbau@google.com> Cc: Yu Zhao <yuzhao@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'Documentation/mm')
-rw-r--r--Documentation/mm/multigen_lru.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/mm/multigen_lru.rst b/Documentation/mm/multigen_lru.rst
index 6e1483e70fdc..bd988a142bc2 100644
--- a/Documentation/mm/multigen_lru.rst
+++ b/Documentation/mm/multigen_lru.rst
@@ -156,6 +156,20 @@ This time-based approach has the following advantages:
and memory sizes.
2. It is more reliable because it is directly wired to the OOM killer.
+Rmap/PT walk feedback
+---------------------
+Searching the rmap for PTEs mapping each page on an LRU list (to test
+and clear the accessed bit) can be expensive because pages from
+different VMAs (PA space) are not cache friendly to the rmap (VA
+space). For workloads mostly using mapped pages, searching the rmap
+can incur the highest CPU cost in the reclaim path.
+
+``lru_gen_look_around()`` exploits spatial locality to reduce the
+trips into the rmap. It scans the adjacent PTEs of a young PTE and
+promotes hot pages. If the scan was done cacheline efficiently, it
+adds the PMD entry pointing to the PTE table to the Bloom filter. This
+forms a feedback loop between the eviction and the aging.
+
Summary
-------
The multi-gen LRU can be disassembled into the following parts: