[RFC PATCH 12/18] mm/thp: pass ptdesc to set_huge_zero_folio function
alexs at kernel.org
alexs at kernel.org
Tue Jul 30 00:27:13 PDT 2024
From: Alex Shi <alexs at kernel.org>
Aim is still replace struct page to ptdesc.
Signed-off-by: Alex Shi <alexs at kernel.org>
Cc: linux-kernel at vger.kernel.org
Cc: linux-mm at kvack.org
Cc: Andrew Morton <akpm at linux-foundation.org>
---
mm/huge_memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index dc323453fa02..1c121ec85447 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1055,7 +1055,7 @@ gfp_t vma_thp_gfp_mask(struct vm_area_struct *vma)
}
/* Caller must hold page table lock. */
-static void set_huge_zero_folio(pgtable_t pgtable, struct mm_struct *mm,
+static void set_huge_zero_folio(struct ptdesc *ptdesc, struct mm_struct *mm,
struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd,
struct folio *zero_folio)
{
@@ -1064,7 +1064,7 @@ static void set_huge_zero_folio(pgtable_t pgtable, struct mm_struct *mm,
return;
entry = mk_pmd(&zero_folio->page, vma->vm_page_prot);
entry = pmd_mkhuge(entry);
- pgtable_trans_huge_deposit(mm, pmd, pgtable);
+ pgtable_trans_huge_deposit(mm, pmd, ptdesc_page(ptdesc));
set_pmd_at(mm, haddr, pmd, entry);
mm_inc_nr_ptes(mm);
}
@@ -1113,7 +1113,7 @@ vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf)
ret = handle_userfault(vmf, VM_UFFD_MISSING);
VM_BUG_ON(ret & VM_FAULT_FALLBACK);
} else {
- set_huge_zero_folio(ptdesc_page(ptdesc), vma->vm_mm, vma,
+ set_huge_zero_folio(ptdesc, vma->vm_mm, vma,
haddr, vmf->pmd, zero_folio);
update_mmu_cache_pmd(vma, vmf->address, vmf->pmd);
spin_unlock(vmf->ptl);
--
2.43.0
More information about the linux-riscv
mailing list