ttm_resourc...dmem_reclaim(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ttm_resource_manager_dmem_reclaim β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is ttm_resource_manager_dmem_reclaim(9) from the Kernel API Manual, and it's literally the dmem cgroup reclaim callback for TTM resource managers. say that five times fast, i dare you 🫢


✨ NAME ✨

ttm_resource_manager_dmem_reclaim β€” the dmem cgroup reclaim callback for TTM resource managers. that's it, that's the whole vibe 🌸


🌈 SYNOPSIS 🌈

int ttm_resource_manager_dmem_reclaim (struct dmem_cgroup_pool_state
*pool , u64 target_bytes , void *priv );

like, copy it exactly, no cap β€” every punctuation mark matters here πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pool β€” the dmem cgroup pool state for the cgroup that's getting reclaimed. yes, that cgroup. the one being reclaimed. it's giving "main character under memory pressure" 😭
  • target_bytes β€” a u64 β€” the number of bytes we're trying to free. try being the operative word, bestie πŸ™ˆ
  • priv β€” the ttm_resource_manager pointer, passed as init.reclaim_priv to dmem_cgroup_register_region. so this is where your manager pointer comes back home 🏠✨

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” drivers should use this as the reclaim member of their own struct dmem_cgroup_ops, with the ttm_resource_manager pointer as init.reclaim_priv.

that's literally it. no extra lore. slay πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 β€” some memory was freed. iconic, we love a success story πŸ‘‘
  • -ENOSPC β€” nothing was freed. tragic, but valid πŸ’€
  • another negative error code β€” fatal failure. not the vibe, but it's documented fr fr 😭

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/gpu/drm/ttm/ttm_resource.c β€” go read it, iykyk πŸ“–

and the whole friend group:

ttm_resource_cursor_init(9), ttm_resource_cursor_fini(9), ttm_lru_bulk_move_init(9), ttm_lru_bulk_move_fini(9), ttm_lru_bulk_move_tail(9), ttm_resource_init(9), ttm_resource_fini(9), ttm_resource_try_charge(9), ttm_resource_intersects(9), ttm_resource_compatible(9), ttm_resource_manager_init(9), ttm_resource_manager_usage(9), ttm_resource_manager_debug(9), ttm_resource_manager_first(9), ttm_resource_manager_next(9), ttm_lru_first_res_or_null(9), ttm_kmap_iter_iomap_init(9), Linear io iterator(9), ttm_kmap_iter_linear_io_init(9), ttm_kmap_iter_linear_io_fini(9), ttm_resource_manager_create_debugfs(9), ttm_resource_manager_set_dmem_region(9)


lowkey a whole squad of TTM functions. bring snacks, you'll be here a while πŸ“

and that's the page, bestie 🧚 from the folks over at ./drivers/gpu/drm/ttm, dated October 2026 β€” mwah, catch you in the next manpage πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from