STRUCT TTM_BO_LRU_CURSOR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct ttm_bo_lru_cursor(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for struct ttm_bo_lru_cursor β€” it's the iterator cursor you use for looping over the TTM LRU list πŸ’… iykyk


πŸŽ€ NAME πŸŽ€

struct ttm_bo_lru_cursor β€” the iterator cursor for TTM LRU list looping. that's literally it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct ttm_bo_lru_cursor {
    struct ttm_resource_cursor res_curs;
    struct ttm_buffer_object *bo;
    bool needs_unlock;
    struct ttm_lru_walk_arg *arg;
 };

πŸ’– Members πŸ’–

  • res_curs β€” an embedded struct ttm_resource_cursor. it's tucked right in there, no cap 🫢
  • bo β€” the buffer object pointer, valid if a buffer object is refcounted, and NULL otherwise. so like, sometimes it's there, sometimes it's not, main character energy either way ✨
  • needs_unlock β€” valid iff bo != NULL. the bo resv needs an unlock before the next iteration or after the loop exits. do not sleep on this one β€” if you skip the unlock bestie, that's a whole situation 😭 valid iff bo != NULL, meaning if bo is NULL this flag is just not it.
  • arg β€” pointer to the common BO LRU walk arguments. it's giving "shared state, but make it chic" πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/drm/ttm/ttm_bo.h, plus all of these icons:

enum ttm_bo_type(9), struct ttm_buffer_object(9), struct ttm_bo_kmap_obj(9), struct ttm_operation_ctx(9), struct ttm_lru_walk_arg(9), struct ttm_lru_walk(9), struct ttm_bo_shrink_flags(9), ttm_bo_reserve(9), ttm_bo_reserve_slowpath(9), ttm_bo_move_null(9), ttm_bo_unreserve(9), ttm_kmap_obj_virtual(9), ttm_bo_lru_for_each_reserved_guarded(9)

like, go read all of them, they're literally all connected πŸ’€πŸ‘‘


fr fr bestie: needs_unlock only means something when bo isn't NULL. remember that and you'll slay 🫢

that's the whole page! 🌈 this gem lives in ./include/drm/ttm, dated October 2026, and it's from the Kernel API Manual β€” periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from