dma_resv_locking_ctx(9)
π dma_resv_locking_ctx(9) β a Kernel API Manual moment
okay so bestie, welcome to the dma_resv_locking_ctx page, straight out of the Kernel API Manual β¨ this one's short but it's iconic in a deeply unhinged way, trust.
β¨ NAME β¨
dma_resv_locking_ctx β returns the context used to lock the object π
π¦ SYNOPSIS π¦
struct ww_acquire_ctx * dma_resv_locking_ctx (struct dma_resv *obj );
πΈ ARGUMENTS πΈ
objβ the reservation object. that's it. that's the whole argument. she's low maintenance π
π₯ DESCRIPTION π₯
So what does it actually do? It returns the context used to lock a reservation object, or NULL if no context was used or if the object is not locked at all. two very different reasons, same NULL, no cap π
β οΈ WARNING: this interface is pretty horrible, but TTM needs it because it doesn't pass the struct ww_acquire_ctx around in some very long callchains. Everyone else just uses it to check whether they're holding a reservation or not.
like, the manpage itself is calling it horrible π we love a self-aware API. TTM's out here raw-dogging long callchains without passing the struct around, so this exists to save it β and everybody else is just using it as a vibe check: am i holding a reservation or not bestie? β¨
π SEE ALSO π
Kernel file ./include/linux/dma-resv.h, plus the whole squad:
enum dma_resv_usage(9)dma_resv_usage_rw(9)struct dma_resv(9)struct dma_resv_iter(9)dma_resv_iter_begin(9)dma_resv_iter_end(9)dma_resv_iter_usage(9)dma_resv_iter_is_restarted(9)dma_resv_for_each_fence_unlocked(9)dma_resv_for_each_fence(9)dma_resv_lock(9)dma_resv_lock_interruptible(9)dma_resv_lock_slow(9)dma_resv_lock_slow_interruptible(9)dma_resv_trylock(9)dma_resv_is_locked(9)dma_resv_unlock(9)
okay that's the whole page, you ate that π«Ά this lil gem lives in ./include/linux, dropped October 2026, in the Kernel API Manual β go forth and check your locks, bestie, and remember: NULL doesn't always mean unlocked, sometimes it just means nobody passed the context ππ
π¦ 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