devm_gen_pool_create(9)
π devm_gen_pool_create(9) β kernel API manual energy π
okay so bestie, buckle up, because this one is a managed pool situation and honestly it's giving main character energy β¨ This page lives in the kernel API manual, and the function itself is devm_gen_pool_create π
πΈ NAME πΈ
devm_gen_pool_create β the managed version of gen_pool_create, no cap π
β¨ SYNOPSIS β¨
struct gen_pool * devm_gen_pool_create (struct device *dev , int
min_alloc_order , int nid , const char *name );
literally just copy that signature into your code and you're off π«Ά
π¦ ARGUMENTS π¦
devβ the device that provides thegen_pool. it's the whole reason this is "managed", so don't skip it πmin_alloc_orderβ log base 2 of the number of bytes each bitmap bit represents. yes, log base 2. yes, it's math. you got this πnidβ the node selector for the allocatedgen_pool. if you want all the nodes, passNUMA_NO_NODEand let it vibe everywhere πnameβ the name of agen_pool, orNULL. it identifies a particulargen_poolon the device, so it's basically the pool's little nametag π
π₯ DESCRIPTION π₯
So what it does: it creates a brand-new special memory pool, like, a pool specifically for managing special purpose memory β the kind of memory that the regular kmalloc/kfree interface just does not manage π€ iconic behavior honestly.
and here's the bestie part: the pool is automatically destroyed by the device management code. you don't have to clean up after it. it manages itself. self-care queen π β¨
π SEE ALSO π
kernel file ./lib/genalloc.c has all the lore, and here's the whole friend group (iykyk) πΈ:
gen_pool_create(9)gen_pool_add_owner(9)gen_pool_virt_to_phys(9)gen_pool_destroy(9)gen_pool_alloc_algo_owner(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)of_gen_pool_get(9)
π reminder bestie: min_alloc_order is log base 2 of bytes per bitmap bit. do not just throw a random number in there and hope. that's not slay, that's a bug.
and that's the page!! π§ this little gem comes from ./lib, dated October 2026, and it's filed under devm_gen_pool_create(9) β go forth and manage your pools, you absolute icon ππ
π¦ 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