ttm_bo_wait_ctx(9)
π ttm_bo_wait_ctx(9) β like, the Kernel API Manual page you actually wanna read π
okay so bestie, welcome to the <pink>Kernel API Manual</pink> entry for ttm_bo_wait_ctx β¨ it's short, it's sweet, it's giving "tiny function, very important job" energy, and we're gonna get through it together π«Ά
β¨ NAME β¨
ttm_bo_wait_ctx β wait for buffer idle π€
like literally that's the whole gig. you show up, you wait for the buffer to chill out, you leave π
πΈ SYNOPSIS πΈ
int ttm_bo_wait_ctx (struct ttm_buffer_object *bo , struct
ttm_operation_ctx *ctx );
it returns an int, it takes two pointers, and no we are not scared of it π
π¦ ARGUMENTS π¦
boβ the buffer object π§Έ like, the actual thing you're waiting on. this is the main character of the call, ngl.ctxβ defines how to wait β³ it's the vibe-setter! it's the one that decides the rules of the waiting situation. iykyk.
π DESCRIPTION π
so what does it do? it waits for the buffer to be idle. that's it. that's the function. iconic behaviour honestly π
but here's the cute lil twist: the used timeout depends on the context β so the ctx you pass in literally controls how long this whole waiting saga goes on for. no cap, it's context-dependent, so don't come for me about the timeout length, go ask your ctx π
and the return values? let's get into them:
- returns
-EBUSYif the wait timed out β and yes the original page says "timed outt" with two t's, and honestly? we're keeping that, it's a whole mood π (technical meaning unaffected: the wait timed out, that's a real failure case, bestie) - returns
-ERESTARTSYSif it got interrupted by a signal π΄ like, someone knocked, the wait had to bail - returns zero on success β slay!! we love a clean zero
β οΈ heads up: those first two are error returns, not "oopsie we'll retry" β-EBUSYmeans timed out and-ERESTARTSYSmeans a signal interrupted it. treat them accordingly, fr fr π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/ttm/ttm_bo.c β plus the whole friend group, because this function does not exist in isolation bestie, look at this roster π₯
ttm_bo_move_to_lru_tail(9)ttm_bo_set_bulk_move(9)ttm_bo_eviction_valuable(9)ttm_bo_evict_first(9)ttm_bo_alloc_at_place(9)struct ttm_bo_evict_walk(9)ttm_bo_evict_cgroup(9)ttm_bo_pin(9)ttm_bo_unpin(9)ttm_bo_alloc_resource(9)ttm_bo_validate(9)ttm_bo_init_reserved(9)ttm_bo_init_validate(9)ttm_bo_unmap_virtual(9)struct ttm_bo_swapout_walk(9)ttm_bo_swapout(9)ttm_bo_populate(9)
go read them. or don't. but they're there π
π the sign-off π
this lil masterpiece lives in ./drivers/gpu/drm/ttm, dated October 2026, and it answers to the name ttm_bo_wait_ctx(9) β
okay bye bestie, go wait on that buffer, you've got this π§π
π¦ 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