public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c
@ 2026-03-09 15:18 David Hildenbrand (Arm)
  2026-03-09 15:18 ` [PATCH v2 1/4] mm: move vma_kernel_pagesize() from hugetlb to mm.h David Hildenbrand (Arm)
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: David Hildenbrand (Arm) @ 2026-03-09 15:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linuxppc-dev, kvm, David Hildenbrand (Arm),
	Andrew Morton, Madhavan Srinivasan, Nicholas Piggin,
	Michael Ellerman, Christophe Leroy (CS GROUP), Muchun Song,
	Oscar Salvador, Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Jann Horn,
	Pedro Falcato, Paolo Bonzini, Dan Williams

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 <akpm@linux-foundation.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-11  3:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 15:18 [PATCH v2 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c David Hildenbrand (Arm)
2026-03-09 15:18 ` [PATCH v2 1/4] mm: move vma_kernel_pagesize() from hugetlb to mm.h David Hildenbrand (Arm)
2026-03-09 15:18 ` [PATCH v2 2/4] mm: move vma_mmu_pagesize() from hugetlb to vma.c David Hildenbrand (Arm)
2026-03-09 15:19 ` [PATCH v2 3/4] KVM: remove hugetlb.h inclusion David Hildenbrand (Arm)
2026-03-09 15:19 ` [PATCH v2 4/4] KVM: PPC: " David Hildenbrand (Arm)
2026-03-11  3:36   ` Ritesh Harjani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox