ttm_bo_reserve(9)
π NAME π
okay so this is the ttm_bo_reserve(9) page from the Kernel API Manual, and the NAME section is literally just the name with no extra description β lowkey iconic minimalism, honestly.
β¨ SYNOPSIS β¨
int ttm_bo_reserve (struct ttm_buffer_object *bo , bool interruptible ,
bool no_wait , struct ww_acquire_ctx *ticket );
π ARGUMENTS π
boβ a pointer to astruct ttm_buffer_object. yes bestie, that exact one.interruptibleβ sleep interruptible if waiting. thatβs the whole assignment.no_waitβ donβt sleep while trying to reserve; instead return-EBUSY.ticketβ the ticket used to acquire theww_mutex.
π¦ DESCRIPTION π¦
Locks a buffer object for validation. or, plot twist, it prevents other processes from locking it for validation β while taking a number of measures to prevent deadlocks. so itβs giving responsible main character energy, not chaos gremlin energy.
πΈ RETURN πΈ
hereβs the code tea β:
-EDEADLKβ the reservation may cause a deadlock. Release all buffer reservations, wait forboto become unreserved and try again.-ERESTARTSYSβ a wait for the buffer to become unreserved was interrupted by a signal. Release all buffer reservations and return to user-space.-EBUSYβ the function needed to sleep, butno_waitwas true.-EALREADYβ Bo already reserved usingticket. This error code will only be returned ifuse_ticketis set to true.
π SEE ALSO π
Kernel file ./include/drm/ttm/ttm_bo.h, plus the whole friend group:
enum ttm_bo_type(9)struct ttm_buffer_object(9)struct ttm_bo_kmap_obj(9)struct ttm_operation_ctx(9)struct ttm_lru_walk_arg(9)struct ttm_lru_walk(9)struct ttm_bo_shrink_flags(9)ttm_bo_reserve_slowpath(9)ttm_bo_move_null(9)ttm_bo_unreserve(9)ttm_kmap_obj_virtual(9)struct ttm_bo_lru_cursor(9)ttm_bo_lru_for_each_reserved_guarded(9)
mwah π β source/version: ./include/drm/ttm; date: October 2026. byeee π«Ά
π¦ 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