DEADLINE HINTS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ deadline hints ✨

okay bestie, buckle up, because we're talking about deadline hints β€” a Kernel API Manual situation, section 9, and honestly it's giving main character energy for the scheduler enjoyers πŸ’…


🌸 the dream vs. the real world

In an ideal world, it would be possible to pipeline a workload sufficiently that a utilization based device frequency governor could arrive at a minimum frequency that meets the requirements of the use-case, in order to minimize power consumption. Like, imagine ✨ perfect efficiency ✨. But ngl, in the real world there are many workloads which defy this ideal. For example, but not limited to:

  • Workloads that ping-pong between device and CPU, with alternating periods of CPU waiting for device, and device waiting on CPU. This can result in devfreq and cpufreq seeing idle time in their respective domains and in result reduce frequency. 😭
  • Workloads that interact with a periodic time based deadline, such as double buffered GPU rendering vs vblank sync'd page flipping. In this scenario, missing a vblank deadline results in an increase in idle time on the GPU (since it has to wait an additional vblank period), sending a signal to the GPU's devfreq to reduce frequency, when in fact the opposite is what is needed. the way that's so backwards fr fr πŸ’€

πŸŽ€ what deadline hints actually do

To this end, deadline hint(s) can be set on a dma_fence via dma_fence_set_deadline (or indirectly via userspace facing ioctls like sync_set_deadline). The deadline hint provides a way for the waiting driver, or userspace, to convey an appropriate sense of urgency to the signaling driver. 🫢

A deadline hint is given in absolute ktime (CLOCK_MONOTONIC for userspace facing APIs). The time could either be some point in the future (such as the vblank based deadline for page-flipping, or the start of a compositor's composition cycle), or the current time to indicate an immediate deadline hint (Ie. forward progress cannot be made until this fence is signaled). ⭐

Multiple deadlines may be set on a given fence, even in parallel. See the documentation for dma_fence_ops.set_deadline. πŸ’–

The deadline hint is just that, a hint. The driver that created the fence may react by increasing frequency, making different scheduling choices, etc. Or doing nothing at all. πŸ™ˆ no promises, bestie β€” it's literally a hint, not a demand.

πŸ‘‘ 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), 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)


and that's the whole page, bestie πŸ¦‹ this one lives in ./drivers/dma-buf, dated October 2026, and it's part of the Kernel API Manual β€” go off, deadlines πŸ’œ

πŸ“¦ where this page comes from