Re: [PATCH v4 4/5] hugetlb: add demote bool to gigantic page routines

From: Mike Kravetz
Date: Fri Oct 22 2021 - 15:06:19 EST


On 10/18/21 12:58 AM, Oscar Salvador wrote:
> On Thu, Oct 07, 2021 at 11:19:17AM -0700, Mike Kravetz wrote:
>> The routines remove_hugetlb_page and destroy_compound_gigantic_page
>> will remove a gigantic page and make the set of base pages ready to be
>> returned to a lower level allocator. In the process of doing this, they
>> make all base pages reference counted.
>>
>> The routine prep_compound_gigantic_page creates a gigantic page from a
>> set of base pages. It assumes that all these base pages are reference
>> counted.
>>
>> During demotion, a gigantic page will be split into huge pages of a
>> smaller size. This logically involves use of the routines,
>> remove_hugetlb_page, and destroy_compound_gigantic_page followed by
>> prep_compound*_page for each smaller huge page.
>>
>> When pages are reference counted (ref count >= 0), additional
>> speculative ref counts could be taken. This could result in errors
>
> It would be great to learn about those cases involving speculative ref counts.
>

How about if this commit message provides links to previous commits
describing these issues? There are pretty extensive descriptions in
those previous commits, so no need to repeat here IMO.

The patch with an updated commit message is below.