Re: [External] [PATCH 5/8] hugetlb: call update_and_free_page without hugetlb_lock

From: Mike Kravetz
Date: Sun Mar 28 2021 - 17:42:45 EST


On 3/26/21 11:54 PM, Muchun Song wrote:
> On Thu, Mar 25, 2021 at 8:29 AM Mike Kravetz <mike.kravetz@xxxxxxxxxx> wrote:
>>
>> With the introduction of remove_hugetlb_page(), there is no need for
>> update_and_free_page to hold the hugetlb lock. Change all callers to
>> drop the lock before calling.
>>
>> With additional code modifications, this will allow loops which decrease
>> the huge page pool to drop the hugetlb_lock with each page to reduce
>> long hold times.
>>
>> The ugly unlock/lock cycle in free_pool_huge_page will be removed in
>> a subsequent patch which restructures free_pool_huge_page.
>>
>> Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>
>
> Reviewed-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
>
> Some nits below.

Thanks Muchun,

I agree with all your suggestions below, and will include modifications
in the next version.
--
Mike Kravetz