vmalloc_32(9)
π vmalloc_32(9) β the Kernel API Manual, bestie edition π
okay so picture this: it's vmalloc_32(9) from the Kernel API Manual, and it's literally the reason your 32-bit-addressable allocations don't fall apart. it's giving "small but mighty" energy and honestly? iconic.
β¨ NAME β¨
vmalloc_32 β allocate virtually contiguous memory that's 32bit addressable π
πΈ SYNOPSIS πΈ
void * vmalloc_32 (unsigned long size );
like, that's the whole thing. one function, one arg, so clean. periodt. π
π¦ ARGUMENTS π¦
sizeβ the allocation size, a.k.a. how much memory you're asking for, bestie. don't lie to it.
π DESCRIPTION π
so what this actually does π β it allocates enough 32bit PA addressable pages to cover size, and it grabs them from the page level allocator, then maps them into contiguous kernel virtual space. so you get one nice continuous-looking block of virtual memory, but the underlying physical pages are only guaranteed to be reachable with a 32-bit physical address. lowkey the whole point, fr fr. β¨
π RETURN π
a pointer to the allocated memory π«Ά β or NULL on error, at which point you should be like "π okay noted" and check your pointer before you use it.
no cap: if it hands you NULL, that's an error. do not dereference it. do not pass go. do not collect $200. π
β SEE ALSO β
the whole fam, iykyk β all of this lives in the kernel file ./mm/vmalloc.c:
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_node(9)vmalloc(9)vmalloc_huge_node(9)vzalloc(9)vmalloc_user(9)vmalloc_node(9)vzalloc_node(9)vrealloc_node_align(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)
and that's the page, bestie π§π this one's from the ./mm source, October 2026 release of vmalloc_32(9) β go forth and allocate responsibly β¨ππ«ΆπΈ
π¦ 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