Skip to content

Support Armv8.9/v9.4 FEAT_HAFT

Yicong Yang linux-arm-kernel 4 versions – Applied

Status from this message: Applied to arm64 (for-next/haft), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 10 repliesApplied
  2. v35 patches 10 repliesSuperseded
  3. v22 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches8 repliesSuperseded

Changes in v4 from the cover letter

Address the comments per Catalin. Add tags for Patch 1/5 and 2/5.
- Make HAFT a ARM64_CPUCAP_SYSTEM_FEATURE feature then:
o checking the feature will be more efficient
o avoid race between onlining a non-HAFT CPU when using the HAFT features
- Set table AF for task entries as well
- Set TCR2.HAFT unconditionally

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/5arm64/sysreg: Update ID_AA64MMFR1_EL1 registerarch/arm64/tools/sysreg+4 -00 replies
2/5arm64: setup: name 'tcr2' registerarch/arm64/mm/proc.S+10 -20 replies
3/5arm64: Add support for FEAT_HAFTarch/arm64/Kconfig arch/arm64/include/asm/cpufeature.h arch/arm64/include/asm/pgalloc.h +6 more+62 -127 replies
4/5arm64: Enable ARCH_HAS_NONLEAF_PMD_YOUNGarch/arm64/Kconfig arch/arm64/include/asm/pgtable.h+7 -21 reply
5/5arm64: pgtable: Warn unexpected pmdp_test_and_clear_young()arch/arm64/include/asm/pgtable.h+2 -01 reply

Reviews trailers per patch

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

PatchMark BrownCatalin Marinas
1/5R-b
2/5R-b
3/5
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] Support Armv8.9/v9.4 FEAT_HAFT

From: Yicong Yang <[email protected]>

This series adds basic support for FEAT_HAFT introduced in Armv8.9/v9.4 and enable ARCH_HAS_NONLEAF_PMD_YOUNG. The latter will be used in lru-gen aging. Tested with lru-gen in below steps:
1. Generate a 1GiB workingset by stress-ng --vm 1. Then hang the task to stop accessing the memory. (AF bit won't be updated)
2. try to age the memory by /sys/kernel/debug/lru_gen

Run above steps with LRU_GEN_NONLEAF_YOUNG(0x4) and not respectively (switching by /sys/kernel/mm/lru_gen/enabled). LRU_GEN_NONLEAF_YOUNG will clear and test the PMD AF bit on page walking for aging, otherwise will clear and test the PTE AF bit for aging. In this case LRU_GEN_NONLEAF_YOUNG will improve the efficiency of page scanning since pages won't be accessed and we don't need to scan each PTE. Observed ~40% time saved for 1GiB memory on our emulated platform with LRU_GEN_NONLEAF_YOUNG.

For lru-gen aging:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/mm/multigen_lru.rst?h=v6.11-rc1#n94

Change since v3:
Address the comments per Catalin. Add tags for Patch 1/5 and 2/5.
- Make HAFT a ARM64_CPUCAP_SYSTEM_FEATURE feature then:
o checking the feature will be more efficient
o avoid race between onlining a non-HAFT CPU when using the HAFT features
- Set table AF for task entries as well
- Set TCR2.HAFT unconditionally

Change since v2:
- Address comments per Will and Catalin:
o detect and enable the feature in __cpu_setup()
o allow online the CPU that doesn't have this feature and mismatch with the boot CPU
o only advertise the feature if it's enabled system widely
o set AF bit for kernel page table entries to save later hardware update
o warn unexpected pmdp_test_and_clear_young()
- Update all the new AA64MMFR1_EL1 fields per Mark

Change since v1:
- Address comments from Marc, improve comments/Kconfig, clean code. Thanks for the comments.

Yicong Yang (5):
arm64/sysreg: Update ID_AA64MMFR1_EL1 register
arm64: setup: name 'tcr2' register
arm64: Add support for FEAT_HAFT
arm64: Enable ARCH_HAS_NONLEAF_PMD_YOUNG
arm64: pgtable: Warn unexpected pmdp_test_and_clear_young()

 arch/arm64/Kconfig                     | 16 ++++++++++++++++
 arch/arm64/include/asm/cpufeature.h    |  6 ++++++
 arch/arm64/include/asm/pgalloc.h       | 12 +++++++-----
 arch/arm64/include/asm/pgtable-hwdef.h |  4 ++++
 arch/arm64/include/asm/pgtable.h       | 10 ++++++++--
 arch/arm64/kernel/cpufeature.c         | 15 +++++++++++++++
 arch/arm64/mm/fixmap.c                 |  9 ++++++---
 arch/arm64/mm/mmu.c                    |  8 ++++----
 arch/arm64/mm/proc.S                   | 16 ++++++++++++++--
 arch/arm64/tools/cpucaps               |  1 +
 arch/arm64/tools/sysreg                |  4 ++++
 11 files changed, 85 insertions(+), 16 deletions(-)
Signature · 1 line
2.24.0