Subject: [PATCH 0/5] support batched checking of the young flag for MGLRU

From: Baolin Wang <[email-masked]>
Date: Tue, 24 Feb 2026 09:56:03 +0800

This is a follow-up to the previous work [1], to support batched checking
of the young flag for MGLRU.

Similarly, batched checking of young flag for large folios can improve
performance during large-folio reclamation when MGLRU is enabled. I
observed noticeable performance improvements (see patch 5) on an Arm64
machine that supports contiguous PTEs. All mm-selftests are passed.

Patch 1,2: cleanup patches.
Patch 3: add a new generic batched PTE helper: test_and_clear_young_ptes().
Patch 4: support batched young flag checking for MGLRU.
Patch 5: implement the Arm64 arch-specific test_and_clear_young_ptes().

[1] https://lore.kernel.org/all/[email-masked]/

Baolin Wang (5):
  mm: use inline helper functions instead of ugly macros
  mm: rmap: add a ZONE_DEVICE folio warning in folio_referenced()
  mm: add a batched helper to clear the young flag for large folios
  mm: support batched checking of the young flag for MGLRU
  arm64: mm: implement the architecture-specific
    test_and_clear_young_ptes()

 arch/arm64/include/asm/pgtable.h | 18 +++++++----
 include/linux/mmu_notifier.h     | 54 --------------------------------
 include/linux/mmzone.h           |  5 +--
 include/linux/pgtable.h          | 36 +++++++++++++++++++++
 mm/internal.h                    | 54 ++++++++++++++++++++++++++++++++
 mm/rmap.c                        | 31 +++++++++---------
 mm/vmscan.c                      | 37 +++++++++++++++++-----
 7 files changed, 151 insertions(+), 84 deletions(-)

-- 
2.47.3