ttm_eu_reserve_buffers(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ttm_eu_reserve_buffers(9)

okay so this is a page from the Kernel API Manual β€” yes bestie, the kernel, we're doing big-girl stuff today πŸŽ€ it's ttm_eu_reserve_buffers, and honestly? lowkey iconic.

✨ NAME ✨

ttm_eu_reserve_buffers β€”

(yes the description is literally blank in the original, no cap, they left it empty 😭 so we're moving on, don't @ me)

πŸ”₯ SYNOPSIS πŸ”₯

int ttm_eu_reserve_buffers (struct ww_acquire_ctx *ticket , struct
       list_head *list , bool intr , struct list_head *dups );

🌸 ARGUMENTS 🌸

  • ticket β€” this is an [out] param, it gets filled in by the call. It's a ww_acquire_ctx. Or pass NULL if you only want the non-blocking reserves tried. your choice, main character 🫢
  • list β€” a thread-private list of ttm_validate_buffer structs. private! like your notes app πŸ’…
  • intr β€” should the wait be interruptible? bool moment.
  • dups β€” an [out] param, and it's optional: a list of duplicates.

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does: it tries to reserve the bos pointed to by the list entries, for validation. And if the function returns 0, then all buffers are marked as "unfenced", taken off the lru lists, and are not synced for write CPU usage. slay ✨

Now, the deadlock part, and this is the important bit πŸ‘€ β€” if the function detects a deadlock because multiple threads are trying to reserve the same buffers in reverse order, then all threads except one will back off and retry. Just one survivor, very main character energy πŸ‘‘ Also, this function may sleep while waiting for CPU write reservations to be cleared, and while waiting for other threads to unreserve their buffers. it naps. respect it 😴

If intr is set to true, this function may return -ERESTARTSYS if the calling process receives a signal while waiting. And in that case β€” heads up, this matters β€” no buffers on the list will be reserved upon return. none. zero. 🚫

If dups is non-NULL, all buffers already reserved by the current thread (e.g. duplicates) are added to this list. Otherwise, -EALREADY is returned on the first already-reserved buffer, and all buffers from the list are unreserved again. we love a clean rollback πŸ’–

Buffers reserved by this function should be unreserved by a call to either ttm_eu_backoff_reservation or ttm_eu_fence_buffer_objects when command submission is complete or has failed. fr fr, don't leave them hanging 🌸

🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸŽ€ go read the other ones too, iykyk. this masterpiece lives in ./include/drm/ttm, it's dated October 2026, and it's part of the Kernel API Manual β€” periodt πŸ’œπŸ¦‹

πŸ“¦ where this page comes from