dma_pool_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dma_pool_alloc β€” get a block of coherent memory πŸ’–

okay bestie, welcome to the Kernel API Manual entry for dma_pool_alloc(9) β€” yes that's the manual name, it's giving very serious kernel energy, and we're gonna make it make sense πŸŽ€


✨ SYNOPSIS ✨

void * dma_pool_alloc (struct dma_pool *pool , gfp_t mem_flags ,
       dma_addr_t *handle );

literally three args, one return, zero drama. slay πŸ’…


🌸 ARGUMENTS 🌸

  • pool β€” the dma pool that will produce the block. it's the main character here, the one actually handing out the memory 🫢
  • mem_flags β€” a GFP_* bitmask. yes, the flags go here, no cap πŸ’«
  • handle β€” a pointer to the dma address of the block. this is where the dma address gets reported back to you πŸ¦‹

⭐ RETURN ⭐

so what do you get? the kernel virtual address of a currently unused block β€” and it reports that block's dma address through the handle. iconic behaviour honestly πŸ‘‘

but bestie, listen: if such a memory block can't be allocated, NULL is returned. that's the vibe check. always check for NULL, fr fr 😭

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykyk 🌈


and that's the whole page, bestie β€” sourced from ./mm, dated October 2026, filed under dma_pool_alloc(9) in the Kernel API Manual. periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from