pcpu_chunk_addr_search(9)
πΈ pcpu_chunk_addr_search β like, the manual page π
okay so bestie, this one is from the Kernel API Manual (yes, that's the manual name, we're being fancy today β¨). Let me walk you through it, no cap.
β¨ NAME β¨
pcpu_chunk_addr_search β figure out which chunk a given address lives in π
π¦ SYNOPSIS π¦
struct pcpu_chunk * pcpu_chunk_addr_search (void *addr );
π ARGUMENTS π
addrβ the address we're tryna find the chunk for, literally. Give it the address, it finds the chunk. That's the whole vibe. π«Ά
πΈ DESCRIPTION πΈ
So this is an internal function, bestie β it's not out here doing main character public-API things. It handles all but static allocations, periodt. π
And listen, the important caveat: static percpu address values should never be passed into the allocator. Like, ever. Don't do it. That's the rule. π
β RETURN β
It returns the address of the found chunk. That's it, that's the whole return value. Iconic and simple. π
π₯ SEE ALSO π₯
The kernel file is ./mm/percpu.c β and here's the whole friend group, all of them, no one left out:
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_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 π§ this little cutie comes from the ./mm source tree, dated October 2026, and it's filed under pcpu_chunk_addr_search(9) β slay, go read the source 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