linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Support Armv8.9/v9.4 FEAT_HAFT
@ 2024-10-22  9:27 Yicong Yang
  2024-10-22  9:27 ` [PATCH v3 1/5] arm64/sysreg: Update ID_AA64MMFR1_EL1 register Yicong Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Yicong Yang @ 2024-10-22  9:27 UTC (permalink / raw)
  To: catalin.marinas, will, maz, mark.rutland, broonie,
	linux-arm-kernel
  Cc: oliver.upton, ryan.roberts, linuxarm, jonathan.cameron,
	shameerali.kolothum.thodi, prime.zeng, xuwei5, wangkefeng.wang,
	yangyicong

From: Yicong Yang <yangyicong@hisilicon.com>

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 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
Link: https://lore.kernel.org/linux-arm-kernel/20240814092333.7727-1-yangyicong@huawei.com/

Change since v1:
- Address comments from Marc, improve comments/Kconfig, clean code. Thanks for
  the comments.
Link: https://lore.kernel.org/linux-arm-kernel/20240802093458.32683-1-yangyicong@huawei.com/


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    | 24 ++++++++++++++++++++++++
 arch/arm64/include/asm/pgalloc.h       |  9 +++++----
 arch/arm64/include/asm/pgtable-hwdef.h |  4 ++++
 arch/arm64/include/asm/pgtable.h       | 16 ++++++++++++++--
 arch/arm64/kernel/cpufeature.c         | 23 +++++++++++++++++++++++
 arch/arm64/mm/fixmap.c                 |  9 ++++++---
 arch/arm64/mm/mmu.c                    |  8 ++++----
 arch/arm64/mm/proc.S                   | 20 +++++++++++++++++---
 arch/arm64/tools/cpucaps               |  1 +
 arch/arm64/tools/sysreg                |  4 ++++
 11 files changed, 118 insertions(+), 16 deletions(-)

-- 
2.24.0



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-10-28 18:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22  9:27 [PATCH v3 0/5] Support Armv8.9/v9.4 FEAT_HAFT Yicong Yang
2024-10-22  9:27 ` [PATCH v3 1/5] arm64/sysreg: Update ID_AA64MMFR1_EL1 register Yicong Yang
2024-10-22 17:05   ` Mark Brown
2024-10-23 10:06     ` Yicong Yang
2024-10-22  9:27 ` [PATCH v3 2/5] arm64: setup: name 'tcr2' register Yicong Yang
2024-10-22 16:54   ` Catalin Marinas
2024-10-23 10:08     ` Yicong Yang
2024-10-22  9:27 ` [PATCH v3 3/5] arm64: Add support for FEAT_HAFT Yicong Yang
2024-10-22 18:30   ` Catalin Marinas
2024-10-23 10:30     ` Yicong Yang
2024-10-23 12:36       ` Catalin Marinas
2024-10-24 14:45         ` Yicong Yang
2024-10-24 15:23           ` Yicong Yang
2024-10-28 18:33           ` Catalin Marinas
2024-10-22  9:27 ` [PATCH v3 4/5] arm64: Enable ARCH_HAS_NONLEAF_PMD_YOUNG Yicong Yang
2024-10-22  9:27 ` [PATCH v3 5/5] arm64: pgtable: Warn unexpected pmdp_test_and_clear_young() Yicong Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).