Re: [PATCH v2 1/4] mm/hugetlb: Refactor unmap_ref_private() to take folio instead of page

From: Fan Ni
Date: Thu Apr 24 2025 - 21:12:06 EST


On Wed, Apr 23, 2025 at 04:17:25AM +0100, Matthew Wilcox wrote:
>
> With regard to the Subject: line, you're not "refactoring". You're
> passing a folio to the function.

Hi Matthew,

Thanks for the review.

Are you suggesting something like "Passing folio instead of page to unmap_ref_private()"?

We do not change the behavior of the function, but only the interface, it
is kind of "refactoring" to me.

Fan

>
> > @@ -6108,7 +6108,8 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
> > */
> > if (!is_vma_resv_set(iter_vma, HPAGE_RESV_OWNER))
> > unmap_hugepage_range(iter_vma, address,
> > - address + huge_page_size(h), page, 0);
> > + address + huge_page_size(h),
> > + folio_page(folio, 0), 0);
>
> As previously, use &folio->page here.
>
>