linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm, lru_gen: batch update pages when aging
@ 2023-12-22 10:22 Kairui Song
  2023-12-22 10:22 ` [PATCH 1/3] mm, lru_gen: batch update counters on againg Kairui Song
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Kairui Song @ 2023-12-22 10:22 UTC (permalink / raw)
  To: linux-mm; +Cc: Andrew Morton, Yu Zhao, linux-kernel, Kairui Song

From: Kairui Song <kasong@tencent.com>

Currently when MGLRU ages, it moves the pages one by one and updates mm
counter page by page, which is correct but the overhead can be optimized
by batching these operations.

Batch moving also has a good effect on LRU ordering. Currently when
MGLRU ages, it walks the LRU backward, and the protected pages are moved to
the tail of newer gen one by one, which reverses the order of pages in
LRU. Moving them in batches can help keep their order, only in a small
scope though due to the scan limit of MAX_LRU_BATCH pages.

I noticed a higher performance gain if there are a lot of pages getting
protected, but hard to reproduce, so instead I tested using a simpler
benchmark, memtier, also for a more generic result. The main overhead
here is not aging but the result is also looking good:

Average result of 18 test runs:

Before:           44017.78 Ops/sec
After patch 1-3:  44890.50 Ops/sec (+1.8%)

Kairui Song (3):
  mm, lru_gen: batch update counters on againg
  mm, lru_gen: move pages in bulk when aging
  mm, lru_gen: try to prefetch next page when canning LRU

 mm/vmscan.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 124 insertions(+), 16 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2023-12-27 10:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-22 10:22 [PATCH 0/3] mm, lru_gen: batch update pages when aging Kairui Song
2023-12-22 10:22 ` [PATCH 1/3] mm, lru_gen: batch update counters on againg Kairui Song
2023-12-25  7:28   ` Yu Zhao
2023-12-26 23:43   ` Chris Li
2023-12-27 10:22     ` Kairui Song
2023-12-22 10:22 ` [PATCH 2/3] mm, lru_gen: move pages in bulk when aging Kairui Song
2023-12-23  7:36   ` kernel test robot
2023-12-25  6:58   ` Yu Zhao
2023-12-25  7:01     ` Kairui Song
2023-12-22 10:22 ` [PATCH 3/3] mm, lru_gen: try to prefetch next page when canning LRU Kairui Song
2023-12-25  6:41   ` Yu Zhao
2023-12-25  6:54     ` Yu Zhao
2023-12-25 15:42     ` Matthew Wilcox
2023-12-26 22:12       ` Suren Baghdasaryan

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