gen_pool_dma_zalloc_algo(9)
β¨ gen_pool_dma_zalloc_algo(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a kernel function, and it's lowkey the moment you need memory that's zeroed AND set up for DMA AND allocated with your own algorithm. it's giving very specific, very powerful β¨
πΈ SYNOPSIS πΈ
void * gen_pool_dma_zalloc_algo (struct gen_pool *pool , size_t size ,
dma_addr_t *dma , genpool_algo_t algo , void *data );
π ARGUMENTS π
poolβ the pool you're allocating from π«Άsizeβ how many bytes you wanna pull out of the pool, fr frdmaβ your DMA-view physical address return value π useNULLif you don't need it, no pressurealgoβ the algorithm, passed in from the caller β¨dataβ the data, passed straight to the algorithm π¦
π DESCRIPTION π
so basically: it allocates the number of zeroed bytes you asked for, from the pool you specified, using the pool allocation function you handed it. iconic behavior honestly π
β οΈ heads up bestie β this can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. like, that's a hard no, no cap π
π₯ RETURN π₯
it gives you back the virtual address of that zeroed memory you just got π β or NULL if it failed π
π SEE ALSO π
kernel file ./lib/genalloc.c, plus the whole squad:
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_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)
and that's the whole page bestie, go forth and allocate responsibly π§π
π cute little sign-off: this one lives in ./lib, dated October 2026, and it's gen_pool_dma_zalloc_algo(9) β stan π
π¦ 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