__vmalloc_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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, or NUMA_NO_NODE if 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 NULL on 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