From: Kefeng Wang wangkefeng.wang@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IARA8A
--------------------------------
When the hugepage parameter is true in vma_alloc_folio(), it indicates that we only try allocation on preferred node if possible, but it could lead to lots of failures for large folio allocation without commit ddc1a5cbc05d ("mempolicy: alloc_pages_mpol() for NUMA policy without vma"), it has no effect on runtime behavior on mainline, but we're affected, so fix it by setting hugepage to false.
Fixes: ba572beac8be ("mm: thp: support allocation of anonymous multi-size THP") Signed-off-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Liu Shixin liushixin2@huawei.com --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c index 4eea351aaccd..03fa94ae898a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4434,7 +4434,7 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf) gfp = vma_thp_gfp_mask(vma); while (orders) { addr = ALIGN_DOWN(vmf->address, PAGE_SIZE << order); - folio = vma_alloc_folio(gfp, order, vma, addr, true); + folio = vma_alloc_folio(gfp, order, vma, addr, false); if (folio) { if (mem_cgroup_charge(folio, vma->vm_mm, gfp)) { count_mthp_stat(order, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE);