Thread (23 messages) 23 messages, 5 authors, 2026-02-26

Re: [PATCH 4/5] mm: support batched checking of the young flag for MGLRU

From: Rik van Riel <riel@surriel.com>
Date: 2026-02-24 22:13:38
Also in: linux-mm, lkml

On Tue, 2026-02-24 at 09:56 +0800, Baolin Wang wrote:
Use the batched helper clear_young_ptes_notify() to check and clear
the
young flag to improve the performance during large folio reclamation
when
MGLRU is enabled.

Meanwhile, we can also support batched checking the young and dirty
flag
when MGLRU walks the mm's pagetable to update the folios' generation
counter. Since MGLRU also checks the PTE dirty bit, use
folio_pte_batch_flags()
with FPB_MERGE_YOUNG_DIRTY set to detect batches of PTEs for a large
folio.

Then we can remove the ptep_clear_young_notify() since it has no
users now.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
I'm not entirely happy with how much code is duplicated
between MGLRU and classic LRU, but merging duplicate
functionality seems like a thing for a separate patch.

This one looks good to me.

Reviewed-by: Rik van Riel <riel@surriel.com>

-- 
All Rights Reversed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help