STRUCT TTM_RESOURCE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct ttm_resource(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual ✨ this one is literally about struct ttm_resource and it's giving "small struct, big responsibilities" energy πŸ’…


🌸 NAME 🌸

struct ttm_resource β€”

and honestly? the manpage leaves the description blank after the dash. no cap, there's just... nothing there πŸ™ˆ so we move on, bestie, the good stuff is right below 🫢


⭐ SYNOPSIS ⭐

struct ttm_resource {
    unsigned long start;
    size_t size;
    uint32_t mem_type;
    uint32_t placement;
    struct ttm_bus_placement bus;
    struct ttm_buffer_object *bo;
    struct dmem_cgroup_pool_state *css;
    struct ttm_lru_item lru;
 };

like, look at her. eight fields, zero notes, all business 🧚


πŸ’– Members πŸ’–

okay so let's go field by field, main character by main character πŸ‘‘

  • start β€” where the allocation actually starts, bestie. that's it, that's the field πŸ’«
  • size β€” the actual size of the resource in bytes. factual. measured. not vibes 🌸
  • mem_type β€” the resource type of the allocation. classic. iconic. it tells you what kind of thing this is πŸ”₯
  • placement β€” placement flags!! flags!! we love flags πŸŽ€
  • bus β€” the placement on the io bus that the CPU can actually reach. think of it as the "yes you can touch it" address situation πŸ¦‹
  • bo β€” a weak reference to the BO, and it's protected by ttm_device::lru_lock. weak reference!! she does NOT own it, so do not go freeing things through her 😭 and yes, the lock protection is real, respect the lock πŸ”’
  • css β€” the cgroup state that this resource is charged to. memory accounting, bestie, somebody's paying for this πŸ’Έ
  • lru β€” the least recently used list entry, see ttm_resource_manager.lru. LRU girlies rise up πŸ’œ

🌈 Description 🌈

it's the structure that says where a buffer object lives and how much space it's using β€” the placement + the space resources, all wrapped up in one little struct πŸ‘‘ literally the "who, what, and how much room" of a buffer object, periodt ✨


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/drm/ttm/ttm_resource.h, plus this whole friend group right here:


aaaand that's the whole page, bestie 🫢 mwah πŸ’‹ this one came at you from ./include/drm/ttm, dated October 2026 β€” go forth and manage your resources responsibly, ily πŸ’–βœ¨

πŸ“¦ where this page comes from