pcpu_get_vm_areas(9)
okay bestie, welcome to pcpu_get_vm_areas(9) from the Kernel API Manual β¨ this is the one about allocating vmalloc areas for the percpu allocator, and it is lowkey giving main character energy π
πΈ NAME πΈ
pcpu_get_vm_areas β allocate vmalloc areas for percpu allocator
π SYNOPSIS π
struct vm_struct ** pcpu_get_vm_areas (const unsigned long *offsets ,
const size_t *sizes , int nr_vms , size_t align , gfp_t gfp );
π¦ ARGUMENTS π¦
offsetsβ array containing offset of each areasizesβ array containing size of each areanr_vmsβ the number of areas to allocatealignβ alignment, all entries inoffsetsandsizesmust be aligned to thisgfpβ allocation flags passed to the underlying memory allocator
β¨ RETURN β¨
On success you get a kmalloc'd vm_struct pointer array pointing to allocated vm_structs. On failure you get NULL. That's the whole vibe π
π DESCRIPTION π
So the percpu allocator wants to use congruent vm areas so that it can maintain the offsets among percpu areas. This function allocates congruent vmalloc areas for it. These areas tend to be scattered pretty far β the distance between two areas easily going up to gigabytes, no cap. To avoid interacting with regular vmallocs, these areas are allocated from top π«Ά
Despite its complicated look, this allocator is rather simple. It does everything top-down and scans free blocks from the end looking for matching base. While scanning, if any of the areas do not fit, the base address is pulled down to fit the area. Scanning is repeated till all the areas fit and then all necessary data structures are inserted and the result is returned. periodt π₯
π SEE ALSO π
Kernel file ./mm/vmalloc.c is right here, bestie, and these are the related pages:
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(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_free_vm_areas(9)
mwah π this page came from source/version ./mm, dated October 2026, for pcpu_get_vm_areas(9). stay slaying, kernel 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