lkml.org 
[lkml]   [2021]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v23 6/9] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page
On Mon, May 10, 2021 at 11:00:24AM +0800, Muchun Song wrote:
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1376,6 +1376,39 @@ static void remove_hugetlb_page(struct hstate *h, struct page *page,
> h->nr_huge_pages_node[nid]--;
> }
>
> +static void add_hugetlb_page(struct hstate *h, struct page *page,
> + bool adjust_surplus)
> +{
> + int zeroed;
> + int nid = page_to_nid(page);
> +
> + VM_BUG_ON_PAGE(!HPageVmemmapOptimized(page), page);
> +
> + lockdep_assert_held(&hugetlb_lock);
> +
> + INIT_LIST_HEAD(&page->lru);
> + h->nr_huge_pages++;
> + h->nr_huge_pages_node[nid]++;
> +
> + if (adjust_surplus) {
> + h->surplus_huge_pages++;
> + h->surplus_huge_pages_node[nid]++;
> + }
> +
> + set_compound_page_dtor(page, HUGETLB_PAGE_DTOR);
> + set_page_private(page, 0);

I think this has already been discused, so sorry about this.

The only reason to need the set_page_private() is because of the dissolving
function right? add_hugetlb_page() can only get reached via free_huge_page(),
or dissolve_free_huge_page, and while the former clears the flags, the latter
it does not.

I think this function would benefit from some renaming. add_hugetlb_page() gives
me no hint of what is this about, although I can figure it out reading the code.

With that: Reviewed-by: Oscar Salvador <osalvador@suse.de>




--
Oscar Salvador
SUSE L3

\
 
 \ /
  Last update: 2021-05-10 13:31    [W:2.359 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site