Re: [PATCH 27/39] mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
From: Claudio Imbrenda
Date: Wed Sep 09 2026 - 07:29:24 EST
On Tue, 08 Sep 2026 21:01:31 +0100
"Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx> wrote:
[please note that I had to prune the CC list quite aggressively because
my SMTP server was not happy]
> The is_vm_hugetlb_page() predicate is badly named - the mapping can span
> more than a page and it is inconsistent with other VMA predicates that
> typically are prefixed by vma_.
>
> Rename to vma_is_hugetlb() for consistency, and while we're here update
> some VM_BUG_ON_VMA() to VM_WARN_ON_ONCE_VMA() as to avoid unnecessary
> oopses.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
for s390:
Acked-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
but please see the comment below
> ---
> arch/arm64/kvm/mmu.c | 4 ++--
> arch/powerpc/mm/book3s64/radix_tlb.c | 6 +++---
> arch/powerpc/mm/nohash/e500_hugetlbpage.c | 2 +-
> arch/powerpc/mm/nohash/tlb.c | 2 +-
> arch/riscv/kvm/mmu.c | 2 +-
> arch/riscv/mm/tlbflush.c | 2 +-
> arch/s390/mm/gmap_helpers.c | 6 +++---
> arch/sparc/mm/init_64.c | 2 +-
> drivers/gpu/drm/drm_gpusvm.c | 2 +-
> fs/coredump.c | 2 +-
> fs/hugetlbfs/inode.c | 2 +-
> fs/proc/task_mmu.c | 8 ++++----
> include/asm-generic/tlb.h | 2 +-
> include/linux/hugetlb.h | 4 ++--
> include/linux/mm.h | 19 ++++++++++++++++---
> include/linux/rmap.h | 2 +-
> kernel/events/core.c | 2 +-
> kernel/sched/fair.c | 2 +-
> mm/gup.c | 4 ++--
> mm/huge_memory.c | 2 +-
> mm/hugetlb.c | 14 +++++++-------
> mm/internal.h | 2 +-
> mm/madvise.c | 4 ++--
> mm/memory.c | 12 ++++++------
> mm/mempolicy.c | 2 +-
> mm/migrate_device.c | 2 +-
> mm/mmap.c | 2 +-
> mm/mmu_gather.c | 2 +-
> mm/mprotect.c | 2 +-
> mm/mremap.c | 6 +++---
> mm/page_vma_mapped.c | 4 ++--
> mm/pagewalk.c | 2 +-
> mm/swapfile.c | 2 +-
> mm/userfaultfd.c | 26 +++++++++++++-------------
> mm/vma.c | 8 ++++----
> mm/vmscan.c | 2 +-
> tools/testing/vma/include/stubs.h | 2 +-
> 37 files changed, 92 insertions(+), 79 deletions(-)
[...]
> diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c
> index ff63ffb1dbd2..3f6783b93e67 100644
> --- a/arch/s390/mm/gmap_helpers.c
> +++ b/arch/s390/mm/gmap_helpers.c
> @@ -102,7 +102,7 @@ __context_unsafe(/* pte_unmap_unlock() not instrumented */)
>
> /* Find the vm address for the guest address */
> vma = vma_lookup(mm, vmaddr);
> - if (!vma || is_vm_hugetlb_page(vma))
> + if (!vma || vma_is_hugetlb(vma))
> return;
>
> /* Get pointer to the page table entry */
> @@ -139,7 +139,7 @@ void gmap_helper_discard(struct mm_struct *mm, unsigned long vmaddr, unsigned lo
> vma = find_vma_intersection(mm, vmaddr, end);
> if (!vma)
> return;
> - if (!is_vm_hugetlb_page(vma))
> + if (!vma_is_hugetlb(vma))
> zap_vma_range(vma, vmaddr, min(end, vma->vm_end) - vmaddr);
> vmaddr = vma->vm_end;
> }
> @@ -247,7 +247,7 @@ static int __gmap_helper_unshare_zeropages(struct mm_struct *mm)
> * proof to catch unexpected zeropages in other mappings and
> * fail.
> */
> - if ((vma->vm_flags & VM_PFNMAP) || is_vm_hugetlb_page(vma))
> + if ((vma->vm_flags & VM_PFNMAP) || vma_is_hugetlb(vma))
Would it be possible to replace this ^ with !vma_can_gup() ?
(obviously not in this patch, since vma_can_gup() is only introduced at
the end of the series)
> continue;
> addr = vma->vm_start;
>
[...]