dma_release...dev_coherent(9)
π dma_release_from_dev_coherent(9) β from the Kernel API Manual
okay so bestie, we're in the Kernel API Manual today and this one's a little function with main character energy β it's literally the "hey, this memory belongs to our pool, lemme hand it back" vibe check for device coherent memory. π§
β¨ NAME β¨
dma_release_from_dev_coherent β free memory back to the device coherent memory pool. that's it, that's the whole job. π
πΈ SYNOPSIS πΈ
int dma_release_from_dev_coherent(struct device *dev, int order, void *vaddr);
like, three args, one int coming back at you. no cap. β¨
π ARGUMENTS π
devβ the device whose memory we're talking about, i.e. the one this memory was originally allocated from π«Άorderβ the order of the pages that were allocated. yes, order, like the buddy allocator kind, not like a coffee order πvaddrβ the virtual address of the allocated pages. the actual pointer, the real one π
π DESCRIPTION π
so here's the tea: this function checks whether that memory came out of the per-device coherent memory pool, and if it did β slay β it releases it. that's the whole loop, bestie. π¦
the return value is doing a whole little two-party situation:
- returns 1 if we correctly released the memory π (iconic, we did it)
- returns 0 if the caller should go ahead and release memory from the generic pools instead π (not our memory, not our problem)
literally just: "is this mine? yes β free it, return 1. no β return 0 and let the caller handle it elsewhere." periodt. π
π SEE ALSO π
- Kernel file
./kernel/dma/coherent.cβ the whole source neighborhood, go snoop π dma_alloc_from_dev_coherent(9)β the alloc counterpart, the origin story βdma_mmap_from_dev_coherent(9)β the mmap one, for when you wanna map it too π
and that's the page!! source is ./kernel/dma, dated October 2026, and the footer's just echoing the same title back at you because the kernel doc build said so π mwah, go free that coherent memory responsibly β¨π
π¦ 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