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: c7fcbe104175 ("mm: shmem: Merge shmem_alloc_hugefolio() with shmem_alloc_folio()") Signed-off-by: Liu Shixin liushixin2@huawei.com --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c index d7a970f7accb7..7b3fa6b9aa289 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -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;