]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: add lazyfree folio to lru tail
authorgaoxu <gaoxu2@honor.com>
Fri, 16 Aug 2024 07:48:01 +0000 (07:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:28 +0000 (17:53 -0700)
commitccbb07b2a3a768ad2bab9852731dadca5ac0457b
treee6568a72bc55025d97c1af070f32696728815315
parent02356fb808cf4d3786f69db094e4f6b4e8b368e7
mm: add lazyfree folio to lru tail

Replace lruvec_add_folio with lruvec_add_folio_tail in the lru_lazyfree_fn:

1. The lazy-free folio is added to the LRU_INACTIVE_FILE list.  If
   it's moved to the LRU tail, it allows for faster release lazy-free
   folio and reduces the impact on file refault.

2. When mglru is enabled, the lazy-free folio is reclaimabled and
   should be added using lru_gen_add_folio(lruvec, folio, true) instead of
   lru_gen_add_folio(lruvec, folio, false) for adding to gen.

With the change in place, workingset_refault_file is reduced by 33% in the
continuous startup testing of the applications in the Android system.

Link: https://lkml.kernel.org/r/f29f64e29c08427b95e3df30a5770056@honor.com
Signed-off-by: gao xu <gaoxu2@hihonor.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap.c