mm: split out vmalloc declarations from internal.h

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/[email protected]
Signed-off-by: Mike Rapoport (Microsoft) <[email protected]>
Acked-by: Muchun Song <[email protected]>
Acked-by: Vlastimil Babka (SUSE) <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Acked-by: Lorenzo Stoakes <[email protected]>
Acked-by: Pratyush Yadav <[email protected]>
Acked-by: SJ Park <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Brendan Jackman <[email protected]>
Cc: Brendan Jackman <[email protected]>
Cc: Dennis Zhou <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Pasha Tatashin <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Mike Rapoport (Microsoft)
2026-08-04 19:18:46 -07:00
committed by Andrew Morton
parent 2b65a42a08
commit ef79e0f5e3
10 changed files with 54 additions and 41 deletions
+1
View File
@@ -28818,6 +28818,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
+1 -1
View File
@@ -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"
+1
View File
@@ -20,6 +20,7 @@
#include <asm/tlbflush.h>
#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;
-40
View File
@@ -1092,9 +1092,6 @@ static inline void mlock_new_folio(struct folio *folio) { }
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 *folio, struct vm_fault *vmf,
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
*/
+1
View File
@@ -21,6 +21,7 @@
#include <linux/usb.h>
#include "../internal.h"
#include "../vmalloc.h"
#include "../slab.h"
#include "kmsan.h"
+1
View File
@@ -17,6 +17,7 @@
#include <linux/stddef.h>
#include "../internal.h"
#include "../vmalloc.h"
#include "kmsan.h"
#define shadow_page_for(page) ((page)->kmsan_shadow)
+1
View File
@@ -38,6 +38,7 @@
#include "sparse.h"
#include "slab.h"
#include "shuffle.h"
#include "vmalloc.h"
#include <asm/setup.h>
+1
View File
@@ -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)
+1
View File
@@ -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;
+46
View File
@@ -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 */