gen_pool_dma_zalloc_algo(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 fr
  • dma β€” your DMA-view physical address return value πŸ’– use NULL if you don't need it, no pressure
  • algo β€” 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