lkml.org 
[lkml]   [2020]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 10/12] mm/hugetlb: Introduce nr_free_vmemmap_pages in the struct hstate
On Thu, Dec 10, 2020 at 11:55:24AM +0800, Muchun Song wrote:
> +void __init hugetlb_vmemmap_init(struct hstate *h)
> +{
> + unsigned int nr_pages = pages_per_huge_page(h);
> + unsigned int vmemmap_pages;
> +
> + /* We cannot optimize if a "struct page" crosses page boundaries. */
> + if (!is_power_of_2(sizeof(struct page)))
> + return;
> +
> + if (!hugetlb_free_vmemmap_enabled)
> + return;

I think it would make sense to squash the last patch and this one.
As per the last patch, if "struct page" is not power of 2,
early_hugetlb_free_vmemmap_param() does not set
hugetlb_free_vmemmap_enabled, so the "!is_power_of_2" check from above
would become useless here.
We know that in order for hugetlb_free_vmemmap_enabled to become true,
the is_power_of_2 must have succeed early on when calling the early_
function.

--
Oscar Salvador
SUSE L3

\
 
 \ /
  Last update: 2020-12-10 12:44    [W:0.131 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site