mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte()
Subsystems (3)
PATCH v2 1/1 mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte()
Since the following commit arch_make_huge_pte() should be used directly in generic memory subsystem as a platform provided page table helper, instead of pte_mkhuge(). Change hugetlb_basic_tests() to call arch_make_huge_pte() directly, and update its relevant documentation entry as required.
'commit 16785bd77431 ("mm: merge pte_mkhuge() call into arch_make_huge_pte()")'
---
This applies on latest mainline.
Changes in V2:
- Send PMD_SHIFT and VM_ACCESS_FLAGS as arguments for arch_make_huge_pte()
Changes in V1:
https://lore.kernel.org/all/[email protected]/
Documentation/mm/arch_pgtable_helpers.rst | 2 +- mm/debug_vm_pgtable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/mm/arch_pgtable_helpers.rst +1 -1
@@ -214,7 +214,7 @@ HugeTLB Page Table Helpers +---------------------------+--------------------------------------------------+ | pte_huge | Tests a HugeTLB | +---------------------------+--------------------------------------------------+ -| pte_mkhuge | Creates a HugeTLB | +| arch_make_huge_pte | Creates a HugeTLB | +---------------------------+--------------------------------------------------+ | huge_pte_dirty | Tests a dirty HugeTLB | +---------------------------+--------------------------------------------------+
mm/debug_vm_pgtable.c +1 -1
@@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args)#ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB pte =pfn_pte (args->fixed_pmd_pfn, args->page_prot); -WARN_ON (!pte_huge (pte_mkhuge (pte))); +WARN_ON (!pte_huge (arch_make_huge_pte (pte,PMD_SHIFT ,VM_ACCESS_FLAGS ))); #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ }#else /* !CONFIG_HUGETLB_PAGE */
Signature · 1 line
2.30.2
Quoted 49 lines · Anshuman Khandual
Since the following commit
arch_make_huge_pte()should be used directly in generic memory subsystem as a platform provided page table helper, instead ofpte_mkhuge(). Changehugetlb_basic_tests()to callarch_make_huge_pte()directly, and update its relevant documentation entry as required.'commit
16785bd77431("mm: mergepte_mkhuge()call intoarch_make_huge_pte()")'Cc Jonathan Corbet <[email protected]>Cc Andrew Morton <[email protected]>Cc "Mike Rapoport (IBM)" <[email protected]>Reported-by Christophe Leroy <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
This applies on latest mainline.Changes in V2:
- Send
PMD_SHIFTandVM_ACCESS_FLAGSas arguments forarch_make_huge_pte()Changes in V1:
https://lore.kernel.org/all/[email protected]/
Documentation/mm/arch_pgtable_helpers.rst | 2 +- mm/debug_vm_pgtable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Documentation/mm/arch_pgtable_helpers.rst +1
-1@@ -214,7 +214,7 @@ HugeTLB Page Table Helpers +---------------------------+--------------------------------------------------+ | pte_huge | Tests a HugeTLB | +---------------------------+--------------------------------------------------+ -| pte_mkhuge | Creates a HugeTLB | +| arch_make_huge_pte | Creates a HugeTLB | +---------------------------+--------------------------------------------------+ | huge_pte_dirty | Tests a dirty HugeTLB | +---------------------------+--------------------------------------------------+mm/debug_vm_pgtable.c +0
-0
mm/debug_vm_pgtable.c static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) · line 940
Quoted 8 lines
mm/debug_vm_pgtable.c +1
-1@@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args)#ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB pte =pfn_pte (args->fixed_pmd_pfn, args->page_prot); -WARN_ON (!pte_huge (pte_mkhuge (pte))); +WARN_ON (!pte_huge (arch_make_huge_pte (pte,PMD_SHIFT ,VM_ACCESS_FLAGS ))); #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ }#else /* !CONFIG_HUGETLB_PAGE */
IMHO, it's a bit weird that we are starting to call these things "arch_*". PTE operations like these are already mostly arch-specific helpers with custom implementations (and some generic ones in asm-generic as a fallback).
So this one certainly sticks out now ... anyhow, change itself LGTM ...
Signature · 3 lines
Thanks, David / dhildenb
Mike Rapoport
reviewerQuoted 53 lines · David Hildenbrand
Quoted 52 lines · Anshuman Khandual
Since the following commit
arch_make_huge_pte()should be used directly in generic memory subsystem as a platform provided page table helper, instead ofpte_mkhuge(). Changehugetlb_basic_tests()to callarch_make_huge_pte()directly, and update its relevant documentation entry as required.'commit
16785bd77431("mm: mergepte_mkhuge()call intoarch_make_huge_pte()")'Cc Jonathan Corbet <[email protected]>Cc Andrew Morton <[email protected]>Cc "Mike Rapoport (IBM)" <[email protected]>Reported-by Christophe Leroy <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
This applies on latest mainline.Changes in V2:
- Send
PMD_SHIFTandVM_ACCESS_FLAGSas arguments forarch_make_huge_pte()Changes in V1:https://lore.kernel.org/all/[email protected]/
Documentation/mm/arch_pgtable_helpers.rst | 2 +- mm/debug_vm_pgtable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Documentation/mm/arch_pgtable_helpers.rst +1
-1@@ -214,7 +214,7 @@ HugeTLB Page Table Helpers +---------------------------+--------------------------------------------------+ | pte_huge | Tests a HugeTLB | +---------------------------+--------------------------------------------------+ -| pte_mkhuge | Creates a HugeTLB | +| arch_make_huge_pte | Creates a HugeTLB | +---------------------------+--------------------------------------------------+ | huge_pte_dirty | Tests a dirty HugeTLB | +---------------------------+--------------------------------------------------+mm/debug_vm_pgtable.c +1
-1@@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args)#ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB pte =pfn_pte (args->fixed_pmd_pfn, args->page_prot); -WARN_ON (!pte_huge (pte_mkhuge (pte))); +WARN_ON (!pte_huge (arch_make_huge_pte (pte,PMD_SHIFT ,VM_ACCESS_FLAGS )));
Quoted 8 lines
mm/debug_vm_pgtable.c static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) · line 940
Quoted 3 lines
mm/debug_vm_pgtable.c +0
-0#endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ }#else /* !CONFIG_HUGETLB_PAGE */ IMHO, it's a bit weird that we are starting to call these things "arch_*". PTE operations like these are already mostly arch-specific helpers with custom implementations (and some generic ones in asm-generic as a fallback).
Yeah, probably a better name for arch_make_huge_pte() would have been pte_make_huge()
Quoted 7 lines
So this one certainly sticks out now ... anyhow, change itself LGTM ...
Signature · 3 lines
Thanks, David / dhildenb
Signature · 2 lines
Sincerely yours, Mike.