ttm_bo_evict_cgroup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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