Skip to content

support batched checking of the young flag for MGLRU

Baolin Wang linux-arm-kernel linux-mm lkml 3 versions – Applied

Status from this message: [merged mm-stable] arm64-mm-implement-the-architecture-specific-test_and_clear_young_ptes.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 8 repliesApplied 6/6
  2. v26 patches 7 repliesSuperseded
  3. v15 patches 18 repliesSuperseded

Changes in v3 from the cover letter

v2: https://lore.kernel.org/all/[email protected]/
- Update the commit message of patch 5 (per David).
- Fix some coding style issues (per David).
- Remove 'cur_pte' variable in lru_gen_look_around() (per David).
- Move 'ptes += nr;' to the suitable place in folio_referenced_one() (per David).
- Add acked tag from David. Thanks.

Patches in v3 All 6 applied

#Subject and filesSizeRepliesApplied
1/6mm: use inline helper functions instead of ugly macrosinclude/linux/mmu_notifier.h mm/internal.h+52 -540 repliesApplied
2/6mm: rename ptep/pmdp_clear_young_notify() to ptep/pmdp_test_and_clear_young_notify()mm/internal.h mm/vmscan.c+8 -80 repliesApplied
3/6mm: rmap: add a ZONE_DEVICE folio warning in folio_referenced()mm/rmap.c+1 -00 repliesApplied
4/6mm: add a batched helper to clear the young flag for large foliosinclude/linux/pgtable.h mm/internal.h+48 -50 repliesApplied
5/6mm: support batched checking of the young flag for MGLRUinclude/linux/mmzone.h mm/internal.h mm/rmap.c +1 more+49 -331 replyApplied
6/6arm64: mm: implement the architecture-specific test_and_clear_young_ptes()arch/arm64/include/asm/pgtable.h+12 -65 repliesApplied

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchRik van RielBarry SongDavid Hildenbrand (Arm)Alistair Popple
1/6R-b R-b A-b
2/6A-b
3/6A-b R-b
4/6
5/6R-b A-b
6/6R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/6] support batched checking of the young flag for MGLRU

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/[email protected]/

Changes from v2:
v2: https://lore.kernel.org/all/[email protected]/
- Update the commit message of patch 5 (per David).
- Fix some coding style issues (per David).
- Remove 'cur_pte' variable in lru_gen_look_around() (per David).
- Move 'ptes += nr;' to the suitable place in folio_referenced_one() (per David).
- Add acked tag from David. Thanks.

Changes from v1:
v1: https://lore.kernel.org/all/[email protected]/
- 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          | 37 ++++++++++++++++++++++
 mm/internal.h                    | 52 ++++++++++++++++++++++++++++++
 mm/rmap.c                        | 29 ++++++++---------
 mm/vmscan.c                      | 45 +++++++++++++++++++-------
 7 files changed, 152 insertions(+), 88 deletions(-)
Signature · 1 line
2.47.3