pcpu_alloc_first_chunk(9)
β¨ pcpu_alloc_first_chunk β¨
okay so this is a page from the Kernel API Manual, and it's all about pcpu_alloc_first_chunk β the little function that gets the very first percpu chunk situation sorted π
π NAME π
pcpu_alloc_first_chunk β creates chunks that serve the first chunk π (yes bestie, chunks that serve the first chunk, that's literally the whole vibe)
πΈ SYNOPSIS πΈ
struct pcpu_chunk * pcpu_alloc_first_chunk (unsigned long tmp_addr , int
map_size );
like, it hands you back a struct pcpu_chunk * and it wants a tmp_addr and a map_size, no cap π«Ά
π¦ ARGUMENTS π¦
tmp_addrβ the start of the region served. that's the address where the whole thing begins β¨map_sizeβ size of the region served. how big the region is, obviously π«
π₯ DESCRIPTION π₯
So this function is responsible for creating the chunks that serve the first chunk β main character energy, it's building the foundation for everything else fr fr π
Here's the tea: base_addr is page aligned down of tmp_addr, while the region end is page aligned up. And then offsets are kept track of to determine the region served. The way this matters is that all of this is done to appease the bitmap allocator π β specifically, to keep it from dealing with partial blocks. no partial blocks, not today, not ever π
β RETURN β
A chunk serving the region at tmp_addr of map_size. that's it, that's the give-back π
π SEE ALSO π
Kernel file ./mm/percpu.c β and bestie, the cross-references are stacked, look at this whole roster π
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_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_alloc_alloc_info(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)
okay that's the whole page, you ate that π
and before you go β the little sign-off at the bottom says this one lives in ./mm, dated October 2026, and it's filed under pcpu_alloc_first_chunk(9). slay, go read the source, ily bye π§π
π¦ 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