diff mbox series

[v4,02/13] mm: Change pudp_huge_get_and_clear_full take vm_area_struct as arg

Message ID 20230710160842.56300-3-aneesh.kumar@linux.ibm.com (mailing list archive)
State New
Headers show
Series Add support for DAX vmemmap optimization for ppc64 | expand

Commit Message

Aneesh Kumar K.V July 10, 2023, 4:08 p.m. UTC
We will use this in a later patch to do tlb flush when clearing pud entries
on powerpc. This is similar to commit 93a98695f2f9 ("mm: change
pmdp_huge_get_and_clear_full take vm_area_struct as arg")

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 include/linux/pgtable.h | 4 ++--
 mm/debug_vm_pgtable.c   | 2 +-
 mm/huge_memory.c        | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Christophe Leroy July 10, 2023, 5:17 p.m. UTC | #1
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> We will use this in a later patch to do tlb flush when clearing pud entries
> on powerpc. This is similar to commit 93a98695f2f9 ("mm: change
> pmdp_huge_get_and_clear_full take vm_area_struct as arg")
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   include/linux/pgtable.h | 4 ++--
>   mm/debug_vm_pgtable.c   | 2 +-
>   mm/huge_memory.c        | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> index cf13f8d938a8..6fd9b2831338 100644
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -450,11 +450,11 @@ static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
>   #endif
>   
>   #ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR_FULL
> -static inline pud_t pudp_huge_get_and_clear_full(struct mm_struct *mm,
> +static inline pud_t pudp_huge_get_and_clear_full(struct vm_area_struct *vma,
>   					    unsigned long address, pud_t *pudp,
>   					    int full)
>   {
> -	return pudp_huge_get_and_clear(mm, address, pudp);
> +	return pudp_huge_get_and_clear(vma->vm_mm, address, pudp);
>   }
>   #endif
>   #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index ee119e33fef1..ee2c4c1dcfc8 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -385,7 +385,7 @@ static void __init pud_advanced_tests(struct pgtable_debug_args *args)
>   	WARN_ON(!(pud_write(pud) && pud_dirty(pud)));
>   
>   #ifndef __PAGETABLE_PMD_FOLDED
> -	pudp_huge_get_and_clear_full(args->mm, vaddr, args->pudp, 1);
> +	pudp_huge_get_and_clear_full(args->vma, vaddr, args->pudp, 1);
>   	pud = READ_ONCE(*args->pudp);
>   	WARN_ON(!pud_none(pud));
>   #endif /* __PAGETABLE_PMD_FOLDED */
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index eb3678360b97..ba20cef681a4 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -1981,7 +1981,7 @@ int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma,
>   	if (!ptl)
>   		return 0;
>   
> -	pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm);
> +	pudp_huge_get_and_clear_full(vma, addr, pud, tlb->fullmm);
>   	tlb_remove_pud_tlb_entry(tlb, pud, addr);
>   	if (vma_is_special_huge(vma)) {
>   		spin_unlock(ptl);
diff mbox series

Patch

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index cf13f8d938a8..6fd9b2831338 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -450,11 +450,11 @@  static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
 #endif
 
 #ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR_FULL
-static inline pud_t pudp_huge_get_and_clear_full(struct mm_struct *mm,
+static inline pud_t pudp_huge_get_and_clear_full(struct vm_area_struct *vma,
 					    unsigned long address, pud_t *pudp,
 					    int full)
 {
-	return pudp_huge_get_and_clear(mm, address, pudp);
+	return pudp_huge_get_and_clear(vma->vm_mm, address, pudp);
 }
 #endif
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
index ee119e33fef1..ee2c4c1dcfc8 100644
--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -385,7 +385,7 @@  static void __init pud_advanced_tests(struct pgtable_debug_args *args)
 	WARN_ON(!(pud_write(pud) && pud_dirty(pud)));
 
 #ifndef __PAGETABLE_PMD_FOLDED
-	pudp_huge_get_and_clear_full(args->mm, vaddr, args->pudp, 1);
+	pudp_huge_get_and_clear_full(args->vma, vaddr, args->pudp, 1);
 	pud = READ_ONCE(*args->pudp);
 	WARN_ON(!pud_none(pud));
 #endif /* __PAGETABLE_PMD_FOLDED */
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index eb3678360b97..ba20cef681a4 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1981,7 +1981,7 @@  int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma,
 	if (!ptl)
 		return 0;
 
-	pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm);
+	pudp_huge_get_and_clear_full(vma, addr, pud, tlb->fullmm);
 	tlb_remove_pud_tlb_entry(tlb, pud, addr);
 	if (vma_is_special_huge(vma)) {
 		spin_unlock(ptl);