dma_resv_add_fence(9)
β¨ dma_resv_add_fence β the Kernel API Manual, bestie edition β¨
Okay so picture this: you're in the Kernel API Manual, and this page is literally called dma_resv_add_fence. It's giving "add a fence to the dma_resv obj" and honestly? That's exactly what it does. No notes. π
πΈ SYNOPSIS πΈ
void dma_resv_add_fence (struct dma_resv *obj , struct dma_fence *fence
, enum dma_resv_usage usage );
Like, that's it. That's the whole signature. Short king. π
π ARGUMENTS π
objβ the reservation object. The main character here, the one you're adding stuff to. π«Άfenceβ the fence to add. Yes bestie, this is the thing going in. πusageβ how the fence is used, and it's literallysee enum dma_resv_usagefor the deets. iykyk. π
π DESCRIPTION π
So here's the tea: this function adds a fence to a slot. That's the vibe. π₯
But not so fast β there are two conditions and you do not get to skip them. No cap.
objmust be locked withdma_resv_lock- and
dma_resv_reserve_fenceshas been called
β οΈ fr fr, read those again. If you roll in here without the lock and without that reserve call, that's not a slay, that's a situation. π
Also, peep dma_resv.fence if you want the whole discussion of the semantics β that's where the lore lives. π¦
π¦ SEE ALSO π¦
Kernel file ./drivers/dma-buf/dma-resv.c, plus the whole friend group:
- Reservation Object Overview(9)
dma_resv_init(9)dma_resv_fini(9)dma_resv_reserve_fences(9)dma_resv_reset_max_fences(9)dma_resv_replace_fences(9)dma_resv_iter_first_unlocked(9)dma_resv_iter_next_unlocked(9)dma_resv_iter_first(9)dma_resv_iter_next(9)dma_resv_copy_fences(9)dma_resv_get_fences(9)dma_resv_get_singleton(9)dma_resv_wait_timeout(9)dma_resv_set_deadline(9)dma_resv_test_signaled(9)dma_resv_describe(9)
and that's the page, babe π This is dma_resv_add_fence(9) from the Kernel API Manual, living under ./drivers/dma-buf, dated October 2026. Go add your fence, lock your object first, and stay iconic πππ
π¦ 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