ttm_resourc...dmem_reclaim(9)
π 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β au64β the number of bytes we're trying to free. try being the operative word, bestie πprivβ thettm_resource_managerpointer, passed asinit.reclaim_privtodmem_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms