SAFE EXTERNAL ACCESS TO DRIVER PROVIDED OBJECT MEMBERS(9)
π Safe external access to driver provided object members π
okay so bestie, this page is from the Kernel API Manual, and it is the Safe external access to driver provided object members(9) one. it is lowkey a safety briefing for dma-fence data, and it is giving βdo not touch after signalβ energy π
here is the rule, no cap: all data not stored directly in the dma-fence object β stuff like dma_fence.lock and memory that functions in the dma_fence.ops table might access β MUST NOT be accessed after the fence has been signalled. why? because after that point drivers are allowed to free it π
any code that accesses that data through the dma-fence API (or directly, which is discouraged) MUST make sure the complete access is contained within an rcu_read_lock and rcu_read_unlock pair. like, wrap the whole thing, bestie π«Ά
some dma-fence API handles this automatically, while other, as for example dma_fence_driver_name and dma_fence_timeline_name, leave that responsibility to the caller. so those two are not gonna hold your hand β you are the main character of the RCU lock β¨
to enable this scheme to work drivers MUST ensure a RCU grace period elapses between signalling the fence and freeing the said data. that is the whole tea π΅
πΈ SEE ALSO πΈ
kernel file: ./include/linux/dma-fence.h
struct dma_fence(9)struct dma_fence_cb(9)struct dma_fence_ops(9)dma_fence_was_initialized(9)dma_fence_put(9)dma_fence_get(9)dma_fence_get_rcu(9)dma_fence_get_rcu_safe(9)dma_fence_spinlock(9)dma_fence_lock_irqsave(9)dma_fence_unlock_irqrestore(9)dma_fence_assert_held(9)dma_fence_is_signaled_locked(9)dma_fence_is_signaled(9)__dma_fence_is_later(9)dma_fence_is_later(9)dma_fence_is_later_or_same(9)dma_fence_later(9)dma_fence_get_status_locked(9)dma_fence_set_error(9)dma_fence_timestamp(9)dma_fence_wait(9)dma_fence_is_array(9)dma_fence_is_chain(9)dma_fence_is_container(9)
and that is the whole page, bestie π source/version: ./include/linux Β· date: October 2026. stay safe and keep your RCU locks close. mwah π
π¦ 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