From: Wang Wensheng <wangwensheng4@huawei.com> hulk inclusion category: feature category: bugfix bugzilla: NA ---------------------------------------- Alloc buddy pages if no hugetlbfs pages is reserved. Here we don't need to set vm.nr_overcommit_hugepages. Even it is set to non-zero, we just ignore it and allocate hugepage from buddy. Fixes: 00c7c3d64806 ("hugetlb: support auto demote and promote") Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com> --- mm/share_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/share_pool.c b/mm/share_pool.c index e359d188ebba..fb662732f671 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -1528,6 +1528,9 @@ static bool sp_area_alloc_hugepages(struct sp_area *spa, int nid, nodemask_t *no for (i = 0; i < nr_pages; i++) { pages[i] = (struct page *)alloc_hugetlb_folio_nodemask_size(PMD_SIZE, nid, nodemask); + if (!pages[i]) + pages[i] = __alloc_pages(GFP_HIGHUSER_MOVABLE | __GFP_COMP | __GFP_ACCOUNT, + get_order(PMD_SIZE), nid, nodemask); if (!pages[i]) { while (i--) put_page(pages[i]); -- 2.43.0