Commit 7157f49f authored by Kefeng Wang's avatar Kefeng Wang Committed by Liu Shixin
Browse files

mm: set hugepage to false when anon mthp allocation

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: ba572bea ("mm: thp: support allocation of anonymous multi-size THP")
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 7ab021d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);