Re: [PATCH 2/3] mm/hugetlb: Refactor unmap_hugepage_range() to take folio instead of page

From: Muchun Song
Date: Thu Apr 17 2025 - 22:52:29 EST




> On Apr 17, 2025, at 23:43, nifan.cxl@xxxxxxxxx wrote:
>
> From: Fan Ni <fan.ni@xxxxxxxxxxx>
>
> The function unmap_hugepage_range() has two kinds of users:
> 1) unmap_ref_private(), which passes in the head page of a folio. Since
> unmap_ref_private() already takes folio and there are no other uses
> of the folio struct in the function, it is natural for
> unmap_hugepage_range() to take folio also.
> 2) All other uses, which pass in NULL pointer.
>
> In both cases, we can pass in folio. Refactor unmap_hugepage_range() to
> take folio.
>
> Signed-off-by: Fan Ni <fan.ni@xxxxxxxxxxx>

Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.