dma_fence_timeline_name(9)
π dma_fence_timeline_name β the Kernel API Manual β¨
okay so bestie, this one's from the Linux kernel API manual (the dma_fence_timeline_name(9) page) and it's lowkey about grabbing the timeline name off a fence. short page, big vibes, and one genuinely important warning that you absolutely do not want to fumble. let's get into it π«Ά
β¨ NAME β¨
dma_fence_timeline_name β access the timeline name, that's literally it, that's the whole job π
πΈ SYNOPSIS πΈ
const char __rcu * dma_fence_timeline_name (struct dma_fence *fence );
note the __rcu on the return type β that little tag is doing so much work, bestie, and i'll explain why in a sec π
π¦ ARGUMENTS π¦
fenceβ the fence you want to query. that's the one. the fence in question π§
π₯ DESCRIPTION π₯
Returns a timeline name that's provided by the dma-fence implementation. cute, simple, iconic β¨
IMPORTANT CONSIDERATION: okay this is the part where you actually pay attention, no cap. the dma-fence contract stipulates that access to driver-provided data β meaning data that is not directly embedded into the object itself β is forbidden after the fence has been signalled. what counts as driver-provided data? things like dma_fence.lock, and memory that may potentially be accessed by the dma_fence.ops functions. drivers are allowed to free that data, and some of them do. so yeah, this isn't theoretical π
To allow safe access, drivers are mandated to guarantee a RCU grace period between signalling the fence and freeing said data. so there's a whole grace-period situation happening in the background keeping you safe π
As such, access to the driver name is only valid inside a RCU locked section. and now the loud part:
The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded by thercu_read_lockandrcu_read_unlockpair.
like β queried and used. same block. one single block. do not query it, leave the lock, and then come back to use it, because that's not a vibe check that ends well ππ
π SEE ALSO π
- Kernel file
./drivers/dma-buf/dma-fence.c DMA fences overview(9)fence cross-driver contract(9)dma_fence_get_stub(9)dma_fence_allocate_private_stub(9)dma_fence_context_alloc(9)fence signalling annotation(9)dma_fence_begin_signalling(9)dma_fence_end_signalling(9)dma_fence_signal_timestamp_locked(9)dma_fence_signal_timestamp(9)dma_fence_signal_locked(9)dma_fence_check_and_signal_locked(9)dma_fence_check_and_signal(9)dma_fence_signal(9)dma_fence_wait_timeout(9)dma_fence_release(9)dma_fence_free(9)dma_fence_enable_signaling(9)dma_fence_add_callback(9)dma_fence_get_status(9)dma_fence_remove_callback(9)dma_fence_default_wait(9)dma_fence_wait_any_timeout(9)deadline hints(9)dma_fence_set_deadline(9)dma_fence_describe(9)dma_fence_init(9)dma_fence_init64(9)dma_fence_driver_name(9)
that's the whole reading list, bestie β go forth and be literate ππ
and that's the page! it's from the Kernel API Manual, lives under ./drivers/dma-buf, dated October 2026 β so mark your calendar, mwah π stay in your RCU lock, don't touch freed driver data, and slay πβ¨
π¦ 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