From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03E751A9FA8 for ; Thu, 9 Jul 2026 22:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783635723; cv=none; b=l7vp34NAjwXqoU8LpAoWCgXzTKV0uE12b6J8Hg7CjvLErM5C/3lAsbsGM9I7dwSWtWUdckmMKW+oPg9WrcBSAKcieHsirP8uSds0wxIZwlX0fg8TpBookCdkzGT4FQHKhQ8sVIzGyzj9vyokGIw3iz9cSNBWybjNiCsAJsigJrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783635723; c=relaxed/simple; bh=I2znzbyzmH+h5by8MF8f0p2Nvf85HpWPtLDzOY8bLb0=; h=Date:To:From:Subject:Message-Id; b=SWgiDX5v9Kc68LnBQvg4nj0D3K93JRciaHmeBhD4akaBBICiCYaS8nc0v8rjOQVHupJ/OxkrHgHk7jPQvYQpD495lJ/SxOGix2w7ppPUMGelg7r/ExU507osVKGNomsiO9QHW/QteWZOWOBSeT5SkxAXOWp2lBRzfroINhMD2IM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=hi/SC/vS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="hi/SC/vS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9980B1F000E9; Thu, 9 Jul 2026 22:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783635721; bh=vPmYDNNJsNXkf5MfLTfN/NRjefuYSqHLHEq5saRjujU=; h=Date:To:From:Subject; b=hi/SC/vSxSGxhq3uKzq6JGFAtDYUGCINNeSY1YoBWabDOs4uASguwj6Ngu97exdmF u5obPC/h+PJi4isPbfjAnVjy/zVdxEi0UoCkYVlOZjCeznGadHXbeXBKa/G12iZ0XD PDGo4epu0gw1IqZQknVKAF9vDIsjBX5VVuBRgqWc= Date: Thu, 09 Jul 2026 15:22:01 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,vbabka@kernel.org,urezki@gmail.com,tj@kernel.org,surenb@google.com,pratyush@kernel.org,pasha.tatashin@soleen.com,osalvador@suse.de,muchun.song@linux.dev,mhocko@suse.com,ljs@kernel.org,liam@infradead.org,jackmanb@google.com,hannes@cmpxchg.org,graf@amazon.com,glider@google.com,elver@google.com,dvyukov@google.com,dennis@kernel.org,david@kernel.org,rppt@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-split-out-vmalloc-declarations-from-internalh.patch added to mm-new branch Message-Id: <20260709222201.9980B1F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: split out vmalloc declarations from internal.h has been added to the -mm mm-new branch. Its filename is mm-split-out-vmalloc-declarations-from-internalh.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-split-out-vmalloc-declarations-from-internalh.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next 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: "Mike Rapoport (Microsoft)" Subject: mm: split out vmalloc declarations from internal.h Date: Thu, 09 Jul 2026 13:00:05 +0300 mm/internal.h becomes more and more bloated. Move declarations related to vmalloc to a new mm/vmalloc.h header. No functional changes. Link: https://lore.kernel.org/20260709-internal-h-v2-3-695631425968@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Acked-by: Muchun Song Acked-by: Vlastimil Babka (SUSE) Acked-by: David Hildenbrand (Arm) Acked-by: Lorenzo Stoakes Acked-by: Pratyush Yadav Cc: Alexander Graf Cc: Alexander Potapenko Cc: Brendan Jackman Cc: Dennis Zhou Cc: Dmitry Vyukov Cc: Johannes Weiner Cc: Liam R. Howlett Cc: Marco Elver Cc: Michal Hocko Cc: Oscar Salvador Cc: Pasha Tatashin Cc: Suren Baghdasaryan Cc: Tejun Heo Cc: "Uladzislau Rezki (Sony)" Cc: Zi Yan Signed-off-by: Andrew Morton --- MAINTAINERS | 1 kernel/liveupdate/kexec_handover.c | 2 - mm/execmem.c | 1 mm/internal.h | 40 ----------------------- mm/kmsan/hooks.c | 1 mm/kmsan/shadow.c | 1 mm/mm_init.c | 1 mm/percpu-vm.c | 1 mm/vmalloc.c | 1 mm/vmalloc.h | 46 +++++++++++++++++++++++++++ 10 files changed, 54 insertions(+), 41 deletions(-) --- a/kernel/liveupdate/kexec_handover.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/kernel/liveupdate/kexec_handover.c @@ -34,8 +34,8 @@ * KHO is tightly coupled with mm init and needs access to some of mm * internal APIs. */ -#include "../../mm/internal.h" #include "../../mm/mm_init.h" +#include "../../mm/vmalloc.h" #include "../kexec_internal.h" #include "kexec_handover_internal.h" --- a/MAINTAINERS~mm-split-out-vmalloc-declarations-from-internalh +++ a/MAINTAINERS @@ -28815,6 +28815,7 @@ W: http://www.linux-mm.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm F: include/linux/vmalloc.h F: mm/vmalloc.c +F: mm/vmalloc.h F: lib/test_vmalloc.c VME SUBSYSTEM --- a/mm/execmem.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/execmem.c @@ -20,6 +20,7 @@ #include #include "internal.h" +#include "vmalloc.h" static struct execmem_info *execmem_info __ro_after_init; static struct execmem_info default_execmem_info __ro_after_init; --- a/mm/internal.h~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/internal.h @@ -1092,9 +1092,6 @@ static inline void mlock_new_folio(struc static inline bool need_mlock_drain(int cpu) { return false; } static inline void mlock_drain_local(void) { } static inline void mlock_drain_remote(int cpu) { } -static inline void vunmap_range_noflush(unsigned long start, unsigned long end) -{ -} #endif /* !CONFIG_MMU */ #define NODE_RECLAIM_NOSCAN -2 @@ -1209,37 +1206,6 @@ struct migration_target_control { size_t splice_folio_into_pipe(struct pipe_inode_info *pipe, struct folio *folio, loff_t fpos, size_t size); -/* - * mm/vmalloc.c - */ -#ifdef CONFIG_MMU -void __init vmalloc_init(void); -int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end, - pgprot_t prot, struct page **pages, unsigned int page_shift, gfp_t gfp_mask); -unsigned int get_vm_area_page_order(struct vm_struct *vm); -#else -static inline void vmalloc_init(void) -{ -} - -static inline -int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end, - pgprot_t prot, struct page **pages, unsigned int page_shift, gfp_t gfp_mask) -{ - return -EINVAL; -} -#endif - -void clear_vm_uninitialized_flag(struct vm_struct *vm); - -int __must_check __vmap_pages_range_noflush(unsigned long addr, - unsigned long end, pgprot_t prot, - struct page **pages, unsigned int page_shift); - -void vunmap_range_noflush(unsigned long start, unsigned long end); - -void __vunmap_range_noflush(unsigned long start, unsigned long end); - static inline bool vma_is_single_threaded_private(struct vm_area_struct *vma) { if (vma->vm_flags & VM_SHARED) @@ -1267,12 +1233,6 @@ int numa_migrate_check(struct folio *fol void free_zone_device_folio(struct folio *folio); int migrate_device_coherent_folio(struct folio *folio); -struct vm_struct *__get_vm_area_node(unsigned long size, - unsigned long align, unsigned long shift, - unsigned long vm_flags, unsigned long start, - unsigned long end, int node, gfp_t gfp_mask, - const void *caller); - /* * mm/gup.c */ --- a/mm/kmsan/hooks.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/kmsan/hooks.c @@ -21,6 +21,7 @@ #include #include "../internal.h" +#include "../vmalloc.h" #include "../slab.h" #include "kmsan.h" --- a/mm/kmsan/shadow.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/kmsan/shadow.c @@ -17,6 +17,7 @@ #include #include "../internal.h" +#include "../vmalloc.h" #include "kmsan.h" #define shadow_page_for(page) ((page)->kmsan_shadow) --- a/mm/mm_init.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/mm_init.c @@ -38,6 +38,7 @@ #include "sparse.h" #include "slab.h" #include "shuffle.h" +#include "vmalloc.h" #include --- a/mm/percpu-vm.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/percpu-vm.c @@ -9,6 +9,7 @@ * This is the default chunk allocator. */ #include "internal.h" +#include "vmalloc.h" static struct page *pcpu_chunk_page(struct pcpu_chunk *chunk, unsigned int cpu, int page_idx) --- a/mm/vmalloc.c~mm-split-out-vmalloc-declarations-from-internalh +++ a/mm/vmalloc.c @@ -49,6 +49,7 @@ #include "internal.h" #include "pgalloc-track.h" +#include "vmalloc.h" #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP static unsigned int __ro_after_init ioremap_max_page_shift = BITS_PER_LONG - 1; diff --git a/mm/vmalloc.h a/mm/vmalloc.h new file mode 100644 --- /dev/null +++ a/mm/vmalloc.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * mm-internal APIs for vmalloc + */ +#ifndef __MM_VMALLOC_H +#define __MM_VMALLOC_H + +#ifdef CONFIG_MMU +void __init vmalloc_init(void); +int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end, + pgprot_t prot, struct page **pages, + unsigned int page_shift, gfp_t gfp_mask); +unsigned int get_vm_area_page_order(struct vm_struct *vm); +#else +static inline void vmalloc_init(void) {} + +static inline +int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end, + pgprot_t prot, struct page **pages, + unsigned int page_shift, gfp_t gfp_mask) +{ + return -EINVAL; +} + +static inline void vunmap_range_noflush(unsigned long start, unsigned long end) +{ +} +#endif + +struct vm_struct *__get_vm_area_node(unsigned long size, + unsigned long align, unsigned long shift, + unsigned long vm_flags, unsigned long start, + unsigned long end, int node, gfp_t gfp_mask, + const void *caller); + +void clear_vm_uninitialized_flag(struct vm_struct *vm); + +int __must_check __vmap_pages_range_noflush(unsigned long addr, + unsigned long end, pgprot_t prot, + struct page **pages, unsigned int page_shift); + +void vunmap_range_noflush(unsigned long start, unsigned long end); + +void __vunmap_range_noflush(unsigned long start, unsigned long end); + +#endif /* __MM_VMALLOC_H */ _ Patches currently in -mm which might be from rppt@kernel.org are userfaultfd-prevent-registration-of-special-vmas.patch selftests-mm-uffd-dont-treat-uffdio_copy-enoent-as-a-failure.patch mm-split-out-mm_init-and-memblock-declarations-from-internalh.patch mm-split-out-sparse-declarations-from-internalh.patch mm-split-out-vmalloc-declarations-from-internalh.patch