ttm_bo_evict_cgroup(9)
π ttm_bo_evict_cgroup(9) β from the Kernel API Manual, bestie
okay so picture this: it's a ttm_bo function, it's in the kernel, and it is literally here to evict buffer objects that are charged to one specific cgroup. yes queen, targeted eviction. let's get into it π
β¨ NAME β¨
ttm_bo_evict_cgroup β Evict buffer objects charged to a specific cgroup.
πΈ SYNOPSIS πΈ
s64 ttm_bo_evict_cgroup (struct ttm_device *bdev , struct
ttm_resource_manager *man , struct dmem_cgroup_pool_state *limit_pool ,
s64 target_bytes , struct ttm_operation_ctx *ctx );
she takes five args and returns an s64, no cap π«Ά
π¦ ARGUMENTS π¦
bdevβ The TTM device. the main character of this whole situation tbh.manβ The resource manager whose LRU to walk. yes you're walking her LRU, be respectful πlimit_poolβ The cgroup pool state whose members should be evicted. like, these are the ones getting the vibe check.target_bytesβ Number of bytes to free. the goal. the dream. the quota.ctxβ The TTM operation context.
π DESCRIPTION π
so what she does is: walk the LRU of man and evict buffer objects that are charged to the cgroup identified by limit_pool, until at least target_bytes have been freed. periodt. π―
and the way she does it? she mirrors the two-pass (trylock -> sleeping-lock, low-watermark) strategy used by ttm_bo_evict_alloc. iconic behavior honestly, she learned from the best π
π RETURN π
>= target_bytesβ on full success, she ate and left no crumbs π0..target_bytes-1β if partial. she tried, bestie π- negative error code β on fatal error. yeahβ¦ that's a no from her π
β SEE ALSO β
Kernel file ./drivers/gpu/drm/ttm/ttm_bo.c β and the whole friend group:
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_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)
ngl if you got this far you're lowkey a TTM girlie now. go read ttm_bo_evict_alloc next, it's giving sequel energy π§
and that's the page!! brought to you by ./drivers/gpu/drm/ttm, stamped October 2026, filed under ttm_bo_evict_cgroup(9) β mwah π slay safe out there π
π¦ 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