Re: [PATCH 9/9] mm/hugetlb: convert move_hugetlb_state() to folios

From: Mike Kravetz
Date: Mon Oct 31 2022 - 16:57:51 EST


On 10/13/22 20:13, Sidhartha Kumar wrote:
> Clean up unmap_and_move_huge_page() by converting move_hugetlb_state() to
> take in folios.
>
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
> ---
> include/linux/hugetlb.h | 6 +++---
> mm/hugetlb.c | 22 ++++++++++++----------
> mm/migrate.c | 2 +-
> 3 files changed, 16 insertions(+), 14 deletions(-)

Looks fine with one comment,

Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>

> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1328,7 +1328,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
> put_anon_vma(anon_vma);
>

It looks like there is a hugetlb_page_subpool(hpage) in this routine
before here that could perhaps be changed to?

hugetlb_folio_subpool(src)

--
Mike Kravetz

> if (rc == MIGRATEPAGE_SUCCESS) {
> - move_hugetlb_state(hpage, new_hpage, reason);
> + move_hugetlb_state(src, dst, reason);
> put_new_page = NULL;
> }
>
> --
> 2.31.1
>