Re: [PATCH mm-unstable v5 05/10] mm/hugetlb: convert update_and_free_page() to folios
From: Mike Kravetz
Date: Tue Dec 06 2022 - 21:02:53 EST
On 11/29/22 14:50, Sidhartha Kumar wrote:
> Make more progress on converting the free_huge_page() destructor to
> operate on folios by converting update_and_free_page() to folios.
>
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
> ---
> mm/hugetlb.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 90ba01a76f87..83777d1ccbf3 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
<snip>
Minor nit, not worth fixing now. But, we should cleanup sometime. Comments
below still refer to pages when we are operating on folios.
Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>
--
Mike Kravetz
> @@ -2818,7 +2820,7 @@ static int alloc_and_dissolve_huge_page(struct hstate *h, struct page *old_page,
> * Pages have been replaced, we can safely free the old one.
> */
> spin_unlock_irq(&hugetlb_lock);
> - update_and_free_page(h, old_page, false);
> + update_and_free_hugetlb_folio(h, old_folio, false);
> }
>
> return ret;
> @@ -2827,7 +2829,7 @@ static int alloc_and_dissolve_huge_page(struct hstate *h, struct page *old_page,
> spin_unlock_irq(&hugetlb_lock);
> /* Page has a zero ref count, but needs a ref to be freed */
> folio_ref_unfreeze(new_folio, 1);
> - update_and_free_page(h, new_page, false);
> + update_and_free_hugetlb_folio(h, new_folio, false);
>
> return ret;
> }
> --
> 2.38.1
>