Skip to contentSkip to conversation

mm-mglru-add-config_arch_has_hw_pte_young.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 5, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/mglru: add CONFIG_ARCH_HAS_HW_PTE_YOUNG
has been removed from the -mm tree. Its filename was
mm-mglru-add-config_arch_has_hw_pte_young.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kinsey Ho <[email protected]>
Subject: mm/mglru: add CONFIG_ARCH_HAS_HW_PTE_YOUNG
Date: Wed, 27 Dec 2023 14:12:01 +0000

Patch series "mm/mglru: Kconfig cleanup", v4.

This series is the result of the following discussion:
https://lore.kernel.org/[email protected]/

It mainly avoids building the code that walks page tables on CPUs that use it, i.e., those don't support hardware accessed bit. Specifically, it introduces a new Kconfig to guard some of functions added by commit bd74fdaea146 ("mm: multi-gen LRU: support page table walks") on CPUs like POWER9, on which the series was tested.

This patch (of 5):

Some architectures are able to set the accessed bit in PTEs when PTEs are used as part of linear address translations.

Add CONFIG_ARCH_HAS_HW_PTE_YOUNG for such architectures to be able to override arch_has_hw_pte_young().

---

 arch/Kconfig                   |    8 ++++++++
 arch/arm64/Kconfig             |    1 +
 arch/x86/Kconfig               |    1 +
 arch/x86/include/asm/pgtable.h |    6 ------
 include/linux/pgtable.h        |    2 +-
 5 files changed, 11 insertions(+), 7 deletions(-)
arch/arm64/Kconfig renamed from arch/arm64/Kconfig~mm-mglru-add-config_arch_has_hw_pte_young +1 -0
@@ -36,6 +36,7 @@ config ARM64
 	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
 	select ARCH_HAS_PTE_DEVMAP
 	select ARCH_HAS_PTE_SPECIAL
+	select ARCH_HAS_HW_PTE_YOUNG
 	select ARCH_HAS_SETUP_DMA_OPS
 	select ARCH_HAS_SET_DIRECT_MAP
 	select ARCH_HAS_SET_MEMORY
arch/Kconfig renamed from arch/Kconfig~mm-mglru-add-config_arch_has_hw_pte_young +8 -0
@@ -1470,6 +1470,14 @@ config DYNAMIC_SIGFRAME
 config HAVE_ARCH_NODE_DEV_GROUP
 	bool
 
+config ARCH_HAS_HW_PTE_YOUNG
+	bool
+	help
+	  Architectures that select this option are capable of setting the
+	  accessed bit in PTE entries when using them as part of linear address
+	  translations. Architectures that require runtime check should select
+	  this option and override arch_has_hw_pte_young().
+
 config ARCH_HAS_NONLEAF_PMD_YOUNG
 	bool
 	help
arch/x86/include/asm/pgtable.h renamed from arch/x86/include/asm/pgtable.h~mm-mglru-add-config_arch_has_hw_pte_young +0 -6
@@ -1679,12 +1679,6 @@ static inline bool arch_has_pfn_modify_c
 	return boot_cpu_has_bug(X86_BUG_L1TF);
 }
 
-#define arch_has_hw_pte_young arch_has_hw_pte_young
-static inline bool arch_has_hw_pte_young(void)
-{
-	return true;
-}
-
 #define arch_check_zapped_pte arch_check_zapped_pte
 void arch_check_zapped_pte(struct vm_area_struct *vma, pte_t pte);
 
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-mglru-add-config_arch_has_hw_pte_young +1 -0
@@ -88,6 +88,7 @@ config X86
 	select ARCH_HAS_PMEM_API		if X86_64
 	select ARCH_HAS_PTE_DEVMAP		if X86_64
 	select ARCH_HAS_PTE_SPECIAL
+	select ARCH_HAS_HW_PTE_YOUNG
 	select ARCH_HAS_NONLEAF_PMD_YOUNG	if PGTABLE_LEVELS > 2
 	select ARCH_HAS_UACCESS_FLUSHCACHE	if X86_64
 	select ARCH_HAS_COPY_MC			if X86_64
include/linux/pgtable.h renamed from include/linux/pgtable.h~mm-mglru-add-config_arch_has_hw_pte_young +1 -1
@@ -375,7 +375,7 @@ static inline bool arch_has_hw_nonleaf_p
  */
 static inline bool arch_has_hw_pte_young(void)
 {
-	return false;
+	return IS_ENABLED(CONFIG_ARCH_HAS_HW_PTE_YOUNG);
 }
 #endif
 

_

Patches currently in -mm which might be from [email protected] are