Re: [PATCH 21/46] hugetlb: use struct hugetlb_pte for walk_hugetlb_range

From: Peter Xu
Date: Thu Jan 05 2023 - 17:43:45 EST


On Thu, Jan 05, 2023 at 10:18:19AM +0000, James Houghton wrote:
> -static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
> +static void damon_hugetlb_mkold(struct hugetlb_pte *hpte, pte_t entry,
> + struct mm_struct *mm,
> struct vm_area_struct *vma, unsigned long addr)
> {
> bool referenced = false;
> - pte_t entry = huge_ptep_get(pte);
> + pte_t entry = huge_ptep_get(hpte->ptep);

My compiler throws me:

mm/damon/vaddr.c: In function ‘damon_hugetlb_mkold’:
mm/damon/vaddr.c:338:15: error: ‘entry’ redeclared as different kind of symbol
338 | pte_t entry = huge_ptep_get(hpte->ptep);
| ^~~~~

I guess this line can just be dropped.

> struct folio *folio = pfn_folio(pte_pfn(entry));
>
> folio_get(folio);

--
Peter Xu