* + mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch added to mm-unstable branch
@ 2026-09-17 21:25 Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-09-17 21:25 UTC (permalink / raw)
To: mm-commits, ljs, akpm
The patch titled
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
has been added to the -mm mm-unstable branch. Its filename is
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
Date: Thu, 17 Sep 2026 17:22:37 +0100
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.
Link: https://lore.kernel.org/20260917-b4-mmap-prepare-vma-flag-sanify-v3-28-4583d8a23bca@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Anup Patel <anup@brainfault.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Barry Song <baohua@kernel.org>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Chris Li <chrisl@kernel.org>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Dave Airlie <airlied@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Emil Tsalapatis <emil@etsalapatis.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: Harry Yoo <harry@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Bottomley <james.bottomley@HansenPartnership.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jaya Kumar <jayalk@intworks.biz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Marc Rutland <mark.rutland@arm.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Namhyung kim <namhyung@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Takashi Iwai (SUSE) <tiwai@suse.de>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thomas Zimemrmann <tzimmermann@suse.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Zi Yan <ziy@nvidia.com>
---
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(-)
--- a/arch/arm64/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/arm64/kvm/mmu.c
@@ -1463,13 +1463,13 @@ static int get_vma_page_shift(struct vm_
{
unsigned long pa;
- if (is_vm_hugetlb_page(vma) && !(vma->vm_flags & VM_PFNMAP))
+ if (vma_is_hugetlb(vma) && !(vma->vm_flags & VM_PFNMAP))
return huge_page_shift(hstate_vma(vma));
if (!(vma->vm_flags & VM_PFNMAP))
return PAGE_SHIFT;
- VM_BUG_ON(is_vm_hugetlb_page(vma));
+ VM_BUG_ON(vma_is_hugetlb(vma));
pa = (vma->vm_pgoff << PAGE_SHIFT) + (hva - vma->vm_start);
--- a/arch/powerpc/mm/book3s64/radix_tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -627,7 +627,7 @@ void radix__local_flush_tlb_page(struct
{
#ifdef CONFIG_HUGETLB_PAGE
/* need the return fix for nohash.c */
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__local_flush_hugetlb_page(vma, vmaddr);
#endif
radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -945,7 +945,7 @@ void radix__flush_tlb_page_psize(struct
void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_page(vma, vmaddr);
#endif
radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -1113,7 +1113,7 @@ void radix__flush_tlb_range(struct vm_ar
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_tlb_range(vma, start, end);
#endif
--- a/arch/powerpc/mm/nohash/e500_hugetlbpage.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/e500_hugetlbpage.c
@@ -180,7 +180,7 @@ book3e_hugetlb_preload(struct vm_area_st
*/
void __update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
book3e_hugetlb_preload(vma, address, *ptep);
}
--- a/arch/powerpc/mm/nohash/tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/tlb.c
@@ -278,7 +278,7 @@ void __flush_tlb_page(struct mm_struct *
void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (vma && is_vm_hugetlb_page(vma))
+ if (vma && vma_is_hugetlb(vma))
flush_hugetlb_page(vma, vmaddr);
#endif
--- a/arch/riscv/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/kvm/mmu.c
@@ -664,7 +664,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *v
return -EFAULT;
}
- is_hugetlb = is_vm_hugetlb_page(vma);
+ is_hugetlb = vma_is_hugetlb(vma);
if (is_hugetlb)
vma_pageshift = huge_page_shift(hstate_vma(vma));
else
--- a/arch/riscv/mm/tlbflush.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/mm/tlbflush.c
@@ -149,7 +149,7 @@ void flush_tlb_range(struct vm_area_stru
{
unsigned long stride_size;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
stride_size = PAGE_SIZE;
} else {
stride_size = huge_page_size(hstate_vma(vma));
--- a/arch/s390/mm/gmap_helpers.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/s390/mm/gmap_helpers.c
@@ -102,7 +102,7 @@ __context_unsafe(/* pte_unmap_unlock() n
/* 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_struc
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_zeropag
* 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))
continue;
addr = vma->vm_start;
--- a/arch/sparc/mm/init_64.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/sparc/mm/init_64.c
@@ -413,7 +413,7 @@ void update_mmu_cache_range(struct vm_fa
if (mm->context.hugetlb_pte_count || mm->context.thp_pte_count) {
unsigned long hugepage_size = PAGE_SIZE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugepage_size = huge_page_size(hstate_vma(vma));
if (hugepage_size >= PUD_SIZE) {
--- a/drivers/gpu/drm/drm_gpusvm.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/drivers/gpu/drm/drm_gpusvm.c
@@ -1142,7 +1142,7 @@ drm_gpusvm_range_find_or_insert(struct d
* have to change.
*/
migrate_devmem = ctx->devmem_possible &&
- vma_is_anonymous(vas) && !is_vm_hugetlb_page(vas);
+ vma_is_anonymous(vas) && !vma_is_hugetlb(vas);
chunk_size = drm_gpusvm_range_chunk_size(gpusvm, notifier, vas,
fault_addr, gpuva_start,
--- a/fs/coredump.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/coredump.c
@@ -1608,7 +1608,7 @@ static unsigned long vma_dump_size(struc
}
/* Hugetlb memory check */
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
goto whole;
if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
--- a/fs/hugetlbfs/inode.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/hugetlbfs/inode.c
@@ -108,7 +108,7 @@ static int hugetlbfs_file_mmap(struct fi
* vma address alignment (but not the pgoff alignment) has
* already been checked by prepare_hugepage_range. If you add
* any error returns here, do so after setting VM_HUGETLB, so
- * is_vm_hugetlb_page tests below unmap_region go the right
+ * vma_is_hugetlb tests below unmap_region go the right
* way when do_mmap unwinds (may be important on powerpc
* and ia64).
*/
--- a/fs/proc/task_mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/proc/task_mmu.c
@@ -3015,7 +3015,7 @@ static int pagemap_scan_pte_hole(unsigne
* hugetlb differs, see pagemap_hugetlb_category().
*/
categories = p->cur_vma_category;
- if (userfaultfd_wp(vma) && !is_vm_hugetlb_page(vma))
+ if (userfaultfd_wp(vma) && !vma_is_hugetlb(vma))
categories |= PAGE_IS_WRITTEN;
if (!pagemap_scan_is_interesting_page(categories, p))
@@ -3028,7 +3028,7 @@ static int pagemap_scan_pte_hole(unsigne
if (~p->arg.flags & PM_SCAN_WP_MATCHING)
return ret;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
err = pagemap_scan_hugetlb_hole_wp(vma, addr, end);
else
err = uffd_wp_range(vma, addr, end - addr, true);
@@ -3470,7 +3470,7 @@ static int show_numa_map(struct seq_file
seq_puts(m, " stack");
}
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
seq_puts(m, " huge");
/* Skip walking pages if gate VMA */
@@ -3499,7 +3499,7 @@ static int show_numa_map(struct seq_file
if (md->swapcache)
seq_printf(m, " swapcache=%lu", md->swapcache);
- if (md->active < md->pages && !is_vm_hugetlb_page(vma))
+ if (md->active < md->pages && !vma_is_hugetlb(vma))
seq_printf(m, " active=%lu", md->active);
if (md->writeback)
--- a/include/asm-generic/tlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/asm-generic/tlb.h
@@ -438,7 +438,7 @@ tlb_update_vma_flags(struct mmu_gather *
* We rely on tlb_end_vma() to issue a flush, such that when we reset
* these values the batch is empty.
*/
- tlb->vma_huge = is_vm_hugetlb_page(vma);
+ tlb->vma_huge = vma_is_hugetlb(vma);
tlb->vma_exec = !!(vma->vm_flags & VM_EXEC);
/*
--- a/include/linux/hugetlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/hugetlb.h
@@ -251,14 +251,14 @@ extern void __hugetlb_zap_end(struct vm_
static inline void hugetlb_zap_begin(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_begin(vma, start, end);
}
static inline void hugetlb_zap_end(struct vm_area_struct *vma,
struct zap_details *details)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_end(vma, details);
}
--- a/include/linux/mm.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/mm.h
@@ -1609,15 +1609,28 @@ static inline bool vma_is_shared_maywrit
return is_shared_maywrite(&vma->flags);
}
-static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
+/**
+ * vma_flags_is_hugetlb() - Do the specified VMA flags indicate that the
+ * VMA is a hugetlb mapping?
+ * @flags: The VMA flags to test.
+ *
+ * Returns: true if the flags indicate a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_flags_is_hugetlb(const vma_flags_t *flags)
{
return IS_ENABLED(CONFIG_HUGETLB_PAGE) &&
vma_flags_test(flags, VMA_HUGETLB_BIT);
}
-static inline bool is_vm_hugetlb_page(const struct vm_area_struct *vma)
+/**
+ * vma_is_hugetlb() - Is @vma a hugetlb mapping?
+ * @vma: The VMA to test.
+ *
+ * Returns: true if @vma is a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_is_hugetlb(const struct vm_area_struct *vma)
{
- return is_vma_hugetlb_flags(&vma->flags);
+ return vma_flags_is_hugetlb(&vma->flags);
}
/**
--- a/include/linux/rmap.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/rmap.h
@@ -888,7 +888,7 @@ struct page_vma_mapped_walk {
static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw)
{
/* HugeTLB pte is set to the relevant page table entry without pte_mapped. */
- if (pvmw->pte && !is_vm_hugetlb_page(pvmw->vma))
+ if (pvmw->pte && !vma_is_hugetlb(pvmw->vma))
pte_unmap(pvmw->pte);
if (pvmw->ptl)
spin_unlock(pvmw->ptl);
--- a/kernel/events/core.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/events/core.c
@@ -9808,7 +9808,7 @@ static void perf_event_mmap_event(struct
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
flags |= MAP_HUGETLB;
if (file) {
--- a/kernel/sched/fair.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/sched/fair.c
@@ -4211,7 +4211,7 @@ retry_pids:
for (; vma; vma = vma_next(&vmi)) {
if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
- is_vm_hugetlb_page(vma) || vma_is_kernel_owned(vma)) {
+ vma_is_hugetlb(vma) || vma_is_kernel_owned(vma)) {
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_UNSUITABLE);
continue;
}
--- a/mm/gup.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/gup.c
@@ -621,7 +621,7 @@ static struct page *no_page_table(struct
* But we can only make this optimization where a hole would surely
* be zero-filled if handle_mm_fault() actually did handle it.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
struct hstate *h = hstate_vma(vma);
if (!hugetlbfs_pagecache_present(h, vma, address))
@@ -1213,7 +1213,7 @@ static int check_vma_flags(struct vm_are
if ((gup_flags & FOLL_LONGTERM) && vma_is_fsdax(vma))
return -EOPNOTSUPP;
- if ((gup_flags & FOLL_SPLIT_PMD) && is_vm_hugetlb_page(vma))
+ if ((gup_flags & FOLL_SPLIT_PMD) && vma_is_hugetlb(vma))
return -EOPNOTSUPP;
if (vma_is_secretmem(vma))
--- a/mm/huge_memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/huge_memory.c
@@ -4794,7 +4794,7 @@ static inline bool vma_not_suitable_for_
return true;
if (vma_test(vma, VMA_IO_BIT))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
return false;
--- a/mm/hugetlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/hugetlb.c
@@ -1147,7 +1147,7 @@ static inline struct resv_map *inode_res
static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
if (vma->vm_flags & VM_MAYSHARE) {
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host;
@@ -1162,7 +1162,7 @@ static struct resv_map *vma_resv_map(str
static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, (unsigned long)map);
@@ -1170,7 +1170,7 @@ static void set_vma_resv_map(struct vm_a
static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, get_vma_private_data(vma) | flags);
@@ -1178,7 +1178,7 @@ static void set_vma_resv_flags(struct vm
static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
return (get_vma_private_data(vma) & flag) != 0;
}
@@ -1192,7 +1192,7 @@ bool __vma_private_lock(struct vm_area_s
void hugetlb_dup_vma_private(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
/*
* Clear vm_private_data
* - For shared mappings this is a per-vma semaphore that may be
@@ -5276,7 +5276,7 @@ void __unmap_hugepage_range(struct mmu_g
unsigned long last_addr_mask;
i_mmap_assert_write_locked(vma->vm_file->f_mapping);
- WARN_ON(!is_vm_hugetlb_page(vma));
+ WARN_ON(!vma_is_hugetlb(vma));
BUG_ON(start & ~huge_page_mask(h));
BUG_ON(end & ~huge_page_mask(h));
@@ -7502,6 +7502,6 @@ void hugetlb_unshare_all_pmds(struct vm_
*/
void fixup_hugetlb_reservations(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
clear_vma_resv_huge_pages(vma);
}
--- a/mm/internal.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/internal.h
@@ -1117,7 +1117,7 @@ static inline bool vma_supports_mlock(co
return false;
if (vma_test_single_mask(vma, VMA_DROPPABLE))
return false;
- if (vma_is_dax(vma) || is_vm_hugetlb_page(vma))
+ if (vma_is_dax(vma) || vma_is_hugetlb(vma))
return false;
return vma != get_gate_vma(current->mm);
}
--- a/mm/madvise.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/madvise.c
@@ -881,7 +881,7 @@ bool madvise_dontneed_free_valid_vma(str
int behavior = madv_behavior->behavior;
struct madvise_behavior_range *range = &madv_behavior->range;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
unsigned int forbidden = VM_PFNMAP;
if (behavior != MADV_DONTNEED_LOCKED)
@@ -1578,7 +1578,7 @@ static int madvise_vma_behavior(struct m
new_flags |= VM_DONTDUMP;
break;
case MADV_DODUMP:
- if ((!is_vm_hugetlb_page(vma) && (new_flags & VM_SPECIAL)) ||
+ if ((!vma_is_hugetlb(vma) && (new_flags & VM_SPECIAL)) ||
(new_flags & VM_DROPPABLE))
return -EINVAL;
new_flags &= ~VM_DONTDUMP;
--- a/mm/memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/memory.c
@@ -1564,7 +1564,7 @@ copy_page_range(struct vm_area_struct *d
if (!vma_needs_copy(dst_vma, src_vma))
return 0;
- if (is_vm_hugetlb_page(src_vma))
+ if (vma_is_hugetlb(src_vma))
return copy_hugetlb_page_range(dst_mm, src_mm, dst_vma, src_vma);
/*
@@ -2178,7 +2178,7 @@ static void __zap_vma_range(struct mmu_g
if (vma->vm_file && !reaping)
uprobe_munmap(vma, start, end);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
zap_flags_t zap_flags = details ? details->zap_flags : 0;
VM_WARN_ON_ONCE(reaping);
@@ -2313,7 +2313,7 @@ void zap_vma_range_batched(struct mmu_ga
*/
__zap_vma_range(tlb, vma, address, end, details);
mmu_notifier_invalidate_range_end(&range);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
/*
* flush tlb and free resources before hugetlb_zap_end(), to
* avoid concurrent page faults' allocation failure.
@@ -6933,7 +6933,7 @@ vm_fault_t handle_mm_fault(struct vm_are
lru_gen_enter_fault(vma);
- if (unlikely(is_vm_hugetlb_page(vma)))
+ if (unlikely(vma_is_hugetlb(vma)))
ret = hugetlb_fault(vma->vm_mm, vma, address, flags);
else
ret = __handle_mm_fault(vma, address, flags);
@@ -7803,12 +7803,12 @@ void ptlock_free(struct ptdesc *ptdesc)
void vma_pgtable_walk_begin(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
}
void vma_pgtable_walk_end(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_unlock_read(vma);
}
--- a/mm/mempolicy.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mempolicy.c
@@ -2023,7 +2023,7 @@ bool vma_migratable(struct vm_area_struc
if (vma_is_dax(vma))
return false;
- if (is_vm_hugetlb_page(vma) &&
+ if (vma_is_hugetlb(vma) &&
!hugepage_migration_supported(hstate_vma(vma)))
return false;
--- a/mm/migrate_device.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/migrate_device.c
@@ -743,7 +743,7 @@ int migrate_vma_setup(struct migrate_vma
args->start &= PAGE_MASK;
args->end &= PAGE_MASK;
- if (!args->vma || is_vm_hugetlb_page(args->vma) ||
+ if (!args->vma || vma_is_hugetlb(args->vma) ||
(args->vma->vm_flags & VM_SPECIAL) || vma_is_dax(args->vma))
return -EINVAL;
if (nr_pages <= 0)
--- a/mm/mmap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmap.c
@@ -1786,7 +1786,7 @@ __latent_entropy int dup_mmap(struct mm_
/*
* Copy/update hugetlb private vma information.
*/
- if (is_vm_hugetlb_page(tmp))
+ if (vma_is_hugetlb(tmp))
hugetlb_dup_vma_private(tmp);
/*
--- a/mm/mmu_gather.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmu_gather.c
@@ -480,7 +480,7 @@ void tlb_gather_mmu_vma(struct mmu_gathe
{
tlb_gather_mmu(tlb, vma->vm_mm);
tlb_update_vma_flags(tlb, vma);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
/* All entries have the same size. */
tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
}
--- a/mm/mprotect.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mprotect.c
@@ -717,7 +717,7 @@ long change_protection(struct mmu_gather
(cp_flags & MM_CP_UFFD_RWP))
newprot = PAGE_NONE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
pages = hugetlb_change_protection(vma, start, end, newprot,
cp_flags);
else
--- a/mm/mremap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mremap.c
@@ -812,7 +812,7 @@ unsigned long move_page_tables(struct pa
if (!pmc->len_in)
return 0;
- if (is_vm_hugetlb_page(pmc->old))
+ if (vma_is_hugetlb(pmc->old))
return move_hugetlb_page_tables(pmc->old, pmc->new, pmc->old_addr,
pmc->new_addr, pmc->len_in);
@@ -1735,7 +1735,7 @@ static bool vma_multi_allowed(struct vm_
/* Known good. */
if (vma_is_shmem(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (file->f_op->get_unmapped_area == thp_get_unmapped_area)
return true;
@@ -1758,7 +1758,7 @@ static int check_prep_vma(struct vma_rem
return -EPERM;
/* Align to hugetlb page size, if required. */
- if (is_vm_hugetlb_page(vma) && !align_hugetlb(vrm))
+ if (vma_is_hugetlb(vma) && !align_hugetlb(vrm))
return -EINVAL;
vrm_set_delta(vrm);
--- a/mm/page_vma_mapped.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/page_vma_mapped.c
@@ -109,7 +109,7 @@ static bool check_pte(struct page_vma_ma
unsigned long pfn;
pte_t ptent;
- if (is_vm_hugetlb_page(pvmw->vma))
+ if (vma_is_hugetlb(pvmw->vma))
ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
pvmw->pte);
else
@@ -206,7 +206,7 @@ bool page_vma_mapped_walk(struct page_vm
if (pvmw->pmd && !pvmw->pte)
return not_found(pvmw);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
struct hstate *hstate = hstate_vma(vma);
unsigned long size = huge_page_size(hstate);
/* The only possible mapping was handled on last iteration */
--- a/mm/pagewalk.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/pagewalk.c
@@ -408,7 +408,7 @@ static int __walk_page_range(unsigned lo
int err = 0;
struct vm_area_struct *vma = walk->vma;
const struct mm_walk_ops *ops = walk->ops;
- bool is_hugetlb = is_vm_hugetlb_page(vma);
+ bool is_hugetlb = vma_is_hugetlb(vma);
/* We do not support hugetlb PTE installation. */
if (ops->install_pte && is_hugetlb)
--- a/mm/swapfile.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/swapfile.c
@@ -2707,7 +2707,7 @@ static int unuse_mm(struct mm_struct *mm
if (check_stable_address_space(mm))
goto unlock;
for_each_vma(vmi, vma) {
- if (vma->anon_vma && !is_vm_hugetlb_page(vma)) {
+ if (vma->anon_vma && !vma_is_hugetlb(vma)) {
ret = unuse_vma(vma, type);
if (ret)
break;
--- a/mm/userfaultfd.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/userfaultfd.c
@@ -237,7 +237,7 @@ static int mfill_get_vma(struct mfill_st
if ((flags & MFILL_ATOMIC_WP) && !(dst_vma->vm_flags & VM_UFFD_WP))
goto out_unlock;
- if (is_vm_hugetlb_page(dst_vma))
+ if (vma_is_hugetlb(dst_vma))
return 0;
ops = vma_uffd_ops(dst_vma);
@@ -804,7 +804,7 @@ retry:
}
err = -ENOENT;
- if (!is_vm_hugetlb_page(dst_vma))
+ if (!vma_is_hugetlb(dst_vma))
goto out_unlock_vma;
err = -EINVAL;
@@ -967,7 +967,7 @@ static __always_inline ssize_t mfill_ato
/*
* If this is a HUGETLB vma, pass off to appropriate routine
*/
- if (is_vm_hugetlb_page(state.vma))
+ if (vma_is_hugetlb(state.vma))
return mfill_atomic_hugetlb(ctx, state.vma, dst_start,
src_start, len, flags);
@@ -1114,7 +1114,7 @@ static int mwriteprotect_range(struct us
break;
}
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
err = -EINVAL;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
if ((start & page_mask) || (len & page_mask))
@@ -1172,7 +1172,7 @@ int mrwprotect_range(struct userfaultfd_
if (!userfaultfd_rwp(dst_vma))
return -ENOENT;
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
unsigned long page_mask;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
@@ -2149,7 +2149,7 @@ static bool vma_can_userfault(struct vm_
if (vma->vm_flags & (VM_DROPPABLE | VM_SHADOW_STACK))
return false;
- if (!is_vm_hugetlb_page(vma) && (vma->vm_flags & VM_SPECIAL))
+ if (!vma_is_hugetlb(vma) && (vma->vm_flags & VM_SPECIAL))
return false;
vm_flags &= __VM_UFFD_FLAGS;
@@ -2319,7 +2319,7 @@ static int userfaultfd_register_range(st
*/
userfaultfd_set_ctx(vma, ctx, vm_flags);
- if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma))
+ if (vma_is_hugetlb(vma) && uffd_disable_huge_pmd_share(vma))
hugetlb_unshare_all_pmds(vma);
skip:
@@ -2895,7 +2895,7 @@ vm_fault_t handle_userfault(struct vm_fa
* (sleepable) vma lock can modify the current task state, that
* must be before explicitly calling set_current_state().
*/
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
spin_lock_irq(&ctx->fault_pending_wqh.lock);
@@ -2912,7 +2912,7 @@ vm_fault_t handle_userfault(struct vm_fa
set_current_state(blocking_state);
spin_unlock_irq(&ctx->fault_pending_wqh.lock);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
must_wait = userfaultfd_huge_must_wait(ctx, vmf, reason);
hugetlb_vma_unlock_read(vma);
} else {
@@ -3744,7 +3744,7 @@ static int userfaultfd_register(struct u
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
@@ -3795,7 +3795,7 @@ static int userfaultfd_register(struct u
* If this vma contains ending address, and huge pages
* check alignment.
*/
- if (is_vm_hugetlb_page(cur) && end <= cur->vm_end &&
+ if (vma_is_hugetlb(cur) && end <= cur->vm_end &&
end > cur->vm_start) {
unsigned long vma_hpagesize = vma_kernel_pagesize(cur);
@@ -3831,7 +3831,7 @@ static int userfaultfd_register(struct u
/*
* Note vmas containing huge pages
*/
- if (is_vm_hugetlb_page(cur))
+ if (vma_is_hugetlb(cur))
basic_ioctls = true;
found = true;
@@ -3917,7 +3917,7 @@ static int userfaultfd_unregister(struct
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
--- a/mm/vma.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vma.c
@@ -599,7 +599,7 @@ __split_vma(struct vma_iterator *vmi, st
* boundary.
*/
vma_adjust_trans_huge(vma, vma->vm_start, addr, NULL);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_split(vma, addr);
if (new_below) {
@@ -2236,7 +2236,7 @@ bool vma_wants_writenotify(struct vm_are
* Do we need to track softdirty? hugetlb does not support softdirty
* tracking yet.
*/
- if (vma_soft_dirty_enabled(vma) && !is_vm_hugetlb_page(vma))
+ if (vma_soft_dirty_enabled(vma) && !vma_is_hugetlb(vma))
return true;
/* Do we need write faults for uffd-wp tracking? */
@@ -2355,7 +2355,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- is_vm_hugetlb_page(vma))
+ vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
@@ -2364,7 +2364,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- !is_vm_hugetlb_page(vma))
+ !vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
--- a/mm/vmscan.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vmscan.c
@@ -3474,7 +3474,7 @@ static int should_skip_vma(unsigned long
if (!vma_is_accessible(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (!vma_has_recency(vma))
--- a/tools/testing/vma/include/stubs.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/tools/testing/vma/include/stubs.h
@@ -193,7 +193,7 @@ static inline bool mapping_can_writeback
return true;
}
-static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
+static inline bool vma_is_hugetlb(struct vm_area_struct *vma)
{
return false;
}
_
Patches currently in -mm which might be from ljs@kernel.org are
mm-vmpressure-remove-window-size-todo.patch
tools-testing-selftests-mm-add-missing-gitignore-entries.patch
mm-move-drivers-char-memc-to-mm-char-memc.patch
mm-implement-file_is_dev_zero-to-uniquely-identify-dev-zero.patch
mm-vma-only-permit-map_private-dev-zero-to-be-mapped-anonymous.patch
mm-vma-make-map_private-mapped-dev-zero-mappings-truly-anonymous.patch
tools-testing-vma-add-test-to-assert-map_private-dev-zero-is-anon.patch
tools-testing-selftests-mm-add-map_private-dev-zero-merge-tests.patch
mm-madvise-swap-in-cowd-map_private-file-mappings-on-madv_willneed.patch
mm-huge_memory-zap-deposited-page-tables-after-an-rcu-grace-period.patch
mm-enable-mmu_gather_rcu_table_free-for-most-2-level-architectures.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-riscv.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-arm.patch
mm-enable-mmu_gather_rcu_table_free-for-arc-microblaze-xtensa.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc64.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-coldfire.patch
mm-enable-mmu_gather_rcu_table_free-for-sh-x2.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-motorola.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc32.patch
mm-make-userland-page-table-freeing-rcu-safe.patch
mm-change-the-contract-for-free_pgtables-update-docs.patch
mm-vma-fix-mmap_prepare-file-handling-remove-file_doesnt_need_get.patch
mm-vma-predicate-setting-mmap_prepare-vma-fields-on-new-vma-alloc.patch
mm-vma-introduce-and-use-vma_can_merge.patch
mm-consistently-validate-vma-state-after-mmap-hooks.patch
mm-vma-ensure-mmap_prepare-doesnt-set-actions-on-a-mergeable-vma.patch
mm-make-map_kernel_pages_-internal-and-unexported.patch
mm-vma-tidy-up-map-kernel-pages-enum-values.patch
mm-add-mmap-action-for-discontiguous-kernel-page-mapping.patch
docs-filesystems-update-mmap_prepare-docs-for-discontig-kernel-pgs.patch
drivers-usb-mon-update-to-use-mmap_prepare-map-kernel-pages.patch
infiniband-update-hfi1-to-use-remap_vmalloc_range.patch
selinux-reject-writable-opens-of-policy-file-drop-mmap-shared-write-check.patch
alsa-pcm-use-vm_insert_page-to-map-pcm-status-page.patch
bpf-arena-mark-arena_map_mmap-mappings-vm_mixedmap.patch
mm-vma-add-vma_is_kernel_owned-predicates.patch
mm-vma-only-allow-mmap-to-clear-vma_maywrite_bit-if-kernel-owned.patch
mm-vma-add-and-use-vma__is_fixed_mapping.patch
scsi-sg-convert-mmap-hook-to-mmap_prepare-and-rework.patch
fbdev-defio-assert-fbinfo_virtfb-drop-vm_io-add-vm_mixedmap.patch
hsi-cmt_speech-convert-mmap-hook-to-mmap_prepare-refactor.patch
mm-gup-error-out-early-on-vma_mayread_bit-vmas.patch
uprobes-remove-vm_io-set-vm_mixedmap-for-mapped-kernel-pages.patch
mm-mlock-clear-vma_locked_mask-over-mmap-callback.patch
mm-mlock-eliminate-weird-vma_io_bit-abuse-and-simplify.patch
mm-vma-enforce-that-only-kernel-owned-mappings-may-set-vma_io_bit.patch
mm-remove-vma_io_bit-check-in-vma_is_kernel_owned.patch
mm-remove-hugetlb_inlineh.patch
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
mm-drop-some-redundant-checks-around-hugetlb-vmas.patch
mm-madvise-update-is_valid_guard_vma-to-use-vma_can_merge.patch
mm-vma-introduce-vma_is_persistent.patch
mm-uffd-use-predicates-for-userfaultfd-checks.patch
mm-madvise-use-predicates-for-madvise-madv_dofork.patch
mm-eliminate-vma_special_flags-usage-when-hugetlb-explicitly-tested.patch
mm-eliminate-vma_special_flags-check-in-lru_gen_look_around.patch
mm-avoid-use-of-vma_special_flags-in-migrate_vma_setup.patch
mm-eliminate-vm_special-vma_special_flags.patch
fuse-dax-do-not-set-vm_mixedmap.patch
mm-huge_memory-remove-vma_is_special_huge.patch
mm-vma-introduce-and-use-vma_can_gup.patch
mm-vma-const-ify-vma_assert_stabilised-and-associated-functions.patch
mm-implement-and-use-vma_has_anon_rmap-silence-kcsan.patch
mm-update-comments-to-refer-to-anon-rmap-rather-than-anon_vma.patch
^ permalink raw reply [flat|nested] 4+ messages in thread* + mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch added to mm-unstable branch
@ 2026-10-03 23:35 Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-10-03 23:35 UTC (permalink / raw)
To: mm-commits, ljs, akpm
The patch titled
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
has been added to the -mm mm-unstable branch. Its filename is
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
Date: Sat, 03 Oct 2026 17:32:58 +0100
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.
Link: https://lore.kernel.org/20261003-b4-mmap-prepare-vma-flag-sanify-v4-27-a1f052500fd7@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Anup Patel <anup@brainfault.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Nico Pache <nico.pache@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>
Cc: Martin K. Petersen <mkp@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Harry Yoo <harry@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Oliver Upton <oupton@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Paul Walmsley <pjw@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Xu Xin <xu.xin@linux.dev>
---
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(-)
--- a/arch/arm64/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/arm64/kvm/mmu.c
@@ -1472,13 +1472,13 @@ static int get_vma_page_shift(struct vm_
{
unsigned long pa;
- if (is_vm_hugetlb_page(vma) && !(vma->vm_flags & VM_PFNMAP))
+ if (vma_is_hugetlb(vma) && !(vma->vm_flags & VM_PFNMAP))
return huge_page_shift(hstate_vma(vma));
if (!(vma->vm_flags & VM_PFNMAP))
return PAGE_SHIFT;
- VM_BUG_ON(is_vm_hugetlb_page(vma));
+ VM_BUG_ON(vma_is_hugetlb(vma));
pa = (vma->vm_pgoff << PAGE_SHIFT) + (hva - vma->vm_start);
--- a/arch/powerpc/mm/book3s64/radix_tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -627,7 +627,7 @@ void radix__local_flush_tlb_page(struct
{
#ifdef CONFIG_HUGETLB_PAGE
/* need the return fix for nohash.c */
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__local_flush_hugetlb_page(vma, vmaddr);
#endif
radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -945,7 +945,7 @@ void radix__flush_tlb_page_psize(struct
void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_page(vma, vmaddr);
#endif
radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -1113,7 +1113,7 @@ void radix__flush_tlb_range(struct vm_ar
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_tlb_range(vma, start, end);
#endif
--- a/arch/powerpc/mm/nohash/e500_hugetlbpage.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/e500_hugetlbpage.c
@@ -180,7 +180,7 @@ book3e_hugetlb_preload(struct vm_area_st
*/
void __update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
book3e_hugetlb_preload(vma, address, *ptep);
}
--- a/arch/powerpc/mm/nohash/tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/tlb.c
@@ -278,7 +278,7 @@ void __flush_tlb_page(struct mm_struct *
void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (vma && is_vm_hugetlb_page(vma))
+ if (vma && vma_is_hugetlb(vma))
flush_hugetlb_page(vma, vmaddr);
#endif
--- a/arch/riscv/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/kvm/mmu.c
@@ -665,7 +665,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *v
return -EFAULT;
}
- is_hugetlb = is_vm_hugetlb_page(vma);
+ is_hugetlb = vma_is_hugetlb(vma);
if (is_hugetlb)
vma_pageshift = huge_page_shift(hstate_vma(vma));
else
--- a/arch/riscv/mm/tlbflush.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/mm/tlbflush.c
@@ -149,7 +149,7 @@ void flush_tlb_range(struct vm_area_stru
{
unsigned long stride_size;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
stride_size = PAGE_SIZE;
} else {
stride_size = huge_page_size(hstate_vma(vma));
--- a/arch/s390/mm/gmap_helpers.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/s390/mm/gmap_helpers.c
@@ -102,7 +102,7 @@ __context_unsafe(/* pte_unmap_unlock() n
/* 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_struc
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_zeropag
* 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))
continue;
addr = vma->vm_start;
--- a/arch/sparc/mm/init_64.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/sparc/mm/init_64.c
@@ -413,7 +413,7 @@ void update_mmu_cache_range(struct vm_fa
if (mm->context.hugetlb_pte_count || mm->context.thp_pte_count) {
unsigned long hugepage_size = PAGE_SIZE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugepage_size = huge_page_size(hstate_vma(vma));
if (hugepage_size >= PUD_SIZE) {
--- a/drivers/gpu/drm/drm_gpusvm.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/drivers/gpu/drm/drm_gpusvm.c
@@ -1142,7 +1142,7 @@ drm_gpusvm_range_find_or_insert(struct d
* have to change.
*/
migrate_devmem = ctx->devmem_possible &&
- vma_is_anonymous(vas) && !is_vm_hugetlb_page(vas);
+ vma_is_anonymous(vas) && !vma_is_hugetlb(vas);
chunk_size = drm_gpusvm_range_chunk_size(gpusvm, notifier, vas,
fault_addr, gpuva_start,
--- a/fs/coredump.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/coredump.c
@@ -1608,7 +1608,7 @@ static unsigned long vma_dump_size(struc
}
/* Hugetlb memory check */
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
goto whole;
if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
--- a/fs/hugetlbfs/inode.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/hugetlbfs/inode.c
@@ -108,7 +108,7 @@ static int hugetlbfs_file_mmap(struct fi
* vma address alignment (but not the pgoff alignment) has
* already been checked by prepare_hugepage_range. If you add
* any error returns here, do so after setting VM_HUGETLB, so
- * is_vm_hugetlb_page tests below unmap_region go the right
+ * vma_is_hugetlb tests below unmap_region go the right
* way when do_mmap unwinds (may be important on powerpc
* and ia64).
*/
--- a/fs/proc/task_mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/proc/task_mmu.c
@@ -3015,7 +3015,7 @@ static int pagemap_scan_pte_hole(unsigne
* hugetlb differs, see pagemap_hugetlb_category().
*/
categories = p->cur_vma_category;
- if (userfaultfd_wp(vma) && !is_vm_hugetlb_page(vma))
+ if (userfaultfd_wp(vma) && !vma_is_hugetlb(vma))
categories |= PAGE_IS_WRITTEN;
if (!pagemap_scan_is_interesting_page(categories, p))
@@ -3028,7 +3028,7 @@ static int pagemap_scan_pte_hole(unsigne
if (~p->arg.flags & PM_SCAN_WP_MATCHING)
return ret;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
err = pagemap_scan_hugetlb_hole_wp(vma, addr, end);
else
err = uffd_wp_range(vma, addr, end - addr, true);
@@ -3470,7 +3470,7 @@ static int show_numa_map(struct seq_file
seq_puts(m, " stack");
}
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
seq_puts(m, " huge");
/* Skip walking pages if gate VMA */
@@ -3499,7 +3499,7 @@ static int show_numa_map(struct seq_file
if (md->swapcache)
seq_printf(m, " swapcache=%lu", md->swapcache);
- if (md->active < md->pages && !is_vm_hugetlb_page(vma))
+ if (md->active < md->pages && !vma_is_hugetlb(vma))
seq_printf(m, " active=%lu", md->active);
if (md->writeback)
--- a/include/asm-generic/tlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/asm-generic/tlb.h
@@ -438,7 +438,7 @@ tlb_update_vma_flags(struct mmu_gather *
* We rely on tlb_end_vma() to issue a flush, such that when we reset
* these values the batch is empty.
*/
- tlb->vma_huge = is_vm_hugetlb_page(vma);
+ tlb->vma_huge = vma_is_hugetlb(vma);
tlb->vma_exec = !!(vma->vm_flags & VM_EXEC);
/*
--- a/include/linux/hugetlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/hugetlb.h
@@ -251,14 +251,14 @@ extern void __hugetlb_zap_end(struct vm_
static inline void hugetlb_zap_begin(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_begin(vma, start, end);
}
static inline void hugetlb_zap_end(struct vm_area_struct *vma,
struct zap_details *details)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_end(vma, details);
}
--- a/include/linux/mm.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/mm.h
@@ -1610,15 +1610,28 @@ static inline bool vma_is_shared_maywrit
return is_shared_maywrite(&vma->flags);
}
-static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
+/**
+ * vma_flags_is_hugetlb() - Do the specified VMA flags indicate that the
+ * VMA is a hugetlb mapping?
+ * @flags: The VMA flags to test.
+ *
+ * Returns: true if the flags indicate a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_flags_is_hugetlb(const vma_flags_t *flags)
{
return IS_ENABLED(CONFIG_HUGETLB_PAGE) &&
vma_flags_test(flags, VMA_HUGETLB_BIT);
}
-static inline bool is_vm_hugetlb_page(const struct vm_area_struct *vma)
+/**
+ * vma_is_hugetlb() - Is @vma a hugetlb mapping?
+ * @vma: The VMA to test.
+ *
+ * Returns: true if @vma is a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_is_hugetlb(const struct vm_area_struct *vma)
{
- return is_vma_hugetlb_flags(&vma->flags);
+ return vma_flags_is_hugetlb(&vma->flags);
}
/**
--- a/include/linux/rmap.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/rmap.h
@@ -888,7 +888,7 @@ struct page_vma_mapped_walk {
static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw)
{
/* HugeTLB pte is set to the relevant page table entry without pte_mapped. */
- if (pvmw->pte && !is_vm_hugetlb_page(pvmw->vma))
+ if (pvmw->pte && !vma_is_hugetlb(pvmw->vma))
pte_unmap(pvmw->pte);
if (pvmw->ptl)
spin_unlock(pvmw->ptl);
--- a/kernel/events/core.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/events/core.c
@@ -9818,7 +9818,7 @@ static void perf_event_mmap_event(struct
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
flags |= MAP_HUGETLB;
if (file) {
--- a/kernel/sched/fair.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/sched/fair.c
@@ -4416,7 +4416,7 @@ retry_pids:
for (; vma; vma = vma_next(&vmi)) {
if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
- is_vm_hugetlb_page(vma) || !vma_is_mm_managed(vma)) {
+ vma_is_hugetlb(vma) || !vma_is_mm_managed(vma)) {
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_UNSUITABLE);
continue;
}
--- a/mm/gup.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/gup.c
@@ -621,7 +621,7 @@ static struct page *no_page_table(struct
* But we can only make this optimization where a hole would surely
* be zero-filled if handle_mm_fault() actually did handle it.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
struct hstate *h = hstate_vma(vma);
if (!hugetlbfs_pagecache_present(h, vma, address))
@@ -1213,7 +1213,7 @@ static int check_vma_flags(struct vm_are
if ((gup_flags & FOLL_LONGTERM) && vma_is_fsdax(vma))
return -EOPNOTSUPP;
- if ((gup_flags & FOLL_SPLIT_PMD) && is_vm_hugetlb_page(vma))
+ if ((gup_flags & FOLL_SPLIT_PMD) && vma_is_hugetlb(vma))
return -EOPNOTSUPP;
if (vma_is_secretmem(vma))
--- a/mm/huge_memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/huge_memory.c
@@ -4792,7 +4792,7 @@ static inline bool vma_not_suitable_for_
return true;
if (vma_test(vma, VMA_IO_BIT))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
return false;
--- a/mm/hugetlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/hugetlb.c
@@ -1147,7 +1147,7 @@ static inline struct resv_map *inode_res
static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
if (vma->vm_flags & VM_MAYSHARE) {
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host;
@@ -1162,7 +1162,7 @@ static struct resv_map *vma_resv_map(str
static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, (unsigned long)map);
@@ -1170,7 +1170,7 @@ static void set_vma_resv_map(struct vm_a
static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, get_vma_private_data(vma) | flags);
@@ -1178,7 +1178,7 @@ static void set_vma_resv_flags(struct vm
static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
return (get_vma_private_data(vma) & flag) != 0;
}
@@ -1192,7 +1192,7 @@ bool __vma_private_lock(struct vm_area_s
void hugetlb_dup_vma_private(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
/*
* Clear vm_private_data
* - For shared mappings this is a per-vma semaphore that may be
@@ -5276,7 +5276,7 @@ void __unmap_hugepage_range(struct mmu_g
unsigned long last_addr_mask;
i_mmap_assert_write_locked(vma->vm_file->f_mapping);
- WARN_ON(!is_vm_hugetlb_page(vma));
+ WARN_ON(!vma_is_hugetlb(vma));
BUG_ON(start & ~huge_page_mask(h));
BUG_ON(end & ~huge_page_mask(h));
@@ -7502,6 +7502,6 @@ void hugetlb_unshare_all_pmds(struct vm_
*/
void fixup_hugetlb_reservations(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
clear_vma_resv_huge_pages(vma);
}
--- a/mm/internal.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/internal.h
@@ -1116,7 +1116,7 @@ static inline bool vma_supports_mlock(co
return false;
if (vma_test_single_mask(vma, VMA_DROPPABLE))
return false;
- if (vma_is_dax(vma) || is_vm_hugetlb_page(vma))
+ if (vma_is_dax(vma) || vma_is_hugetlb(vma))
return false;
return vma != get_gate_vma(current->mm);
}
--- a/mm/madvise.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/madvise.c
@@ -881,7 +881,7 @@ bool madvise_dontneed_free_valid_vma(str
int behavior = madv_behavior->behavior;
struct madvise_behavior_range *range = &madv_behavior->range;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
unsigned int forbidden = VM_PFNMAP;
if (behavior != MADV_DONTNEED_LOCKED)
@@ -1579,7 +1579,7 @@ static int madvise_vma_behavior(struct m
new_flags |= VM_DONTDUMP;
break;
case MADV_DODUMP:
- if ((!is_vm_hugetlb_page(vma) && (new_flags & VM_SPECIAL)) ||
+ if ((!vma_is_hugetlb(vma) && (new_flags & VM_SPECIAL)) ||
(new_flags & VM_DROPPABLE))
return -EINVAL;
new_flags &= ~VM_DONTDUMP;
--- a/mm/memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/memory.c
@@ -1564,7 +1564,7 @@ copy_page_range(struct vm_area_struct *d
if (!vma_needs_copy(dst_vma, src_vma))
return 0;
- if (is_vm_hugetlb_page(src_vma))
+ if (vma_is_hugetlb(src_vma))
return copy_hugetlb_page_range(dst_mm, src_mm, dst_vma, src_vma);
/*
@@ -2178,7 +2178,7 @@ static void __zap_vma_range(struct mmu_g
if (vma->vm_file && !reaping)
uprobe_munmap(vma, start, end);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
zap_flags_t zap_flags = details ? details->zap_flags : 0;
VM_WARN_ON_ONCE(reaping);
@@ -2313,7 +2313,7 @@ void zap_vma_range_batched(struct mmu_ga
*/
__zap_vma_range(tlb, vma, address, end, details);
mmu_notifier_invalidate_range_end(&range);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
/*
* flush tlb and free resources before hugetlb_zap_end(), to
* avoid concurrent page faults' allocation failure.
@@ -6934,7 +6934,7 @@ vm_fault_t handle_mm_fault(struct vm_are
lru_gen_enter_fault(vma);
- if (unlikely(is_vm_hugetlb_page(vma)))
+ if (unlikely(vma_is_hugetlb(vma)))
ret = hugetlb_fault(vma->vm_mm, vma, address, flags);
else
ret = __handle_mm_fault(vma, address, flags);
@@ -7804,12 +7804,12 @@ void ptlock_free(struct ptdesc *ptdesc)
void vma_pgtable_walk_begin(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
}
void vma_pgtable_walk_end(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_unlock_read(vma);
}
--- a/mm/mempolicy.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mempolicy.c
@@ -2018,7 +2018,7 @@ bool vma_migratable(struct vm_area_struc
if (vma_is_dax(vma))
return false;
- if (is_vm_hugetlb_page(vma) &&
+ if (vma_is_hugetlb(vma) &&
!hugepage_migration_supported(hstate_vma(vma)))
return false;
--- a/mm/migrate_device.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/migrate_device.c
@@ -743,7 +743,7 @@ int migrate_vma_setup(struct migrate_vma
args->start &= PAGE_MASK;
args->end &= PAGE_MASK;
- if (!args->vma || is_vm_hugetlb_page(args->vma) ||
+ if (!args->vma || vma_is_hugetlb(args->vma) ||
(args->vma->vm_flags & VM_SPECIAL) || vma_is_dax(args->vma))
return -EINVAL;
if (nr_pages <= 0)
--- a/mm/mmap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmap.c
@@ -1786,7 +1786,7 @@ __latent_entropy int dup_mmap(struct mm_
/*
* Copy/update hugetlb private vma information.
*/
- if (is_vm_hugetlb_page(tmp))
+ if (vma_is_hugetlb(tmp))
hugetlb_dup_vma_private(tmp);
/*
--- a/mm/mmu_gather.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmu_gather.c
@@ -480,7 +480,7 @@ void tlb_gather_mmu_vma(struct mmu_gathe
{
tlb_gather_mmu(tlb, vma->vm_mm);
tlb_update_vma_flags(tlb, vma);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
/* All entries have the same size. */
tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
}
--- a/mm/mprotect.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mprotect.c
@@ -717,7 +717,7 @@ long change_protection(struct mmu_gather
(cp_flags & MM_CP_UFFD_RWP))
newprot = PAGE_NONE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
pages = hugetlb_change_protection(vma, start, end, newprot,
cp_flags);
else
--- a/mm/mremap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mremap.c
@@ -812,7 +812,7 @@ unsigned long move_page_tables(struct pa
if (!pmc->len_in)
return 0;
- if (is_vm_hugetlb_page(pmc->old))
+ if (vma_is_hugetlb(pmc->old))
return move_hugetlb_page_tables(pmc->old, pmc->new, pmc->old_addr,
pmc->new_addr, pmc->len_in);
@@ -1769,7 +1769,7 @@ static bool vma_multi_allowed(struct vm_
/* Known good. */
if (vma_is_shmem(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (file->f_op->get_unmapped_area == thp_get_unmapped_area)
return true;
@@ -1792,7 +1792,7 @@ static int check_prep_vma(struct vma_rem
return -EPERM;
/* Align to hugetlb page size, if required. */
- if (is_vm_hugetlb_page(vma) && !align_hugetlb(vrm))
+ if (vma_is_hugetlb(vma) && !align_hugetlb(vrm))
return -EINVAL;
vrm_set_delta(vrm);
--- a/mm/page_vma_mapped.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/page_vma_mapped.c
@@ -109,7 +109,7 @@ static bool check_pte(struct page_vma_ma
unsigned long pfn;
pte_t ptent;
- if (is_vm_hugetlb_page(pvmw->vma))
+ if (vma_is_hugetlb(pvmw->vma))
ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
pvmw->pte);
else
@@ -206,7 +206,7 @@ bool page_vma_mapped_walk(struct page_vm
if (pvmw->pmd && !pvmw->pte)
return not_found(pvmw);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
struct hstate *hstate = hstate_vma(vma);
unsigned long size = huge_page_size(hstate);
/* The only possible mapping was handled on last iteration */
--- a/mm/pagewalk.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/pagewalk.c
@@ -408,7 +408,7 @@ static int __walk_page_range(unsigned lo
int err = 0;
struct vm_area_struct *vma = walk->vma;
const struct mm_walk_ops *ops = walk->ops;
- bool is_hugetlb = is_vm_hugetlb_page(vma);
+ bool is_hugetlb = vma_is_hugetlb(vma);
/* We do not support hugetlb PTE installation. */
if (ops->install_pte && is_hugetlb)
--- a/mm/swapfile.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/swapfile.c
@@ -2707,7 +2707,7 @@ static int unuse_mm(struct mm_struct *mm
if (check_stable_address_space(mm))
goto unlock;
for_each_vma(vmi, vma) {
- if (vma->anon_vma && !is_vm_hugetlb_page(vma)) {
+ if (vma->anon_vma && !vma_is_hugetlb(vma)) {
ret = unuse_vma(vma, type);
if (ret)
break;
--- a/mm/userfaultfd.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/userfaultfd.c
@@ -237,7 +237,7 @@ static int mfill_get_vma(struct mfill_st
if ((flags & MFILL_ATOMIC_WP) && !(dst_vma->vm_flags & VM_UFFD_WP))
goto out_unlock;
- if (is_vm_hugetlb_page(dst_vma))
+ if (vma_is_hugetlb(dst_vma))
return 0;
ops = vma_uffd_ops(dst_vma);
@@ -804,7 +804,7 @@ retry:
}
err = -ENOENT;
- if (!is_vm_hugetlb_page(dst_vma))
+ if (!vma_is_hugetlb(dst_vma))
goto out_unlock_vma;
err = -EINVAL;
@@ -967,7 +967,7 @@ static __always_inline ssize_t mfill_ato
/*
* If this is a HUGETLB vma, pass off to appropriate routine
*/
- if (is_vm_hugetlb_page(state.vma))
+ if (vma_is_hugetlb(state.vma))
return mfill_atomic_hugetlb(ctx, state.vma, dst_start,
src_start, len, flags);
@@ -1114,7 +1114,7 @@ static int mwriteprotect_range(struct us
break;
}
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
err = -EINVAL;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
if ((start & page_mask) || (len & page_mask))
@@ -1172,7 +1172,7 @@ int mrwprotect_range(struct userfaultfd_
if (!userfaultfd_rwp(dst_vma))
return -ENOENT;
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
unsigned long page_mask;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
@@ -2150,7 +2150,7 @@ static bool vma_can_userfault(struct vm_
if (vma->vm_flags & (VM_DROPPABLE | VM_SHADOW_STACK))
return false;
- if (!is_vm_hugetlb_page(vma) && (vma->vm_flags & VM_SPECIAL))
+ if (!vma_is_hugetlb(vma) && (vma->vm_flags & VM_SPECIAL))
return false;
vm_flags &= __VM_UFFD_FLAGS;
@@ -2320,7 +2320,7 @@ static int userfaultfd_register_range(st
*/
userfaultfd_set_ctx(vma, ctx, vm_flags);
- if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma))
+ if (vma_is_hugetlb(vma) && uffd_disable_huge_pmd_share(vma))
hugetlb_unshare_all_pmds(vma);
skip:
@@ -2896,7 +2896,7 @@ vm_fault_t handle_userfault(struct vm_fa
* (sleepable) vma lock can modify the current task state, that
* must be before explicitly calling set_current_state().
*/
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
spin_lock_irq(&ctx->fault_pending_wqh.lock);
@@ -2913,7 +2913,7 @@ vm_fault_t handle_userfault(struct vm_fa
set_current_state(blocking_state);
spin_unlock_irq(&ctx->fault_pending_wqh.lock);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
must_wait = userfaultfd_huge_must_wait(ctx, vmf, reason);
hugetlb_vma_unlock_read(vma);
} else {
@@ -3745,7 +3745,7 @@ static int userfaultfd_register(struct u
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
@@ -3796,7 +3796,7 @@ static int userfaultfd_register(struct u
* If this vma contains ending address, and huge pages
* check alignment.
*/
- if (is_vm_hugetlb_page(cur) && end <= cur->vm_end &&
+ if (vma_is_hugetlb(cur) && end <= cur->vm_end &&
end > cur->vm_start) {
unsigned long vma_hpagesize = vma_kernel_pagesize(cur);
@@ -3832,7 +3832,7 @@ static int userfaultfd_register(struct u
/*
* Note vmas containing huge pages
*/
- if (is_vm_hugetlb_page(cur))
+ if (vma_is_hugetlb(cur))
basic_ioctls = true;
found = true;
@@ -3918,7 +3918,7 @@ static int userfaultfd_unregister(struct
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
--- a/mm/vma.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vma.c
@@ -599,7 +599,7 @@ __split_vma(struct vma_iterator *vmi, st
* boundary.
*/
vma_adjust_trans_huge(vma, vma->vm_start, addr, NULL);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_split(vma, addr);
if (new_below) {
@@ -2251,7 +2251,7 @@ bool vma_wants_writenotify(struct vm_are
* Do we need to track softdirty? hugetlb does not support softdirty
* tracking yet.
*/
- if (vma_soft_dirty_enabled(vma) && !is_vm_hugetlb_page(vma))
+ if (vma_soft_dirty_enabled(vma) && !vma_is_hugetlb(vma))
return true;
/* Do we need write faults for uffd-wp tracking? */
@@ -2370,7 +2370,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- is_vm_hugetlb_page(vma))
+ vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
@@ -2379,7 +2379,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- !is_vm_hugetlb_page(vma))
+ !vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
--- a/mm/vmscan.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vmscan.c
@@ -3474,7 +3474,7 @@ static int should_skip_vma(unsigned long
if (!vma_is_accessible(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (!vma_has_recency(vma))
--- a/tools/testing/vma/include/stubs.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/tools/testing/vma/include/stubs.h
@@ -193,7 +193,7 @@ static inline bool mapping_can_writeback
return true;
}
-static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
+static inline bool vma_is_hugetlb(struct vm_area_struct *vma)
{
return false;
}
_
Patches currently in -mm which might be from ljs@kernel.org are
mm-mremap-fix-locked_vm-leak-from-mremap_dontunmap-self-merge.patch
mm-mremap-fix-locked_vm-leak-by-splitting-vma-for-mremap_dontunmap.patch
drivers-char-mem-mmap-readonly-map_shared-dev-zero-correctly.patch
mm-vmpressure-remove-window-size-todo.patch
tools-testing-selftests-mm-add-missing-gitignore-entries.patch
mm-move-drivers-char-memc-to-mm-char-memc.patch
mm-implement-file_is_dev_zero-to-uniquely-identify-dev-zero.patch
mm-vma-only-permit-map_private-dev-zero-to-be-mapped-anonymous.patch
mm-vma-make-map_private-mapped-dev-zero-mappings-truly-anonymous.patch
tools-testing-vma-add-test-to-assert-map_private-dev-zero-is-anon.patch
tools-testing-selftests-mm-add-map_private-dev-zero-merge-tests.patch
mm-madvise-swap-in-cowd-map_private-file-mappings-on-madv_willneed.patch
mm-khugepaged-deposit-a-newly-allocated-page-table-on-collapse.patch
mm-enable-mmu_gather_rcu_table_free-for-most-2-level-architectures.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-riscv.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-arm.patch
mm-enable-mmu_gather_rcu_table_free-for-arc-microblaze-xtensa.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc64.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-coldfire.patch
mm-enable-mmu_gather_rcu_table_free-for-sh-x2.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-motorola.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc32.patch
mm-userland-pgtable-freeing-is-rcu-safe-now-remove-leftover-bits.patch
mm-change-the-contract-for-free_pgtables-update-docs.patch
mm-vma-fix-mmap_prepare-file-handling-remove-file_doesnt_need_get.patch
mm-vma-introduce-and-use-vma_can_merge.patch
mm-consistently-validate-vma-state-after-mmap-hooks.patch
mm-vma-ensure-mmap_prepare-doesnt-set-actions-on-a-mergeable-vma.patch
mm-make-map_kernel_pages_-internal-and-unexported.patch
mm-vma-tidy-up-map-kernel-pages-enum-values.patch
mm-add-mmap-action-for-discontiguous-kernel-page-mapping.patch
docs-filesystems-update-mmap_prepare-docs-for-discontig-kernel-pgs.patch
drivers-usb-mon-update-to-use-mmap_prepare-map-kernel-pages.patch
infiniband-update-hfi1-to-use-remap_vmalloc_range.patch
selinux-reject-writable-opens-of-policy-file-drop-mmap-shared-write-check.patch
alsa-pcm-use-vm_insert_page-to-map-pcm-status-page.patch
bpf-arena-mark-arena_map_mmap-mappings-vm_mixedmap.patch
mm-vma-add-vma_is_mm_managed-predicates.patch
mm-vma-only-allow-mmap-to-clear-vma_maywrite_bit-if-not-mm-managed.patch
mm-vma-add-and-use-vma__is_fixed_mapping.patch
scsi-sg-convert-mmap-hook-to-mmap_prepare-and-rework.patch
fbdev-defio-assert-fbinfo_virtfb-drop-vm_io-add-vm_mixedmap.patch
hsi-cmt_speech-convert-mmap-hook-to-mmap_prepare-refactor.patch
mm-gup-error-out-early-on-vma_mayread_bit-vmas.patch
uprobes-remove-vm_io-set-vm_mixedmap-for-mapped-kernel-pages.patch
mm-mlock-clear-vma_locked_mask-over-mmap-callback.patch
mm-mlock-eliminate-weird-vma_io_bit-abuse-and-simplify.patch
mm-vma-enforce-that-mm-managed-mappings-may-not-set-vma_io_bit.patch
mm-remove-vma_io_bit-check-in-vma_is_mm_managed.patch
mm-remove-hugetlb_inlineh.patch
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
mm-drop-some-redundant-checks-around-hugetlb-vmas.patch
mm-madvise-update-is_valid_guard_vma-to-use-vma_can_merge.patch
mm-vma-introduce-vma_is_mm_backed.patch
mm-uffd-use-predicates-for-userfaultfd-checks.patch
mm-madvise-use-predicates-for-madvise-madv_dofork.patch
mm-eliminate-vma_special_flags-usage-when-hugetlb-explicitly-tested.patch
mm-eliminate-vma_special_flags-check-in-lru_gen_look_around.patch
mm-avoid-use-of-vma_special_flags-in-migrate_vma_setup.patch
mm-eliminate-vm_special-vma_special_flags.patch
fuse-dax-do-not-set-vm_mixedmap.patch
mm-huge_memory-remove-vma_is_special_huge.patch
mm-vma-const-ify-vma_assert_stabilised-and-associated-functions.patch
mm-implement-and-use-vma_has_anon_rmap-silence-kcsan.patch
mm-update-comments-to-refer-to-anon-rmap-rather-than-anon_vma.patch
mm-vma-dont-remove-vma-from-rmap-if-pgoff-unchanged.patch
^ permalink raw reply [flat|nested] 4+ messages in thread* + mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch added to mm-unstable branch
@ 2026-10-03 23:59 Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-10-03 23:59 UTC (permalink / raw)
To: mm-commits, ljs, akpm
The patch titled
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
has been added to the -mm mm-unstable branch. Its filename is
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
Date: Sat, 03 Oct 2026 17:32:58 +0100
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.
Link: https://lore.kernel.org/20261003-b4-mmap-prepare-vma-flag-sanify-v4-27-a1f052500fd7@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Anup Patel <anup@brainfault.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Nico Pache <nico.pache@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>
Cc: Martin K. Petersen <mkp@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Harry Yoo <harry@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Oliver Upton <oupton@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Paul Walmsley <pjw@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Xu Xin <xu.xin@linux.dev>
---
arch/arm64/kvm/mmu.c | 2 -
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, 91 insertions(+), 78 deletions(-)
--- a/arch/arm64/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/arm64/kvm/mmu.c
@@ -1470,7 +1470,7 @@ transparent_hugepage_adjust(struct kvm *
static int get_vma_page_shift(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return huge_page_shift(hstate_vma(vma));
return PAGE_SHIFT;
--- a/arch/powerpc/mm/book3s64/radix_tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -627,7 +627,7 @@ void radix__local_flush_tlb_page(struct
{
#ifdef CONFIG_HUGETLB_PAGE
/* need the return fix for nohash.c */
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__local_flush_hugetlb_page(vma, vmaddr);
#endif
radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -945,7 +945,7 @@ void radix__flush_tlb_page_psize(struct
void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_page(vma, vmaddr);
#endif
radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -1113,7 +1113,7 @@ void radix__flush_tlb_range(struct vm_ar
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_tlb_range(vma, start, end);
#endif
--- a/arch/powerpc/mm/nohash/e500_hugetlbpage.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/e500_hugetlbpage.c
@@ -180,7 +180,7 @@ book3e_hugetlb_preload(struct vm_area_st
*/
void __update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
book3e_hugetlb_preload(vma, address, *ptep);
}
--- a/arch/powerpc/mm/nohash/tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/tlb.c
@@ -278,7 +278,7 @@ void __flush_tlb_page(struct mm_struct *
void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (vma && is_vm_hugetlb_page(vma))
+ if (vma && vma_is_hugetlb(vma))
flush_hugetlb_page(vma, vmaddr);
#endif
--- a/arch/riscv/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/kvm/mmu.c
@@ -665,7 +665,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *v
return -EFAULT;
}
- is_hugetlb = is_vm_hugetlb_page(vma);
+ is_hugetlb = vma_is_hugetlb(vma);
if (is_hugetlb)
vma_pageshift = huge_page_shift(hstate_vma(vma));
else
--- a/arch/riscv/mm/tlbflush.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/mm/tlbflush.c
@@ -149,7 +149,7 @@ void flush_tlb_range(struct vm_area_stru
{
unsigned long stride_size;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
stride_size = PAGE_SIZE;
} else {
stride_size = huge_page_size(hstate_vma(vma));
--- a/arch/s390/mm/gmap_helpers.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/s390/mm/gmap_helpers.c
@@ -102,7 +102,7 @@ __context_unsafe(/* pte_unmap_unlock() n
/* 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_struc
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_zeropag
* 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))
continue;
addr = vma->vm_start;
--- a/arch/sparc/mm/init_64.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/sparc/mm/init_64.c
@@ -413,7 +413,7 @@ void update_mmu_cache_range(struct vm_fa
if (mm->context.hugetlb_pte_count || mm->context.thp_pte_count) {
unsigned long hugepage_size = PAGE_SIZE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugepage_size = huge_page_size(hstate_vma(vma));
if (hugepage_size >= PUD_SIZE) {
--- a/drivers/gpu/drm/drm_gpusvm.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/drivers/gpu/drm/drm_gpusvm.c
@@ -1142,7 +1142,7 @@ drm_gpusvm_range_find_or_insert(struct d
* have to change.
*/
migrate_devmem = ctx->devmem_possible &&
- vma_is_anonymous(vas) && !is_vm_hugetlb_page(vas);
+ vma_is_anonymous(vas) && !vma_is_hugetlb(vas);
chunk_size = drm_gpusvm_range_chunk_size(gpusvm, notifier, vas,
fault_addr, gpuva_start,
--- a/fs/coredump.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/coredump.c
@@ -1608,7 +1608,7 @@ static unsigned long vma_dump_size(struc
}
/* Hugetlb memory check */
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
goto whole;
if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
--- a/fs/hugetlbfs/inode.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/hugetlbfs/inode.c
@@ -108,7 +108,7 @@ static int hugetlbfs_file_mmap(struct fi
* vma address alignment (but not the pgoff alignment) has
* already been checked by prepare_hugepage_range. If you add
* any error returns here, do so after setting VM_HUGETLB, so
- * is_vm_hugetlb_page tests below unmap_region go the right
+ * vma_is_hugetlb tests below unmap_region go the right
* way when do_mmap unwinds (may be important on powerpc
* and ia64).
*/
--- a/fs/proc/task_mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/proc/task_mmu.c
@@ -3015,7 +3015,7 @@ static int pagemap_scan_pte_hole(unsigne
* hugetlb differs, see pagemap_hugetlb_category().
*/
categories = p->cur_vma_category;
- if (userfaultfd_wp(vma) && !is_vm_hugetlb_page(vma))
+ if (userfaultfd_wp(vma) && !vma_is_hugetlb(vma))
categories |= PAGE_IS_WRITTEN;
if (!pagemap_scan_is_interesting_page(categories, p))
@@ -3028,7 +3028,7 @@ static int pagemap_scan_pte_hole(unsigne
if (~p->arg.flags & PM_SCAN_WP_MATCHING)
return ret;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
err = pagemap_scan_hugetlb_hole_wp(vma, addr, end);
else
err = uffd_wp_range(vma, addr, end - addr, true);
@@ -3470,7 +3470,7 @@ static int show_numa_map(struct seq_file
seq_puts(m, " stack");
}
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
seq_puts(m, " huge");
/* Skip walking pages if gate VMA */
@@ -3499,7 +3499,7 @@ static int show_numa_map(struct seq_file
if (md->swapcache)
seq_printf(m, " swapcache=%lu", md->swapcache);
- if (md->active < md->pages && !is_vm_hugetlb_page(vma))
+ if (md->active < md->pages && !vma_is_hugetlb(vma))
seq_printf(m, " active=%lu", md->active);
if (md->writeback)
--- a/include/asm-generic/tlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/asm-generic/tlb.h
@@ -438,7 +438,7 @@ tlb_update_vma_flags(struct mmu_gather *
* We rely on tlb_end_vma() to issue a flush, such that when we reset
* these values the batch is empty.
*/
- tlb->vma_huge = is_vm_hugetlb_page(vma);
+ tlb->vma_huge = vma_is_hugetlb(vma);
tlb->vma_exec = !!(vma->vm_flags & VM_EXEC);
/*
--- a/include/linux/hugetlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/hugetlb.h
@@ -251,14 +251,14 @@ extern void __hugetlb_zap_end(struct vm_
static inline void hugetlb_zap_begin(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_begin(vma, start, end);
}
static inline void hugetlb_zap_end(struct vm_area_struct *vma,
struct zap_details *details)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_end(vma, details);
}
--- a/include/linux/mm.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/mm.h
@@ -1610,15 +1610,28 @@ static inline bool vma_is_shared_maywrit
return is_shared_maywrite(&vma->flags);
}
-static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
+/**
+ * vma_flags_is_hugetlb() - Do the specified VMA flags indicate that the
+ * VMA is a hugetlb mapping?
+ * @flags: The VMA flags to test.
+ *
+ * Returns: true if the flags indicate a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_flags_is_hugetlb(const vma_flags_t *flags)
{
return IS_ENABLED(CONFIG_HUGETLB_PAGE) &&
vma_flags_test(flags, VMA_HUGETLB_BIT);
}
-static inline bool is_vm_hugetlb_page(const struct vm_area_struct *vma)
+/**
+ * vma_is_hugetlb() - Is @vma a hugetlb mapping?
+ * @vma: The VMA to test.
+ *
+ * Returns: true if @vma is a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_is_hugetlb(const struct vm_area_struct *vma)
{
- return is_vma_hugetlb_flags(&vma->flags);
+ return vma_flags_is_hugetlb(&vma->flags);
}
/**
--- a/include/linux/rmap.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/rmap.h
@@ -888,7 +888,7 @@ struct page_vma_mapped_walk {
static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw)
{
/* HugeTLB pte is set to the relevant page table entry without pte_mapped. */
- if (pvmw->pte && !is_vm_hugetlb_page(pvmw->vma))
+ if (pvmw->pte && !vma_is_hugetlb(pvmw->vma))
pte_unmap(pvmw->pte);
if (pvmw->ptl)
spin_unlock(pvmw->ptl);
--- a/kernel/events/core.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/events/core.c
@@ -9818,7 +9818,7 @@ static void perf_event_mmap_event(struct
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
flags |= MAP_HUGETLB;
if (file) {
--- a/kernel/sched/fair.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/sched/fair.c
@@ -4416,7 +4416,7 @@ retry_pids:
for (; vma; vma = vma_next(&vmi)) {
if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
- is_vm_hugetlb_page(vma) || !vma_is_mm_managed(vma)) {
+ vma_is_hugetlb(vma) || !vma_is_mm_managed(vma)) {
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_UNSUITABLE);
continue;
}
--- a/mm/gup.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/gup.c
@@ -621,7 +621,7 @@ static struct page *no_page_table(struct
* But we can only make this optimization where a hole would surely
* be zero-filled if handle_mm_fault() actually did handle it.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
struct hstate *h = hstate_vma(vma);
if (!hugetlbfs_pagecache_present(h, vma, address))
@@ -1213,7 +1213,7 @@ static int check_vma_flags(struct vm_are
if ((gup_flags & FOLL_LONGTERM) && vma_is_fsdax(vma))
return -EOPNOTSUPP;
- if ((gup_flags & FOLL_SPLIT_PMD) && is_vm_hugetlb_page(vma))
+ if ((gup_flags & FOLL_SPLIT_PMD) && vma_is_hugetlb(vma))
return -EOPNOTSUPP;
if (vma_is_secretmem(vma))
--- a/mm/huge_memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/huge_memory.c
@@ -4792,7 +4792,7 @@ static inline bool vma_not_suitable_for_
return true;
if (vma_test(vma, VMA_IO_BIT))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
return false;
--- a/mm/hugetlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/hugetlb.c
@@ -1147,7 +1147,7 @@ static inline struct resv_map *inode_res
static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
if (vma->vm_flags & VM_MAYSHARE) {
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host;
@@ -1162,7 +1162,7 @@ static struct resv_map *vma_resv_map(str
static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, (unsigned long)map);
@@ -1170,7 +1170,7 @@ static void set_vma_resv_map(struct vm_a
static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, get_vma_private_data(vma) | flags);
@@ -1178,7 +1178,7 @@ static void set_vma_resv_flags(struct vm
static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
return (get_vma_private_data(vma) & flag) != 0;
}
@@ -1192,7 +1192,7 @@ bool __vma_private_lock(struct vm_area_s
void hugetlb_dup_vma_private(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
/*
* Clear vm_private_data
* - For shared mappings this is a per-vma semaphore that may be
@@ -5276,7 +5276,7 @@ void __unmap_hugepage_range(struct mmu_g
unsigned long last_addr_mask;
i_mmap_assert_write_locked(vma->vm_file->f_mapping);
- WARN_ON(!is_vm_hugetlb_page(vma));
+ WARN_ON(!vma_is_hugetlb(vma));
BUG_ON(start & ~huge_page_mask(h));
BUG_ON(end & ~huge_page_mask(h));
@@ -7502,6 +7502,6 @@ void hugetlb_unshare_all_pmds(struct vm_
*/
void fixup_hugetlb_reservations(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
clear_vma_resv_huge_pages(vma);
}
--- a/mm/internal.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/internal.h
@@ -1116,7 +1116,7 @@ static inline bool vma_supports_mlock(co
return false;
if (vma_test_single_mask(vma, VMA_DROPPABLE))
return false;
- if (vma_is_dax(vma) || is_vm_hugetlb_page(vma))
+ if (vma_is_dax(vma) || vma_is_hugetlb(vma))
return false;
return vma != get_gate_vma(current->mm);
}
--- a/mm/madvise.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/madvise.c
@@ -881,7 +881,7 @@ bool madvise_dontneed_free_valid_vma(str
int behavior = madv_behavior->behavior;
struct madvise_behavior_range *range = &madv_behavior->range;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
unsigned int forbidden = VM_PFNMAP;
if (behavior != MADV_DONTNEED_LOCKED)
@@ -1579,7 +1579,7 @@ static int madvise_vma_behavior(struct m
new_flags |= VM_DONTDUMP;
break;
case MADV_DODUMP:
- if ((!is_vm_hugetlb_page(vma) && (new_flags & VM_SPECIAL)) ||
+ if ((!vma_is_hugetlb(vma) && (new_flags & VM_SPECIAL)) ||
(new_flags & VM_DROPPABLE))
return -EINVAL;
new_flags &= ~VM_DONTDUMP;
--- a/mm/memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/memory.c
@@ -1564,7 +1564,7 @@ copy_page_range(struct vm_area_struct *d
if (!vma_needs_copy(dst_vma, src_vma))
return 0;
- if (is_vm_hugetlb_page(src_vma))
+ if (vma_is_hugetlb(src_vma))
return copy_hugetlb_page_range(dst_mm, src_mm, dst_vma, src_vma);
/*
@@ -2178,7 +2178,7 @@ static void __zap_vma_range(struct mmu_g
if (vma->vm_file && !reaping)
uprobe_munmap(vma, start, end);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
zap_flags_t zap_flags = details ? details->zap_flags : 0;
VM_WARN_ON_ONCE(reaping);
@@ -2313,7 +2313,7 @@ void zap_vma_range_batched(struct mmu_ga
*/
__zap_vma_range(tlb, vma, address, end, details);
mmu_notifier_invalidate_range_end(&range);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
/*
* flush tlb and free resources before hugetlb_zap_end(), to
* avoid concurrent page faults' allocation failure.
@@ -6934,7 +6934,7 @@ vm_fault_t handle_mm_fault(struct vm_are
lru_gen_enter_fault(vma);
- if (unlikely(is_vm_hugetlb_page(vma)))
+ if (unlikely(vma_is_hugetlb(vma)))
ret = hugetlb_fault(vma->vm_mm, vma, address, flags);
else
ret = __handle_mm_fault(vma, address, flags);
@@ -7804,12 +7804,12 @@ void ptlock_free(struct ptdesc *ptdesc)
void vma_pgtable_walk_begin(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
}
void vma_pgtable_walk_end(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_unlock_read(vma);
}
--- a/mm/mempolicy.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mempolicy.c
@@ -2018,7 +2018,7 @@ bool vma_migratable(struct vm_area_struc
if (vma_is_dax(vma))
return false;
- if (is_vm_hugetlb_page(vma) &&
+ if (vma_is_hugetlb(vma) &&
!hugepage_migration_supported(hstate_vma(vma)))
return false;
--- a/mm/migrate_device.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/migrate_device.c
@@ -743,7 +743,7 @@ int migrate_vma_setup(struct migrate_vma
args->start &= PAGE_MASK;
args->end &= PAGE_MASK;
- if (!args->vma || is_vm_hugetlb_page(args->vma) ||
+ if (!args->vma || vma_is_hugetlb(args->vma) ||
(args->vma->vm_flags & VM_SPECIAL) || vma_is_dax(args->vma))
return -EINVAL;
if (nr_pages <= 0)
--- a/mm/mmap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmap.c
@@ -1786,7 +1786,7 @@ __latent_entropy int dup_mmap(struct mm_
/*
* Copy/update hugetlb private vma information.
*/
- if (is_vm_hugetlb_page(tmp))
+ if (vma_is_hugetlb(tmp))
hugetlb_dup_vma_private(tmp);
/*
--- a/mm/mmu_gather.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmu_gather.c
@@ -480,7 +480,7 @@ void tlb_gather_mmu_vma(struct mmu_gathe
{
tlb_gather_mmu(tlb, vma->vm_mm);
tlb_update_vma_flags(tlb, vma);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
/* All entries have the same size. */
tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
}
--- a/mm/mprotect.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mprotect.c
@@ -717,7 +717,7 @@ long change_protection(struct mmu_gather
(cp_flags & MM_CP_UFFD_RWP))
newprot = PAGE_NONE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
pages = hugetlb_change_protection(vma, start, end, newprot,
cp_flags);
else
--- a/mm/mremap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mremap.c
@@ -812,7 +812,7 @@ unsigned long move_page_tables(struct pa
if (!pmc->len_in)
return 0;
- if (is_vm_hugetlb_page(pmc->old))
+ if (vma_is_hugetlb(pmc->old))
return move_hugetlb_page_tables(pmc->old, pmc->new, pmc->old_addr,
pmc->new_addr, pmc->len_in);
@@ -1769,7 +1769,7 @@ static bool vma_multi_allowed(struct vm_
/* Known good. */
if (vma_is_shmem(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (file->f_op->get_unmapped_area == thp_get_unmapped_area)
return true;
@@ -1792,7 +1792,7 @@ static int check_prep_vma(struct vma_rem
return -EPERM;
/* Align to hugetlb page size, if required. */
- if (is_vm_hugetlb_page(vma) && !align_hugetlb(vrm))
+ if (vma_is_hugetlb(vma) && !align_hugetlb(vrm))
return -EINVAL;
vrm_set_delta(vrm);
--- a/mm/page_vma_mapped.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/page_vma_mapped.c
@@ -109,7 +109,7 @@ static bool check_pte(struct page_vma_ma
unsigned long pfn;
pte_t ptent;
- if (is_vm_hugetlb_page(pvmw->vma))
+ if (vma_is_hugetlb(pvmw->vma))
ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
pvmw->pte);
else
@@ -206,7 +206,7 @@ bool page_vma_mapped_walk(struct page_vm
if (pvmw->pmd && !pvmw->pte)
return not_found(pvmw);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
struct hstate *hstate = hstate_vma(vma);
unsigned long size = huge_page_size(hstate);
/* The only possible mapping was handled on last iteration */
--- a/mm/pagewalk.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/pagewalk.c
@@ -408,7 +408,7 @@ static int __walk_page_range(unsigned lo
int err = 0;
struct vm_area_struct *vma = walk->vma;
const struct mm_walk_ops *ops = walk->ops;
- bool is_hugetlb = is_vm_hugetlb_page(vma);
+ bool is_hugetlb = vma_is_hugetlb(vma);
/* We do not support hugetlb PTE installation. */
if (ops->install_pte && is_hugetlb)
--- a/mm/swapfile.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/swapfile.c
@@ -2707,7 +2707,7 @@ static int unuse_mm(struct mm_struct *mm
if (check_stable_address_space(mm))
goto unlock;
for_each_vma(vmi, vma) {
- if (vma->anon_vma && !is_vm_hugetlb_page(vma)) {
+ if (vma->anon_vma && !vma_is_hugetlb(vma)) {
ret = unuse_vma(vma, type);
if (ret)
break;
--- a/mm/userfaultfd.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/userfaultfd.c
@@ -237,7 +237,7 @@ static int mfill_get_vma(struct mfill_st
if ((flags & MFILL_ATOMIC_WP) && !(dst_vma->vm_flags & VM_UFFD_WP))
goto out_unlock;
- if (is_vm_hugetlb_page(dst_vma))
+ if (vma_is_hugetlb(dst_vma))
return 0;
ops = vma_uffd_ops(dst_vma);
@@ -804,7 +804,7 @@ retry:
}
err = -ENOENT;
- if (!is_vm_hugetlb_page(dst_vma))
+ if (!vma_is_hugetlb(dst_vma))
goto out_unlock_vma;
err = -EINVAL;
@@ -967,7 +967,7 @@ static __always_inline ssize_t mfill_ato
/*
* If this is a HUGETLB vma, pass off to appropriate routine
*/
- if (is_vm_hugetlb_page(state.vma))
+ if (vma_is_hugetlb(state.vma))
return mfill_atomic_hugetlb(ctx, state.vma, dst_start,
src_start, len, flags);
@@ -1114,7 +1114,7 @@ static int mwriteprotect_range(struct us
break;
}
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
err = -EINVAL;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
if ((start & page_mask) || (len & page_mask))
@@ -1172,7 +1172,7 @@ int mrwprotect_range(struct userfaultfd_
if (!userfaultfd_rwp(dst_vma))
return -ENOENT;
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
unsigned long page_mask;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
@@ -2150,7 +2150,7 @@ static bool vma_can_userfault(struct vm_
if (vma->vm_flags & (VM_DROPPABLE | VM_SHADOW_STACK))
return false;
- if (!is_vm_hugetlb_page(vma) && (vma->vm_flags & VM_SPECIAL))
+ if (!vma_is_hugetlb(vma) && (vma->vm_flags & VM_SPECIAL))
return false;
vm_flags &= __VM_UFFD_FLAGS;
@@ -2320,7 +2320,7 @@ static int userfaultfd_register_range(st
*/
userfaultfd_set_ctx(vma, ctx, vm_flags);
- if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma))
+ if (vma_is_hugetlb(vma) && uffd_disable_huge_pmd_share(vma))
hugetlb_unshare_all_pmds(vma);
skip:
@@ -2896,7 +2896,7 @@ vm_fault_t handle_userfault(struct vm_fa
* (sleepable) vma lock can modify the current task state, that
* must be before explicitly calling set_current_state().
*/
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
spin_lock_irq(&ctx->fault_pending_wqh.lock);
@@ -2913,7 +2913,7 @@ vm_fault_t handle_userfault(struct vm_fa
set_current_state(blocking_state);
spin_unlock_irq(&ctx->fault_pending_wqh.lock);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
must_wait = userfaultfd_huge_must_wait(ctx, vmf, reason);
hugetlb_vma_unlock_read(vma);
} else {
@@ -3745,7 +3745,7 @@ static int userfaultfd_register(struct u
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
@@ -3796,7 +3796,7 @@ static int userfaultfd_register(struct u
* If this vma contains ending address, and huge pages
* check alignment.
*/
- if (is_vm_hugetlb_page(cur) && end <= cur->vm_end &&
+ if (vma_is_hugetlb(cur) && end <= cur->vm_end &&
end > cur->vm_start) {
unsigned long vma_hpagesize = vma_kernel_pagesize(cur);
@@ -3832,7 +3832,7 @@ static int userfaultfd_register(struct u
/*
* Note vmas containing huge pages
*/
- if (is_vm_hugetlb_page(cur))
+ if (vma_is_hugetlb(cur))
basic_ioctls = true;
found = true;
@@ -3918,7 +3918,7 @@ static int userfaultfd_unregister(struct
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
--- a/mm/vma.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vma.c
@@ -599,7 +599,7 @@ __split_vma(struct vma_iterator *vmi, st
* boundary.
*/
vma_adjust_trans_huge(vma, vma->vm_start, addr, NULL);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_split(vma, addr);
if (new_below) {
@@ -2251,7 +2251,7 @@ bool vma_wants_writenotify(struct vm_are
* Do we need to track softdirty? hugetlb does not support softdirty
* tracking yet.
*/
- if (vma_soft_dirty_enabled(vma) && !is_vm_hugetlb_page(vma))
+ if (vma_soft_dirty_enabled(vma) && !vma_is_hugetlb(vma))
return true;
/* Do we need write faults for uffd-wp tracking? */
@@ -2370,7 +2370,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- is_vm_hugetlb_page(vma))
+ vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
@@ -2379,7 +2379,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- !is_vm_hugetlb_page(vma))
+ !vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
--- a/mm/vmscan.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vmscan.c
@@ -3474,7 +3474,7 @@ static int should_skip_vma(unsigned long
if (!vma_is_accessible(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (!vma_has_recency(vma))
--- a/tools/testing/vma/include/stubs.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/tools/testing/vma/include/stubs.h
@@ -193,7 +193,7 @@ static inline bool mapping_can_writeback
return true;
}
-static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
+static inline bool vma_is_hugetlb(struct vm_area_struct *vma)
{
return false;
}
_
Patches currently in -mm which might be from ljs@kernel.org are
mm-mremap-fix-locked_vm-leak-from-mremap_dontunmap-self-merge.patch
mm-mremap-fix-locked_vm-leak-by-splitting-vma-for-mremap_dontunmap.patch
drivers-char-mem-mmap-readonly-map_shared-dev-zero-correctly.patch
mm-vmpressure-remove-window-size-todo.patch
tools-testing-selftests-mm-add-missing-gitignore-entries.patch
mm-move-drivers-char-memc-to-mm-char-memc.patch
mm-implement-file_is_dev_zero-to-uniquely-identify-dev-zero.patch
mm-vma-only-permit-map_private-dev-zero-to-be-mapped-anonymous.patch
mm-vma-make-map_private-mapped-dev-zero-mappings-truly-anonymous.patch
tools-testing-vma-add-test-to-assert-map_private-dev-zero-is-anon.patch
tools-testing-selftests-mm-add-map_private-dev-zero-merge-tests.patch
mm-madvise-swap-in-cowd-map_private-file-mappings-on-madv_willneed.patch
mm-khugepaged-deposit-a-newly-allocated-page-table-on-collapse.patch
mm-enable-mmu_gather_rcu_table_free-for-most-2-level-architectures.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-riscv.patch
mm-enable-mmu_gather_rcu_table_free-for-mmu-arm.patch
mm-enable-mmu_gather_rcu_table_free-for-arc-microblaze-xtensa.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc64.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-coldfire.patch
mm-enable-mmu_gather_rcu_table_free-for-sh-x2.patch
mm-enable-mmu_gather_rcu_table_free-for-m68k-motorola.patch
mm-enable-mmu_gather_rcu_table_free-for-sparc32.patch
mm-userland-pgtable-freeing-is-rcu-safe-now-remove-leftover-bits.patch
mm-change-the-contract-for-free_pgtables-update-docs.patch
mm-vma-fix-mmap_prepare-file-handling-remove-file_doesnt_need_get.patch
mm-vma-introduce-and-use-vma_can_merge.patch
mm-consistently-validate-vma-state-after-mmap-hooks.patch
mm-vma-ensure-mmap_prepare-doesnt-set-actions-on-a-mergeable-vma.patch
mm-make-map_kernel_pages_-internal-and-unexported.patch
mm-vma-tidy-up-map-kernel-pages-enum-values.patch
mm-add-mmap-action-for-discontiguous-kernel-page-mapping.patch
docs-filesystems-update-mmap_prepare-docs-for-discontig-kernel-pgs.patch
drivers-usb-mon-update-to-use-mmap_prepare-map-kernel-pages.patch
infiniband-update-hfi1-to-use-remap_vmalloc_range.patch
selinux-reject-writable-opens-of-policy-file-drop-mmap-shared-write-check.patch
alsa-pcm-use-vm_insert_page-to-map-pcm-status-page.patch
bpf-arena-mark-arena_map_mmap-mappings-vm_mixedmap.patch
mm-vma-add-vma_is_mm_managed-predicates.patch
mm-vma-only-allow-mmap-to-clear-vma_maywrite_bit-if-not-mm-managed.patch
mm-vma-add-and-use-vma__is_fixed_mapping.patch
scsi-sg-convert-mmap-hook-to-mmap_prepare-and-rework.patch
fbdev-defio-assert-fbinfo_virtfb-drop-vm_io-add-vm_mixedmap.patch
hsi-cmt_speech-convert-mmap-hook-to-mmap_prepare-refactor.patch
mm-gup-error-out-early-on-vma_mayread_bit-vmas.patch
uprobes-remove-vm_io-set-vm_mixedmap-for-mapped-kernel-pages.patch
mm-mlock-clear-vma_locked_mask-over-mmap-callback.patch
mm-mlock-eliminate-weird-vma_io_bit-abuse-and-simplify.patch
mm-vma-enforce-that-mm-managed-mappings-may-not-set-vma_io_bit.patch
mm-remove-vma_io_bit-check-in-vma_is_mm_managed.patch
mm-remove-hugetlb_inlineh.patch
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
mm-drop-some-redundant-checks-around-hugetlb-vmas.patch
mm-madvise-update-is_valid_guard_vma-to-use-vma_can_merge.patch
mm-vma-introduce-vma_is_mm_backed.patch
mm-uffd-use-predicates-for-userfaultfd-checks.patch
mm-madvise-use-predicates-for-madvise-madv_dofork.patch
mm-eliminate-vma_special_flags-usage-when-hugetlb-explicitly-tested.patch
mm-eliminate-vma_special_flags-check-in-lru_gen_look_around.patch
mm-avoid-use-of-vma_special_flags-in-migrate_vma_setup.patch
mm-eliminate-vm_special-vma_special_flags.patch
fuse-dax-do-not-set-vm_mixedmap.patch
mm-huge_memory-remove-vma_is_special_huge.patch
mm-vma-const-ify-vma_assert_stabilised-and-associated-functions.patch
mm-implement-and-use-vma_has_anon_rmap-silence-kcsan.patch
mm-update-comments-to-refer-to-anon-rmap-rather-than-anon_vma.patch
mm-vma-dont-remove-vma-from-rmap-if-pgoff-unchanged.patch
^ permalink raw reply [flat|nested] 4+ messages in thread* + mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch added to mm-unstable branch
@ 2026-10-10 22:02 Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-10-10 22:02 UTC (permalink / raw)
To: mm-commits, ljs, akpm
The patch titled
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
has been added to the -mm mm-unstable branch. Its filename is
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Subject: mm: rename is_vm_hugetlb_page() to vma_is_hugetlb()
Date: Fri, 09 Oct 2026 19:04:21 +0100
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.
Link: https://lore.kernel.org/20261009-b4-mmap-prepare-vma-flag-sanify-v5-27-923b70125b1e@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Anup Patel <anup@brainfault.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Nico Pache <nico.pache@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>
Cc: Martin K. Petersen <mkp@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Harry Yoo <harry@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Oliver Upton <oupton@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Paul Walmsley <pjw@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Xu Xin <xu.xin@linux.dev>
Cc: Ihor Solodrai <ihor.solodrai@linux.dev>
Cc: Bert Karwatzki <spasswolf@web.de>
---
arch/arm64/kvm/mmu.c | 2 -
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, 91 insertions(+), 78 deletions(-)
--- a/arch/arm64/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/arm64/kvm/mmu.c
@@ -1470,7 +1470,7 @@ transparent_hugepage_adjust(struct kvm *
static int get_vma_page_shift(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return huge_page_shift(hstate_vma(vma));
return PAGE_SHIFT;
--- a/arch/powerpc/mm/book3s64/radix_tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -627,7 +627,7 @@ void radix__local_flush_tlb_page(struct
{
#ifdef CONFIG_HUGETLB_PAGE
/* need the return fix for nohash.c */
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__local_flush_hugetlb_page(vma, vmaddr);
#endif
radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -945,7 +945,7 @@ void radix__flush_tlb_page_psize(struct
void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_page(vma, vmaddr);
#endif
radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
@@ -1113,7 +1113,7 @@ void radix__flush_tlb_range(struct vm_ar
{
#ifdef CONFIG_HUGETLB_PAGE
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return radix__flush_hugetlb_tlb_range(vma, start, end);
#endif
--- a/arch/powerpc/mm/nohash/e500_hugetlbpage.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/e500_hugetlbpage.c
@@ -180,7 +180,7 @@ book3e_hugetlb_preload(struct vm_area_st
*/
void __update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
book3e_hugetlb_preload(vma, address, *ptep);
}
--- a/arch/powerpc/mm/nohash/tlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/powerpc/mm/nohash/tlb.c
@@ -278,7 +278,7 @@ void __flush_tlb_page(struct mm_struct *
void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
#ifdef CONFIG_HUGETLB_PAGE
- if (vma && is_vm_hugetlb_page(vma))
+ if (vma && vma_is_hugetlb(vma))
flush_hugetlb_page(vma, vmaddr);
#endif
--- a/arch/riscv/kvm/mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/kvm/mmu.c
@@ -665,7 +665,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *v
return -EFAULT;
}
- is_hugetlb = is_vm_hugetlb_page(vma);
+ is_hugetlb = vma_is_hugetlb(vma);
if (is_hugetlb)
vma_pageshift = huge_page_shift(hstate_vma(vma));
else
--- a/arch/riscv/mm/tlbflush.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/riscv/mm/tlbflush.c
@@ -149,7 +149,7 @@ void flush_tlb_range(struct vm_area_stru
{
unsigned long stride_size;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
stride_size = PAGE_SIZE;
} else {
stride_size = huge_page_size(hstate_vma(vma));
--- a/arch/s390/mm/gmap_helpers.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/s390/mm/gmap_helpers.c
@@ -102,7 +102,7 @@ __context_unsafe(/* pte_unmap_unlock() n
/* 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_struc
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_zeropag
* 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))
continue;
addr = vma->vm_start;
--- a/arch/sparc/mm/init_64.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/arch/sparc/mm/init_64.c
@@ -413,7 +413,7 @@ void update_mmu_cache_range(struct vm_fa
if (mm->context.hugetlb_pte_count || mm->context.thp_pte_count) {
unsigned long hugepage_size = PAGE_SIZE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugepage_size = huge_page_size(hstate_vma(vma));
if (hugepage_size >= PUD_SIZE) {
--- a/drivers/gpu/drm/drm_gpusvm.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/drivers/gpu/drm/drm_gpusvm.c
@@ -1142,7 +1142,7 @@ drm_gpusvm_range_find_or_insert(struct d
* have to change.
*/
migrate_devmem = ctx->devmem_possible &&
- vma_is_anonymous(vas) && !is_vm_hugetlb_page(vas);
+ vma_is_anonymous(vas) && !vma_is_hugetlb(vas);
chunk_size = drm_gpusvm_range_chunk_size(gpusvm, notifier, vas,
fault_addr, gpuva_start,
--- a/fs/coredump.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/coredump.c
@@ -1608,7 +1608,7 @@ static unsigned long vma_dump_size(struc
}
/* Hugetlb memory check */
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
goto whole;
if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
--- a/fs/hugetlbfs/inode.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/hugetlbfs/inode.c
@@ -108,7 +108,7 @@ static int hugetlbfs_file_mmap(struct fi
* vma address alignment (but not the pgoff alignment) has
* already been checked by prepare_hugepage_range. If you add
* any error returns here, do so after setting VM_HUGETLB, so
- * is_vm_hugetlb_page tests below unmap_region go the right
+ * vma_is_hugetlb tests below unmap_region go the right
* way when do_mmap unwinds (may be important on powerpc
* and ia64).
*/
--- a/fs/proc/task_mmu.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/fs/proc/task_mmu.c
@@ -2986,7 +2986,7 @@ static int pagemap_scan_pte_hole(unsigne
* hugetlb differs, see pagemap_hugetlb_category().
*/
categories = p->cur_vma_category;
- if (userfaultfd_wp(vma) && !is_vm_hugetlb_page(vma))
+ if (userfaultfd_wp(vma) && !vma_is_hugetlb(vma))
categories |= PAGE_IS_WRITTEN;
if (!pagemap_scan_is_interesting_page(categories, p))
@@ -2999,7 +2999,7 @@ static int pagemap_scan_pte_hole(unsigne
if (~p->arg.flags & PM_SCAN_WP_MATCHING)
return ret;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
err = pagemap_scan_hugetlb_hole_wp(vma, addr, end);
else
err = uffd_wp_range(vma, addr, end - addr, true);
@@ -3441,7 +3441,7 @@ static int show_numa_map(struct seq_file
seq_puts(m, " stack");
}
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
seq_puts(m, " huge");
/* Skip walking pages if gate VMA */
@@ -3470,7 +3470,7 @@ static int show_numa_map(struct seq_file
if (md->swapcache)
seq_printf(m, " swapcache=%lu", md->swapcache);
- if (md->active < md->pages && !is_vm_hugetlb_page(vma))
+ if (md->active < md->pages && !vma_is_hugetlb(vma))
seq_printf(m, " active=%lu", md->active);
if (md->writeback)
--- a/include/asm-generic/tlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/asm-generic/tlb.h
@@ -438,7 +438,7 @@ tlb_update_vma_flags(struct mmu_gather *
* We rely on tlb_end_vma() to issue a flush, such that when we reset
* these values the batch is empty.
*/
- tlb->vma_huge = is_vm_hugetlb_page(vma);
+ tlb->vma_huge = vma_is_hugetlb(vma);
tlb->vma_exec = !!(vma->vm_flags & VM_EXEC);
/*
--- a/include/linux/hugetlb.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/hugetlb.h
@@ -251,14 +251,14 @@ extern void __hugetlb_zap_end(struct vm_
static inline void hugetlb_zap_begin(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_begin(vma, start, end);
}
static inline void hugetlb_zap_end(struct vm_area_struct *vma,
struct zap_details *details)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
__hugetlb_zap_end(vma, details);
}
--- a/include/linux/mm.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/mm.h
@@ -1610,15 +1610,28 @@ static inline bool vma_is_shared_maywrit
return is_shared_maywrite(&vma->flags);
}
-static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)
+/**
+ * vma_flags_is_hugetlb() - Do the specified VMA flags indicate that the
+ * VMA is a hugetlb mapping?
+ * @flags: The VMA flags to test.
+ *
+ * Returns: true if the flags indicate a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_flags_is_hugetlb(const vma_flags_t *flags)
{
return IS_ENABLED(CONFIG_HUGETLB_PAGE) &&
vma_flags_test(flags, VMA_HUGETLB_BIT);
}
-static inline bool is_vm_hugetlb_page(const struct vm_area_struct *vma)
+/**
+ * vma_is_hugetlb() - Is @vma a hugetlb mapping?
+ * @vma: The VMA to test.
+ *
+ * Returns: true if @vma is a hugetlb mapping, false otherwise.
+ */
+static inline bool vma_is_hugetlb(const struct vm_area_struct *vma)
{
- return is_vma_hugetlb_flags(&vma->flags);
+ return vma_flags_is_hugetlb(&vma->flags);
}
/**
--- a/include/linux/rmap.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/include/linux/rmap.h
@@ -888,7 +888,7 @@ struct page_vma_mapped_walk {
static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw)
{
/* HugeTLB pte is set to the relevant page table entry without pte_mapped. */
- if (pvmw->pte && !is_vm_hugetlb_page(pvmw->vma))
+ if (pvmw->pte && !vma_is_hugetlb(pvmw->vma))
pte_unmap(pvmw->pte);
if (pvmw->ptl)
spin_unlock(pvmw->ptl);
--- a/kernel/events/core.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/events/core.c
@@ -9818,7 +9818,7 @@ static void perf_event_mmap_event(struct
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
flags |= MAP_HUGETLB;
if (file) {
--- a/kernel/sched/fair.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/kernel/sched/fair.c
@@ -4416,7 +4416,7 @@ retry_pids:
for (; vma; vma = vma_next(&vmi)) {
if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
- is_vm_hugetlb_page(vma) || !vma_is_mm_managed(vma)) {
+ vma_is_hugetlb(vma) || !vma_is_mm_managed(vma)) {
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_UNSUITABLE);
continue;
}
--- a/mm/gup.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/gup.c
@@ -621,7 +621,7 @@ static struct page *no_page_table(struct
* But we can only make this optimization where a hole would surely
* be zero-filled if handle_mm_fault() actually did handle it.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
struct hstate *h = hstate_vma(vma);
if (!hugetlbfs_pagecache_present(h, vma, address))
@@ -1213,7 +1213,7 @@ static int check_vma_flags(struct vm_are
if ((gup_flags & FOLL_LONGTERM) && vma_is_fsdax(vma))
return -EOPNOTSUPP;
- if ((gup_flags & FOLL_SPLIT_PMD) && is_vm_hugetlb_page(vma))
+ if ((gup_flags & FOLL_SPLIT_PMD) && vma_is_hugetlb(vma))
return -EOPNOTSUPP;
if (vma_is_secretmem(vma))
--- a/mm/huge_memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/huge_memory.c
@@ -4783,7 +4783,7 @@ static inline bool vma_not_suitable_for_
return true;
if (vma_test(vma, VMA_IO_BIT))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
return false;
--- a/mm/hugetlb.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/hugetlb.c
@@ -1147,7 +1147,7 @@ static inline struct resv_map *inode_res
static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
if (vma->vm_flags & VM_MAYSHARE) {
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host;
@@ -1162,7 +1162,7 @@ static struct resv_map *vma_resv_map(str
static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, (unsigned long)map);
@@ -1170,7 +1170,7 @@ static void set_vma_resv_map(struct vm_a
static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
{
- VM_WARN_ON_ONCE_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
VM_WARN_ON_ONCE_VMA(vma_test(vma, VMA_MAYSHARE_BIT), vma);
set_vma_private_data(vma, get_vma_private_data(vma) | flags);
@@ -1178,7 +1178,7 @@ static void set_vma_resv_flags(struct vm
static int is_vma_resv_set(struct vm_area_struct *vma, unsigned long flag)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
return (get_vma_private_data(vma) & flag) != 0;
}
@@ -1192,7 +1192,7 @@ bool __vma_private_lock(struct vm_area_s
void hugetlb_dup_vma_private(struct vm_area_struct *vma)
{
- VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma);
+ VM_WARN_ON_ONCE_VMA(!vma_is_hugetlb(vma), vma);
/*
* Clear vm_private_data
* - For shared mappings this is a per-vma semaphore that may be
@@ -5276,7 +5276,7 @@ void __unmap_hugepage_range(struct mmu_g
unsigned long last_addr_mask;
i_mmap_assert_write_locked(vma->vm_file->f_mapping);
- WARN_ON(!is_vm_hugetlb_page(vma));
+ WARN_ON(!vma_is_hugetlb(vma));
BUG_ON(start & ~huge_page_mask(h));
BUG_ON(end & ~huge_page_mask(h));
@@ -7502,6 +7502,6 @@ void hugetlb_unshare_all_pmds(struct vm_
*/
void fixup_hugetlb_reservations(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
clear_vma_resv_huge_pages(vma);
}
--- a/mm/internal.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/internal.h
@@ -1116,7 +1116,7 @@ static inline bool vma_supports_mlock(co
return false;
if (vma_test_single_mask(vma, VMA_DROPPABLE))
return false;
- if (vma_is_dax(vma) || is_vm_hugetlb_page(vma))
+ if (vma_is_dax(vma) || vma_is_hugetlb(vma))
return false;
return vma != get_gate_vma(current->mm);
}
--- a/mm/madvise.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/madvise.c
@@ -882,7 +882,7 @@ bool madvise_dontneed_free_valid_vma(str
int behavior = madv_behavior->behavior;
struct madvise_behavior_range *range = &madv_behavior->range;
- if (!is_vm_hugetlb_page(vma)) {
+ if (!vma_is_hugetlb(vma)) {
unsigned int forbidden = VM_PFNMAP;
if (behavior != MADV_DONTNEED_LOCKED)
@@ -1415,7 +1415,7 @@ static int madvise_vma_behavior(struct m
new_flags |= VM_DONTDUMP;
break;
case MADV_DODUMP:
- if ((!is_vm_hugetlb_page(vma) && (new_flags & VM_SPECIAL)) ||
+ if ((!vma_is_hugetlb(vma) && (new_flags & VM_SPECIAL)) ||
(new_flags & VM_DROPPABLE))
return -EINVAL;
new_flags &= ~VM_DONTDUMP;
--- a/mm/memory.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/memory.c
@@ -1564,7 +1564,7 @@ copy_page_range(struct vm_area_struct *d
if (!vma_needs_copy(dst_vma, src_vma))
return 0;
- if (is_vm_hugetlb_page(src_vma))
+ if (vma_is_hugetlb(src_vma))
return copy_hugetlb_page_range(dst_mm, src_mm, dst_vma, src_vma);
/*
@@ -2189,7 +2189,7 @@ static void __zap_vma_range(struct mmu_g
if (vma->vm_file && !reaping)
uprobe_munmap(vma, start, end);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
zap_flags_t zap_flags = details ? details->zap_flags : 0;
VM_WARN_ON_ONCE(reaping);
@@ -2324,7 +2324,7 @@ void zap_vma_range_batched(struct mmu_ga
*/
__zap_vma_range(tlb, vma, address, end, details);
mmu_notifier_invalidate_range_end(&range);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
/*
* flush tlb and free resources before hugetlb_zap_end(), to
* avoid concurrent page faults' allocation failure.
@@ -6950,7 +6950,7 @@ vm_fault_t handle_mm_fault(struct vm_are
lru_gen_enter_fault(vma);
- if (unlikely(is_vm_hugetlb_page(vma)))
+ if (unlikely(vma_is_hugetlb(vma)))
ret = hugetlb_fault(vma->vm_mm, vma, address, flags);
else
ret = __handle_mm_fault(vma, address, flags);
@@ -7820,12 +7820,12 @@ void ptlock_free(struct ptdesc *ptdesc)
void vma_pgtable_walk_begin(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
}
void vma_pgtable_walk_end(struct vm_area_struct *vma)
{
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_unlock_read(vma);
}
--- a/mm/mempolicy.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mempolicy.c
@@ -2018,7 +2018,7 @@ bool vma_migratable(struct vm_area_struc
if (vma_is_dax(vma))
return false;
- if (is_vm_hugetlb_page(vma) &&
+ if (vma_is_hugetlb(vma) &&
!hugepage_migration_supported(hstate_vma(vma)))
return false;
--- a/mm/migrate_device.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/migrate_device.c
@@ -743,7 +743,7 @@ int migrate_vma_setup(struct migrate_vma
args->start &= PAGE_MASK;
args->end &= PAGE_MASK;
- if (!args->vma || is_vm_hugetlb_page(args->vma) ||
+ if (!args->vma || vma_is_hugetlb(args->vma) ||
(args->vma->vm_flags & VM_SPECIAL) || vma_is_dax(args->vma))
return -EINVAL;
if (nr_pages <= 0)
--- a/mm/mmap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmap.c
@@ -1786,7 +1786,7 @@ __latent_entropy int dup_mmap(struct mm_
/*
* Copy/update hugetlb private vma information.
*/
- if (is_vm_hugetlb_page(tmp))
+ if (vma_is_hugetlb(tmp))
hugetlb_dup_vma_private(tmp);
/*
--- a/mm/mmu_gather.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mmu_gather.c
@@ -480,7 +480,7 @@ void tlb_gather_mmu_vma(struct mmu_gathe
{
tlb_gather_mmu(tlb, vma->vm_mm);
tlb_update_vma_flags(tlb, vma);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
/* All entries have the same size. */
tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
}
--- a/mm/mprotect.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mprotect.c
@@ -717,7 +717,7 @@ long change_protection(struct mmu_gather
(cp_flags & MM_CP_UFFD_RWP))
newprot = PAGE_NONE;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
pages = hugetlb_change_protection(vma, start, end, newprot,
cp_flags);
else
--- a/mm/mremap.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/mremap.c
@@ -812,7 +812,7 @@ unsigned long move_page_tables(struct pa
if (!pmc->len_in)
return 0;
- if (is_vm_hugetlb_page(pmc->old))
+ if (vma_is_hugetlb(pmc->old))
return move_hugetlb_page_tables(pmc->old, pmc->new, pmc->old_addr,
pmc->new_addr, pmc->len_in);
@@ -1769,7 +1769,7 @@ static bool vma_multi_allowed(struct vm_
/* Known good. */
if (vma_is_shmem(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (file->f_op->get_unmapped_area == thp_get_unmapped_area)
return true;
@@ -1792,7 +1792,7 @@ static int check_prep_vma(struct vma_rem
return -EPERM;
/* Align to hugetlb page size, if required. */
- if (is_vm_hugetlb_page(vma) && !align_hugetlb(vrm))
+ if (vma_is_hugetlb(vma) && !align_hugetlb(vrm))
return -EINVAL;
vrm_set_delta(vrm);
--- a/mm/page_vma_mapped.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/page_vma_mapped.c
@@ -109,7 +109,7 @@ static bool check_pte(struct page_vma_ma
unsigned long pfn;
pte_t ptent;
- if (is_vm_hugetlb_page(pvmw->vma))
+ if (vma_is_hugetlb(pvmw->vma))
ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
pvmw->pte);
else
@@ -206,7 +206,7 @@ bool page_vma_mapped_walk(struct page_vm
if (pvmw->pmd && !pvmw->pte)
return not_found(pvmw);
- if (unlikely(is_vm_hugetlb_page(vma))) {
+ if (unlikely(vma_is_hugetlb(vma))) {
struct hstate *hstate = hstate_vma(vma);
unsigned long size = huge_page_size(hstate);
/* The only possible mapping was handled on last iteration */
--- a/mm/pagewalk.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/pagewalk.c
@@ -408,7 +408,7 @@ static int __walk_page_range(unsigned lo
int err = 0;
struct vm_area_struct *vma = walk->vma;
const struct mm_walk_ops *ops = walk->ops;
- bool is_hugetlb = is_vm_hugetlb_page(vma);
+ bool is_hugetlb = vma_is_hugetlb(vma);
/* We do not support hugetlb PTE installation. */
if (ops->install_pte && is_hugetlb)
--- a/mm/swapfile.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/swapfile.c
@@ -2707,7 +2707,7 @@ static int unuse_mm(struct mm_struct *mm
if (check_stable_address_space(mm))
goto unlock;
for_each_vma(vmi, vma) {
- if (vma->anon_vma && !is_vm_hugetlb_page(vma)) {
+ if (vma->anon_vma && !vma_is_hugetlb(vma)) {
ret = unuse_vma(vma, type);
if (ret)
break;
--- a/mm/userfaultfd.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/userfaultfd.c
@@ -237,7 +237,7 @@ static int mfill_get_vma(struct mfill_st
if ((flags & MFILL_ATOMIC_WP) && !(dst_vma->vm_flags & VM_UFFD_WP))
goto out_unlock;
- if (is_vm_hugetlb_page(dst_vma))
+ if (vma_is_hugetlb(dst_vma))
return 0;
ops = vma_uffd_ops(dst_vma);
@@ -804,7 +804,7 @@ retry:
}
err = -ENOENT;
- if (!is_vm_hugetlb_page(dst_vma))
+ if (!vma_is_hugetlb(dst_vma))
goto out_unlock_vma;
err = -EINVAL;
@@ -967,7 +967,7 @@ static __always_inline ssize_t mfill_ato
/*
* If this is a HUGETLB vma, pass off to appropriate routine
*/
- if (is_vm_hugetlb_page(state.vma))
+ if (vma_is_hugetlb(state.vma))
return mfill_atomic_hugetlb(ctx, state.vma, dst_start,
src_start, len, flags);
@@ -1114,7 +1114,7 @@ static int mwriteprotect_range(struct us
break;
}
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
err = -EINVAL;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
if ((start & page_mask) || (len & page_mask))
@@ -1172,7 +1172,7 @@ int mrwprotect_range(struct userfaultfd_
if (!userfaultfd_rwp(dst_vma))
return -ENOENT;
- if (is_vm_hugetlb_page(dst_vma)) {
+ if (vma_is_hugetlb(dst_vma)) {
unsigned long page_mask;
page_mask = vma_kernel_pagesize(dst_vma) - 1;
@@ -2150,7 +2150,7 @@ static bool vma_can_userfault(struct vm_
if (vma->vm_flags & (VM_DROPPABLE | VM_SHADOW_STACK))
return false;
- if (!is_vm_hugetlb_page(vma) && (vma->vm_flags & VM_SPECIAL))
+ if (!vma_is_hugetlb(vma) && (vma->vm_flags & VM_SPECIAL))
return false;
vm_flags &= __VM_UFFD_FLAGS;
@@ -2320,7 +2320,7 @@ static int userfaultfd_register_range(st
*/
userfaultfd_set_ctx(vma, ctx, vm_flags);
- if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma))
+ if (vma_is_hugetlb(vma) && uffd_disable_huge_pmd_share(vma))
hugetlb_unshare_all_pmds(vma);
skip:
@@ -2896,7 +2896,7 @@ vm_fault_t handle_userfault(struct vm_fa
* (sleepable) vma lock can modify the current task state, that
* must be before explicitly calling set_current_state().
*/
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_vma_lock_read(vma);
spin_lock_irq(&ctx->fault_pending_wqh.lock);
@@ -2913,7 +2913,7 @@ vm_fault_t handle_userfault(struct vm_fa
set_current_state(blocking_state);
spin_unlock_irq(&ctx->fault_pending_wqh.lock);
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
must_wait = userfaultfd_huge_must_wait(ctx, vmf, reason);
hugetlb_vma_unlock_read(vma);
} else {
@@ -3745,7 +3745,7 @@ static int userfaultfd_register(struct u
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
@@ -3796,7 +3796,7 @@ static int userfaultfd_register(struct u
* If this vma contains ending address, and huge pages
* check alignment.
*/
- if (is_vm_hugetlb_page(cur) && end <= cur->vm_end &&
+ if (vma_is_hugetlb(cur) && end <= cur->vm_end &&
end > cur->vm_start) {
unsigned long vma_hpagesize = vma_kernel_pagesize(cur);
@@ -3832,7 +3832,7 @@ static int userfaultfd_register(struct u
/*
* Note vmas containing huge pages
*/
- if (is_vm_hugetlb_page(cur))
+ if (vma_is_hugetlb(cur))
basic_ioctls = true;
found = true;
@@ -3918,7 +3918,7 @@ static int userfaultfd_unregister(struct
* If the first vma contains huge pages, make sure start address
* is aligned to huge page size.
*/
- if (is_vm_hugetlb_page(vma)) {
+ if (vma_is_hugetlb(vma)) {
unsigned long vma_hpagesize = vma_kernel_pagesize(vma);
if (start & (vma_hpagesize - 1))
--- a/mm/vma.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vma.c
@@ -599,7 +599,7 @@ __split_vma(struct vma_iterator *vmi, st
* boundary.
*/
vma_adjust_trans_huge(vma, vma->vm_start, addr, NULL);
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
hugetlb_split(vma, addr);
if (new_below) {
@@ -2251,7 +2251,7 @@ bool vma_wants_writenotify(struct vm_are
* Do we need to track softdirty? hugetlb does not support softdirty
* tracking yet.
*/
- if (vma_soft_dirty_enabled(vma) && !is_vm_hugetlb_page(vma))
+ if (vma_soft_dirty_enabled(vma) && !vma_is_hugetlb(vma))
return true;
/* Do we need write faults for uffd-wp tracking? */
@@ -2370,7 +2370,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- is_vm_hugetlb_page(vma))
+ vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
@@ -2379,7 +2379,7 @@ int mm_take_all_locks(struct mm_struct *
if (signal_pending(current))
goto out_unlock;
if (vma->vm_file && vma->vm_file->f_mapping &&
- !is_vm_hugetlb_page(vma))
+ !vma_is_hugetlb(vma))
vm_lock_mapping(mm, vma->vm_file->f_mapping);
}
--- a/mm/vmscan.c~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/mm/vmscan.c
@@ -3515,7 +3515,7 @@ static int should_skip_vma(unsigned long
if (!vma_is_accessible(vma))
return true;
- if (is_vm_hugetlb_page(vma))
+ if (vma_is_hugetlb(vma))
return true;
if (!vma_has_recency(vma))
--- a/tools/testing/vma/include/stubs.h~mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb
+++ a/tools/testing/vma/include/stubs.h
@@ -193,7 +193,7 @@ static inline bool mapping_can_writeback
return true;
}
-static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
+static inline bool vma_is_hugetlb(struct vm_area_struct *vma)
{
return false;
}
_
Patches currently in -mm which might be from ljs@kernel.org are
mm-vma-fix-mmap_prepare-file-handling-remove-file_doesnt_need_get.patch
mm-vma-introduce-and-use-vma_can_merge.patch
mm-consistently-validate-vma-state-after-mmap-hooks.patch
mm-vma-ensure-mmap_prepare-doesnt-set-actions-on-a-mergeable-vma.patch
mm-make-map_kernel_pages_-internal-and-unexported.patch
mm-vma-tidy-up-map-kernel-pages-enum-values.patch
mm-add-mmap-action-for-discontiguous-kernel-page-mapping.patch
docs-filesystems-update-mmap_prepare-docs-for-discontig-kernel-pgs.patch
drivers-usb-mon-update-to-use-mmap_prepare-map-kernel-pages.patch
infiniband-update-hfi1-to-use-remap_vmalloc_range.patch
selinux-reject-writable-opens-of-policy-file-drop-mmap-shared-write-check.patch
alsa-pcm-use-vm_insert_page-to-map-pcm-status-page.patch
bpf-arena-mark-arena_map_mmap-mappings-vm_mixedmap.patch
mm-vma-add-vma_is_mm_managed-predicates.patch
mm-vma-only-allow-mmap-to-clear-vma_maywrite_bit-if-not-mm-managed.patch
mm-vma-add-and-use-vma__is_fixed_mapping.patch
scsi-sg-convert-mmap-hook-to-mmap_prepare-and-rework.patch
fbdev-defio-assert-fbinfo_virtfb-drop-vm_io-add-vm_mixedmap.patch
hsi-cmt_speech-convert-mmap-hook-to-mmap_prepare-refactor.patch
mm-gup-error-out-early-on-vma_mayread_bit-vmas.patch
uprobes-remove-vm_io-set-vm_mixedmap-for-mapped-kernel-pages.patch
mm-mlock-clear-vma_locked_mask-over-mmap-callback.patch
mm-mlock-eliminate-weird-vma_io_bit-abuse-and-simplify.patch
mm-vma-enforce-that-mm-managed-mappings-may-not-set-vma_io_bit.patch
mm-remove-vma_io_bit-check-in-vma_is_mm_managed.patch
mm-remove-hugetlb_inlineh.patch
mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch
mm-drop-some-redundant-checks-around-hugetlb-vmas.patch
mm-madvise-update-is_valid_guard_vma-to-use-vma_can_merge.patch
mm-vma-introduce-vma_is_mm_backed.patch
mm-uffd-use-predicates-for-userfaultfd-checks.patch
mm-madvise-use-predicates-for-madvise-madv_dofork.patch
mm-eliminate-vma_special_flags-usage-when-hugetlb-explicitly-tested.patch
mm-eliminate-vma_special_flags-check-in-lru_gen_look_around.patch
mm-avoid-use-of-vma_special_flags-in-migrate_vma_setup.patch
mm-eliminate-vm_special-vma_special_flags.patch
fuse-dax-do-not-set-vm_mixedmap.patch
mm-huge_memory-remove-vma_is_special_huge.patch
mm-vma-const-ify-vma_assert_stabilised-and-associated-functions.patch
mm-implement-and-use-vma_has_anon_rmap-silence-kcsan.patch
mm-update-comments-to-refer-to-anon-rmap-rather-than-anon_vma.patch
mm-vma-dont-remove-vma-from-rmap-if-pgoff-unchanged.patch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-10 22:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 21:25 + mm-rename-is_vm_hugetlb_page-to-vma_is_hugetlb.patch added to mm-unstable branch Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2026-10-03 23:35 Andrew Morton
2026-10-03 23:59 Andrew Morton
2026-10-10 22:02 Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.