Subject: [PATCH v2 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c

From: "David Hildenbrand (Arm)" <[email-masked]>
Date: Mon, 9 Mar 2026 16:18:57 +0100

Looking into vma_(kernel|mmu)_pagesize(), I realized that there is one
scenario where DAX would not do the right thing when the kernel is
not compiled with hugetlb support.

Without hugetlb support, vma_(kernel|mmu)_pagesize() will always return
PAGE_SIZE instead of using the ->pagesize() result provided by dax-device
code.

Fix that by moving vma_kernel_pagesize() to core MM code, where it belongs.
I don't think this is stable material, but am not 100% sure.

Also, move vma_mmu_pagesize() while at it. Remove the unnecessary hugetlb.h
inclusion from KVM code.

Cross-compiled heavily.

v1 -> v2:
* Fixup VMA test in patch #2
* Actually CC all people listed below on all patches.

Cc: Andrew Morton <[email-masked]>
Cc: Madhavan Srinivasan <[email-masked]>
Cc: Nicholas Piggin <[email-masked]>
Cc: Michael Ellerman <[email-masked]>
Cc: "Christophe Leroy (CS GROUP)" <[email-masked]>
Cc: Muchun Song <[email-masked]>
Cc: Oscar Salvador <[email-masked]>
Cc: Lorenzo Stoakes <[email-masked]>
Cc: "Liam R. Howlett" <[email-masked]>
Cc: Vlastimil Babka <[email-masked]>
Cc: Mike Rapoport <[email-masked]>
Cc: Suren Baghdasaryan <[email-masked]>
Cc: Michal Hocko <[email-masked]>
Cc: Jann Horn <[email-masked]>
Cc: Pedro Falcato <[email-masked]>
Cc: Paolo Bonzini <[email-masked]>
Cc: Dan Williams <[email-masked]>

David Hildenbrand (Arm) (4):
  mm: move vma_kernel_pagesize() from hugetlb to mm.h
  mm: move vma_mmu_pagesize() from hugetlb to vma.c
  KVM: remove hugetlb.h inclusion
  KVM: PPC: remove hugetlb.h inclusion

 arch/powerpc/kvm/book3s_hv.c       |  1 -
 include/linux/hugetlb.h            | 14 --------------
 include/linux/mm.h                 | 22 ++++++++++++++++++++++
 mm/hugetlb.c                       | 28 ----------------------------
 mm/vma.c                           | 21 +++++++++++++++++++++
 tools/testing/vma/include/custom.h |  5 +++++
 virt/kvm/kvm_main.c                |  1 -
 7 files changed, 48 insertions(+), 44 deletions(-)

base-commit: f75825cdfc4c5477cffcfd2cafa4e5ce5aa67f13
-- 
2.43.0