Re: [PATCH 1/3] mm: hugetlb_vmemmap: cleanup hugetlb_vmemmap related functions
From: David Hildenbrand
Date: Wed Jun 01 2022 - 06:49:40 EST
>>> #endif
>>> #ifdef CONFIG_CGROUP_HUGETLB
>>> /* cgroup control files */
>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>>> index dd642cfc538b..1f9fbdddc86b 100644
>>> --- a/mm/hugetlb.c
>>> +++ b/mm/hugetlb.c
>>> @@ -1540,7 +1540,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page)
>>> if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>>> return;
>>>
>>> - if (alloc_huge_page_vmemmap(h, page)) {
>>> + if (hugetlb_vmemmap_alloc(h, page)) {
>>> spin_lock_irq(&hugetlb_lock);
>>> /*
>>> * If we cannot allocate vmemmap pages, just refuse to free the
>>> @@ -1617,7 +1617,7 @@ static DECLARE_WORK(free_hpage_work, free_hpage_workfn);
>>>
>>> static inline void flush_free_hpage_work(struct hstate *h)
>>> {
>>> - if (free_vmemmap_pages_per_hpage(h))
>>> + if (hugetlb_optimize_vmemmap_pages(h))
>>
>> It might be reasonable to call that hugetlb_should_optimize_vmemmap()
>> then, letting it return a bool.
>>
>
> How about the name of "hugetlb_vmemmap_optimizable()"? "should" seems to
> tell the user that this hugetlb should be optimized, however, optimization
> also depends on "hugetlb_free_vmemmap=on". "optimizable" seems to be more
> appropriate, right?
No strong opinion. Either is clearer to me compared to what we have
right now :)
--
Thanks,
David / dhildenb