[PATCH v2 0/6] support batched checking of the young flag for MGLRU
From: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: 2026-02-27 09:44:53
Also in:
linux-mm, lkml
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 - 3: cleanup patches. Patch 4: add a new generic batched PTE helper: test_and_clear_young_ptes(). Patch 5: support batched young flag checking for MGLRU. Patch 6: implement the Arm64 arch-specific test_and_clear_young_ptes(). [1] https://lore.kernel.org/all/cover.1770645603.git.baolin.wang@linux.alibaba.com/ (local) Changes from v1: v1: https://lore.kernel.org/all/cover.1771897150.git.baolin.wang@linux.alibaba.com/ (local) - Update some commit message (per David). - Fix some coding style issues (per David). - Use VM_WARN_ON_ONCE_FOLIO() instead of VM_WARN_ON_FOLIO() (per Rik). - Define a generic ptep_test_and_clear_young_notify() (per David). - Remove redundant 'nr > 1' check in folio_referenced_one() (per David). - Rename some variables' to make code more clear (per David). - Add a new patch to rename some functions (per David). - Update the young counters with the batched count for MGLRU. - Collect reviewed tags from Rik, Barry, Alistair and David. Thanks. Baolin Wang (6): mm: use inline helper functions instead of ugly macros mm: rename ptep/pmdp_clear_young_notify() to ptep/pmdp_test_and_clear_young_notify() 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 | 38 ++++++++++++++++++++++ mm/internal.h | 52 ++++++++++++++++++++++++++++++ mm/rmap.c | 29 ++++++++--------- mm/vmscan.c | 46 ++++++++++++++++++++------- 7 files changed, 154 insertions(+), 88 deletions(-) -- 2.47.3