lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 21/21] mm/hugetlb: Disable freeing vmemmap if struct page size is not power of two
On Fri 20-11-20 14:43:25, Muchun Song wrote:
> We only can free the unused vmemmap to the buddy system when the
> size of struct page is a power of two.

Can we actually have !power_of_2 struct pages?

>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> ---
> mm/hugetlb_vmemmap.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
> index c3b3fc041903..7bb749a3eea2 100644
> --- a/mm/hugetlb_vmemmap.c
> +++ b/mm/hugetlb_vmemmap.c
> @@ -671,7 +671,8 @@ void __init hugetlb_vmemmap_init(struct hstate *h)
> unsigned int order = huge_page_order(h);
> unsigned int vmemmap_pages;
>
> - if (hugetlb_free_vmemmap_disabled) {
> + if (hugetlb_free_vmemmap_disabled ||
> + !is_power_of_2(sizeof(struct page))) {
> pr_info("disable free vmemmap pages for %s\n", h->name);
> return;
> }
> --
> 2.11.0
>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2020-11-20 09:26    [W:0.569 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site