pcpu_alloc_alloc_info(9)
π pcpu_alloc_alloc_info π
okay so bestie, welcome to the Kernel API Manual π β this is the page for pcpu_alloc_alloc_info, and it's literally about allocating percpu allocation info. no cap, that's the whole vibe. let's get into it β¨
β¨ SYNOPSIS β¨
struct pcpu_alloc_info * pcpu_alloc_alloc_info (int nr_groups , int nr_units );
that's the whole signature, character for character, don't come for me π«Ά
πΈ ARGUMENTS πΈ
nr_groupsβ the number of groups. yes. that's it. that's the whole description πnr_unitsβ the number of units. iconic of them to be so straightforward.
π¦ DESCRIPTION π¦
so what this does is allocate ai, and it makes ai big enough for nr_groups groups, each containing nr_units units. like it's sizing everything up for you, main character energy π₯
here's the tea: the returned ai's groups[0].cpu_map points to the cpu_map array β and that array is long enough for nr_units and is filled with NR_CPUS. yes, literally filled with NR_CPUS, all of it π
β οΈ but listen β it is the caller's responsibility to initialize the cpu_map pointer of the other groups. not group 0. the other ones. don't forget, i'm begging you ππ
β RETURN β
- pointer to the allocated
pcpu_alloc_infoon success π NULLon failure π
that's it. slay.
π§ SEE ALSO π§
the kernel file is ./mm/percpu.c, and here's the full squad, all of them, in order, no cuts π:
pcpu_addr_in_chunk(9)pcpu_check_block_hint(9)pcpu_next_md_free_region(9)pcpu_next_fit_region(9)pcpu_mem_zalloc(9)pcpu_mem_free(9)pcpu_chunk_relocate(9)pcpu_block_update(9)pcpu_chunk_refresh_hint(9)pcpu_block_refresh_hint(9)pcpu_block_update_hint_alloc(9)pcpu_block_update_hint_free(9)pcpu_is_populated(9)pcpu_find_block_fit(9)pcpu_alloc_area(9)pcpu_free_area(9)pcpu_alloc_first_chunk(9)pcpu_chunk_populated(9)pcpu_chunk_depopulated(9)pcpu_chunk_addr_search(9)pcpu_alloc(9)pcpu_balance_free(9)pcpu_balance_populated(9)pcpu_reclaim_populated(9)pcpu_balance_workfn(9)free_percpu(9)is_kernel_percpu_address(9)per_cpu_ptr_to_phys(9)pcpu_free_alloc_info(9)pcpu_dump_alloc_info(9)pcpu_setup_first_chunk(9)pcpu_build_alloc_info(9)pcpu_embed_first_chunk(9)pcpu_page_first_chunk(9)
and that's the page!! π this one's served fresh from ./mm, dated October 2026 β go read it again whenever you need it, i'll be right here π«Άπβ¨
π¦ 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