STRUCT TTM_RESOURCE_MANAGER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ttm_resource_manager(9)

okay so this is a page from the Kernel API Manual bestie, and it's literally all about struct ttm_resource_manager β€” the lil' main character that keeps track of memory types for a device. no cap, it's giving "backstage manager of the whole memory vibe." let's get into it πŸŽ€


✨ SYNOPSIS ✨

struct ttm_resource_manager {
    bool use_type;
    bool use_tt;
    struct ttm_device *bdev;
    uint64_t size;
    const struct ttm_resource_manager_func *func;
    spinlock_t eviction_lock;
    struct dma_fence *eviction_fences[TTM_NUM_MOVE_FENCES];
    struct list_head lru[TTM_MAX_BO_PRIORITY];
    uint64_t usage;
    struct dmem_cgroup_region *cg;
 };

🌸 Members 🌸

  • use_type β€” this bool is the vibe check for the memory type: it's enabled or it's not, periodt. ✨
  • use_tt β€” says whether a TT object should be the backing store for this thing. iykyk.
  • bdev β€” the ttm device that this manager belongs to 🫢 (its home base, fr fr).
  • size β€” how big the managed region is. the actual size. the whole thing πŸ’–
  • func β€” a structure pointer implementing the range manager. see above, bestie πŸ‘†
  • eviction_lock β€” the lock for eviction fences πŸ”’ literally its whole job.
  • eviction_fences β€” the fences of the last pipelined move operation. yes, all of them, it's an array: eviction_fences[TTM_NUM_MOVE_FENCES] πŸ¦‹
  • lru β€” the lru list for this memory type, and it's an array too: lru[TTM_MAX_BO_PRIORITY] πŸŽ€
  • usage β€” how much of the resources are used. important caveat: this is protected by bdev->lru_lock πŸ”₯ don't be out here reading it unprotected, that's not the move πŸ’€
  • cg β€” the dmem_cgroup_region used for memory accounting, if it's not NULL. if it is NULL, bestie, there's no accounting happening πŸ™ˆ

⭐ Description ⭐

so like, this structure is used to identify and manage memory types for a device ✨ that's it, that's the whole glow-up. it's the organizational queen of the memory types πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./include/drm/ttm/ttm_resource.h and honestly this whole friend group:


and that's the whole page!! 🧚 from ./include/drm/ttm, dated October 2026 β€” mwah, slay, go read the source header if you want more πŸ’œπŸ‘‘

πŸ“¦ where this page comes from