Commit 26299423 authored by Liu Shixin's avatar Liu Shixin
Browse files

mm/shmem: replace HPAGE_PMD_ORDER with PMD_ORDER in shmem_alloc_folio()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAO6NS



--------------------------------

When HugeTLB and THP are all disabled, HPAGE_PMD_ORDER will trigger
build error:

 ./include/linux/huge_mm.h:109:28: note: in expansion of macro ‘BUILD_BUG’
   109 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })

Fix it by replace HPAGE_PMD_ORDER with PMD_ORDER, which is equal when THP
enabled and when THP disabled, it is no really used in shmem_alloc_folio().
So there is no effect when THP disabled.

Fixes: c7fcbe10 ("mm: shmem: Merge shmem_alloc_hugefolio() with shmem_alloc_folio()")
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 9fad184e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1735,7 +1735,7 @@ static struct folio *shmem_alloc_folio(gfp_t gfp, int order,
	struct folio *folio;

	shmem_pseudo_vma_init(&pvma, info, index);
	folio = vma_alloc_folio(gfp, order, &pvma, 0, order == HPAGE_PMD_ORDER);
	folio = vma_alloc_folio(gfp, order, &pvma, 0, order == PMD_ORDER);
	shmem_pseudo_vma_destroy(&pvma);

	return folio;