__vmalloc_node(9)
π __vmalloc_node(9) β like, the Kernel API Manual one, bestie π
okay so picture this: you're deep in the kernel, you need a big ol' chunk of memory that looks like one continuous stretch, and the page allocator is out here handing you scattered pages like confetti π. that's literally where __vmalloc_node comes in and she EATS. β¨
π NAME π
__vmalloc_node β allocate virtually contiguous memory. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
void * __vmalloc_node (unsigned long size , unsigned long align , gfp_t
gfp_mask , int node , const void *caller );
no cap, that's the whole signature. five args, zero drama. π«Ά
π¦ ARGUMENTS π¦
sizeβ the allocation size, aka how much memory you're asking for. bestie's wishlist. πalignβ the desired alignment. she likes things lined up. β¨gfp_maskβ flags for the page level allocator. this is the personality of the allocation ngl. πnodeβ the node to use for allocation, orNUMA_NO_NODEif you're like "idk, you pick". πΊοΈcallerβ caller's return address. yes, she wants to know who's asking. π
β¨ DESCRIPTION β¨
so what she actually does: she allocates enough pages to cover size from the page level allocator, using the gfp_mask flags. then β and this is the iconic part β she maps them into contiguous kernel virtual space. π§ physically scattered, virtually iconic. main character energy fr fr. π
and about gfp_mask: its semantics (including the reclaim/retry modifiers such as __GFP_NOFAIL) are the same as in __vmalloc_node_range_noprof. so like, don't go assuming new behaviour, she's literally matching the other one's energy. π
π₯ RETURN π₯
- a pointer to the allocated memory π
- or
NULLon error π (yeah. it happens. handle it.)
π SEE ALSO π
Kernel file ./mm/vmalloc.c β go read her, she's right there. π
and the whole friend group, in the order they appear:
vunmap_range(9), vmap_pages_range(9), vm_area_map_pages(9), vm_area_unmap_pages(9), new_vmap_block(9), vm_unmap_aliases(9), vm_unmap_ram(9), vm_map_ram(9), vm_area_add_early(9), vm_area_register_early(9), get_vm_area(9), find_vm_area(9), remove_vm_area(9), vfree_atomic(9), vfree(9), vunmap(9), vmap(9), vmap_pfn(9), __vmalloc_node_range(9), vmalloc(9), vmalloc_huge_node(9), vzalloc(9), vmalloc_user(9), vmalloc_node(9), vzalloc_node(9), vrealloc_node_align(9), vmalloc_32(9), vmalloc_32_user(9), vread_iter(9), remap_vmalloc_range_partial(9), remap_vmalloc_range(9), pvm_find_va_enclose_addr(9), pvm_determine_end_from_reverse(9), pcpu_get_vm_areas(9), pcpu_free_vm_areas(9)
like. the entire vmalloc extended universe. iykyk. π
ok that's the page!! source is./mm, version date is October 2026, and the page is__vmalloc_node(9)β mwah, go allocate something cute, bestie πππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms