ttm_bo_evict_first(9)
π ttm_bo_evict_first(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel API manual, section 9, and you've stumbled onto ttm_bo_evict_first. Welcome, bestie, you're gonna slay this one. β¨
πΈ NAME πΈ
ttm_bo_evict_first β evict the first bo on the manager's LRU list. that's it, that's the whole vibe. one (1) bo, first in line, getting evicted. it's giving "line leader gets told to leave" energy π
β¨ SYNOPSIS β¨
int ttm_bo_evict_first (struct ttm_device *bdev , struct
ttm_resource_manager *man , struct ttm_operation_ctx *ctx );
yes she takes three (3) args and returns an int. no cap. π«Ά
π ARGUMENTS π
bdevβ the ttm device. this is the whole device we're working with, the main character of the hardware situation πmanβ the manager whose bo to evict. literally the manager. and whose bo we're kicking out. respect the possessiveness, it's important πctxβ the TTM operation ctx governing the eviction. the rules of engagement, the vibe check for the whole eviction, yk? π¦
β RETURN β
returns 0 if it worked OR if the resource just... disappeared (gone, vanished, no notes π), and a negative error code on error. so like, zero is the good outcome, negative means something went sideways. periodt. π₯
ngl, the "or the resource disappeared" clause is doing a lot of heavy lifting here β zero covers success and the resource peacing out, so don't go assuming a 0 means the resource is still around. it's giving "ambiguous but fine" energy π
π SEE ALSO π
the whole friend group, fr fr β all of these live right here in the kernel file ./drivers/gpu/drm/ttm/ttm_bo.c:
ttm_bo_move_to_lru_tail(9)ttm_bo_set_bulk_move(9)ttm_bo_eviction_valuable(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)ttm_bo_wait_ctx(9)struct ttm_bo_swapout_walk(9)ttm_bo_swapout(9)ttm_bo_populate(9)
like, go read them, iykyk π
and that's the page !! sourced from ./drivers/gpu/drm/ttm, dated October 2026, and it's ttm_bo_evict_first(9) and she ate, no crumbs ππ§π
π¦ 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