include/linux/vmalloc.h
Source file repositories/reference/linux-study-clean/include/linux/vmalloc.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/vmalloc.h- Extension
.h- Size
- 11245 bytes
- Lines
- 337
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/alloc_tag.hlinux/sched.hlinux/spinlock.hlinux/init.hlinux/list.hlinux/llist.hasm/page.hlinux/rbtree.hlinux/overflow.hasm/vmalloc.h
Detected Declarations
struct vm_area_structstruct notifier_blockstruct iov_iterstruct vm_structstruct vmap_areafunction arch_vmap_p4d_supportedfunction arch_vmap_pud_supportedfunction arch_vmap_pmd_supportedfunction arch_vmap_pte_range_map_sizefunction arch_vmap_pte_range_unmap_sizefunction arch_vmap_pte_supported_shiftfunction arch_vmap_pgprot_taggedfunction get_vm_area_sizefunction is_vm_area_hugepagesfunction set_vm_flush_reset_permsfunction set_vm_flush_reset_permsfunction pcpu_get_vm_areasfunction pcpu_free_vm_areasfunction vmalloc_dump_obj
Annotated Snippet
struct vm_struct {
union {
struct vm_struct *next; /* Early registration of vm_areas. */
struct llist_node llnode; /* Asynchronous freeing on error paths. */
};
void *addr;
unsigned long size;
unsigned long flags;
struct page **pages;
#ifdef CONFIG_HAVE_ARCH_HUGE_VMALLOC
unsigned int page_order;
#endif
unsigned int nr_pages;
phys_addr_t phys_addr;
const void *caller;
unsigned long requested_size;
};
struct vmap_area {
unsigned long va_start;
unsigned long va_end;
struct rb_node rb_node; /* address sorted rbtree */
struct list_head list; /* address sorted list */
/*
* The following two variables can be packed, because
* a vmap_area object can be either:
* 1) in "free" tree (root is free_vmap_area_root)
* 2) or "busy" tree (root is vmap_area_root)
*/
union {
unsigned long subtree_max_size; /* in "free" tree */
struct vm_struct *vm; /* in "busy" tree */
};
unsigned long flags; /* mark type of vm_map_ram area */
};
/* archs that select HAVE_ARCH_HUGE_VMAP should override one or more of these */
#ifndef arch_vmap_p4d_supported
static inline bool arch_vmap_p4d_supported(pgprot_t prot)
{
return false;
}
#endif
#ifndef arch_vmap_pud_supported
static inline bool arch_vmap_pud_supported(pgprot_t prot)
{
return false;
}
#endif
#ifndef arch_vmap_pmd_supported
static inline bool arch_vmap_pmd_supported(pgprot_t prot)
{
return false;
}
#endif
#ifndef arch_vmap_pte_range_map_size
static inline unsigned long arch_vmap_pte_range_map_size(unsigned long addr, unsigned long end,
u64 pfn, unsigned int max_page_shift)
{
return PAGE_SIZE;
}
#endif
#ifndef arch_vmap_pte_range_unmap_size
static inline unsigned long arch_vmap_pte_range_unmap_size(unsigned long addr,
pte_t *ptep)
{
return PAGE_SIZE;
}
#endif
#ifndef arch_vmap_pte_supported_shift
static inline int arch_vmap_pte_supported_shift(unsigned long size)
{
return PAGE_SHIFT;
}
#endif
#ifndef arch_vmap_pgprot_tagged
static inline pgprot_t arch_vmap_pgprot_tagged(pgprot_t prot)
{
return prot;
}
#endif
Annotation
- Immediate include surface: `linux/alloc_tag.h`, `linux/sched.h`, `linux/spinlock.h`, `linux/init.h`, `linux/list.h`, `linux/llist.h`, `asm/page.h`, `linux/rbtree.h`.
- Detected declarations: `struct vm_area_struct`, `struct notifier_block`, `struct iov_iter`, `struct vm_struct`, `struct vmap_area`, `function arch_vmap_p4d_supported`, `function arch_vmap_pud_supported`, `function arch_vmap_pmd_supported`, `function arch_vmap_pte_range_map_size`, `function arch_vmap_pte_range_unmap_size`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.