pcpu_free_area(9)
π pcpu_free_area(9) β Kernel API Manual, bestie edition
Okay so this is a page from the Kernel API Manual (section 9, the kernel-internals one, iykyk) and it's about pcpu_free_area β the little function that hands memory back to the percpu allocator. Let's get into it π«Ά
β¨ NAME β¨
pcpu_free_area β literally just frees the corresponding offset π
πΈ SYNOPSIS πΈ
int pcpu_free_area (struct pcpu_chunk *chunk , int off );
π ARGUMENTS π
chunkβ the chunk of interest, aka the chunk you're obsessed with rn πoffβ addr offset into chunk, the exact spot inside it π―
π¦ DESCRIPTION π¦
So what does it actually do? Bestie, it figures out how big the allocation you're freeing is β using the boundary bitmap, bestie, the boundary bitmap β and then it clears the allocation map. That's it, that's the whole vibe. π§Ήβ¨
β RETURN β
Number of freed bytes. That's the number it hands back to you, no cap π
π SEE ALSO π
The kernel file ./mm/percpu.c, plus the whole percpu friend group β here's the full roster, nobody gets 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_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_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)
π‘ little note:pcpu_free_arealives in the./mmsource tree, and this page is dated October 2026. That's the tea π
Go free those offsets, bestie β you got this π π₯
π¦ 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