dma_fence_default_wait(9)
π€ dma_fence_default_wait(9) π€
okay so this is a page from the Kernel API Manual β yes bestie, the kernel has a whole manual and this one's about waiting. the default sleep-until-the-fence-gets-signaled-or-until-the-timeout-elapses situation. and before you ask: it's giving "blocking call but make it β¨gracefulβ¨". π
πΈ NAME πΈ
dma_fence_default_wait β the default sleep until the fence gets signaled or until timeout elapses vibe. literally just napping on purpose, but for kernel fences, not for your 3pm lecture. π
β¨ SYNOPSIS β¨
signed long dma_fence_default_wait (struct dma_fence *fence , bool intr
, signed long timeout );
that's the whole signature, copy it exactly if you're typing it out, no cap. π«Ά
π§ ARGUMENTS π§
fenceβ the fence you're waiting on. the main character of this whole operation, honestly. πintrβ iftrue, do an interruptible wait. as in, a signal can wake you up early. lowkey important. πtimeoutβ timeout value in jiffies, orMAX_SCHEDULE_TIMEOUT. bestie, jiffies. yes that's the real unit name. π°οΈ
π¦ DESCRIPTION π¦
okay here's the tea on what it gives back: π
- Returns
-ERESTARTSYSif interrupted β like, someone poked the wait and said "wake up". - Returns
0if the wait timed out β ngl, you waited and nothing happened. π - Returns the remaining timeout in jiffies on success β slay, it wrapped up early and handed you the leftover time.
and the iconic lil edge case: if timeout is zero, the value 1 is returned if the fence is already signaled β that's for consistency with other functions taking a jiffies timeout. fr fr, it's just so the rest of the family matches. π
β οΈ don't skip that zero-timeout bit btw, it's the part everyone forgets and then goes "wait why is it returning 1??" β now you know. π«‘
π SEE ALSO π
the whole friend group, in the order they showed up:
- 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_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)dma_fence_timeline_name(9)
okay that's the page!! πβ¨ππ¦πΈπ π«Ά
cute sign-off time: this one lives in ./drivers/dma-buf, and it's dated October 2026 πΈ β so yeah, mark your calendar bestie, that's the version you're reading rn. stay sleepy, stay signaled, and remember: MAX_SCHEDULE_TIMEOUT exists so you can wait basically forever if you want to. iykyk π
π¦ 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