pcpu_balance_free(9)
π pcpu_balance_free β the Kernel API Manual one, bestie β¨
Okay so picture this: it's pcpu_balance_free(9) from the Kernel API Manual, and she's here to manage the amount of free chunks. That's literally the whole vibe. π
πΈ SYNOPSIS πΈ
void pcpu_balance_free (bool empty_only );
No return value, no drama, she just does the thing and leaves. Iconic behavior honestly.
π¦ ARGUMENTS π¦
empty_onlyβ when this istrue, she'll only free chunks if there are no populated pages in them. Like, she checks the vibe first. Respectful queen. π
π DESCRIPTION π
So here's the tea, bestie:
- If
empty_onlyisfalseβ she's reclaiming all fully free chunks, regardless of how many populated pages they have. No filter, no hesitation. She's taking everything that qualifies. π₯ - Otherwise (so, if
empty_onlyistrue) β she's only reclaiming the chunks that have no populated pages. Strictly the empty ones. Nothing more. π
That's it, that's the whole function. Not me being obsessed with a chunk-reclaiming routine but here we are. π«Ά
β CONTEXT β
She runs holding pcpu_lock β but plot twist, the lock can be dropped temporarily. So yeah, she's flexible like that. π
π SEE ALSO π
All her friends, all in the kernel file ./mm/percpu.c. Impeccable guest list, no notes:
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_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)
Heads up bestie: everything above lives in ./mm, and this page is dated October 2026. Yes, a future date. She's ahead of her time, we love a forward-thinking queen. π§π
Anyway mwah, 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