gen_pool_alloc_algo_owner(9)
π gen_pool_alloc_algo_owner(9) π
okay so first things first, bestie: this is from the Kernel API Manual, and it's the page for gen_pool_alloc_algo_owner β the girlies' fave way to grab some special memory out of a pool β¨
πΈ NAME πΈ
gen_pool_alloc_algo_owner β allocate special memory from the pool π«Ά
β¨ SYNOPSIS β¨
unsigned long gen_pool_alloc_algo_owner (struct gen_pool *pool , size_t
size , genpool_algo_t algo , void *data , void **owner );
Like, that's the whole signature, no cap. Look at her go π₯
π ARGUMENTS π
poolβ the pool you're allocating from, bestie. that's your vibe source πsizeβ how many bytes you want out of the pool. literally the amount, fr fralgoβ the algorithm, passed in from whoever's calling. your choice, your rules πdataβ data that gets passed to the algorithm. it's giving "here's some snacks for your algorithm" πownerβ optionally retrieve the chunk owner π yes "optionally", you can skip it if you don't care
π¦ DESCRIPTION π¦
So basically: allocate the requested number of bytes from the specified pool. She uses the pool allocation function β with the first-fit algorithm by default β so if you don't pick an algorithm, first-fit is what you're getting, periodt β¨
β οΈ big heads up though: this can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. like, don't do it. that's the rule, ngl π
π SEE ALSO π
Kernel file ./lib/genalloc.c β and honestly the whole friend group, here's the roll call π
gen_pool_create(9)gen_pool_add_owner(9)gen_pool_virt_to_phys(9)gen_pool_destroy(9)gen_pool_dma_alloc(9)gen_pool_dma_alloc_algo(9)gen_pool_dma_alloc_align(9)gen_pool_dma_zalloc(9)gen_pool_dma_zalloc_algo(9)gen_pool_dma_zalloc_align(9)gen_pool_free_owner(9)gen_pool_for_each_chunk(9)gen_pool_has_addr(9)gen_pool_avail(9)gen_pool_size(9)gen_pool_set_algo(9)gen_pool_first_fit(9)gen_pool_first_fit_align(9)gen_pool_fixed_alloc(9)gen_pool_first_fit_order_align(9)gen_pool_best_fit(9)gen_pool_get(9)devm_gen_pool_create(9)of_gen_pool_get(9)
π mwah, that's a wrap π
sourced straight from ./lib, and this beauty is dated October 2026 β gen_pool_alloc_algo_owner(9), slaying across the timeline π§ββοΈ see u in the next manpage 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