ttm_pool_free_range(9)
π ttm_pool_free_range(9) π
okay so bestie, welcome to the Kernel API Manual entry for ttm_pool_free_range β yes it's a mouthful, yes it's iconic, and yes I'm gonna walk you through it like we're texting at 2am π«Ά
β¨ NAME β¨
ttm_pool_free_range β free a range of TTM pages π like literally, it frees a range, the name ate and left no crumbs.
πΈ SYNOPSIS πΈ
void ttm_pool_free_range (struct ttm_pool *pool , struct ttm_tt *tt ,
enum ttm_caching caching , pgoff_t start_page , pgoff_t end_page );
it returns void β no return value, no drama, just vibes and deallocation πβ¨
π¦ ARGUMENTS π¦
poolβ the pool that was used for allocating. bestie, it's the pool. the whole reason we're here πttβ thestruct ttm_ttholding the page pointers. this one's carrying the receipts (and the pointers) πcachingβ the page caching mode used by the range. type isenum ttm_cachingso it's giving very much specific energy β¨start_pageβ index for first page to free. the beginning, the origin story πend_pageβ index for last page to free + 1. yes, plus one. it's exclusive, it's mysterious, it's lowkey an off-by-one trap if you don't read this π
π§ DESCRIPTION π§
okay so here's the lore π during allocation, the ttm_tt page-vector may get populated with ranges of pages with different attributes β and why? because allocation hit an error without being able to completely fulfill the allocation π like it tried, it really did, but it fumbled mid-way.
that's exactly the situation this function exists for: you can use ttm_pool_free_range to free these individual ranges. clean up the partial mess, one range at a time, no cap π
heads up bestie: this is the "allocation went sideways and left mixed-attribute ranges behind" cleanup tool β that's the why straight from the page, don't come for me for extra lore π
π SEE ALSO π
kernel file ./drivers/gpu/drm/ttm/ttm_pool.c, plus the whole friend group:
struct ttm_pool_dma(9)struct ttm_pool_alloc_state(9)struct ttm_pool_tt_restore(9)Partial backup and restoration of a struct ttm_tt.(9)ttm_pool_alloc(9)ttm_pool_restore_and_alloc(9)ttm_pool_free(9)ttm_pool_drop_backed_up(9)ttm_pool_backup(9)ttm_pool_init(9)ttm_pool_synchronize_shrinkers(9)ttm_pool_fini(9)ttm_pool_debugfs(9)ttm_pool_mgr_init(9)ttm_pool_mgr_fini(9)
and that's the whole page, bestie π this one came from ./drivers/gpu/drm/ttm, dated October 2026, and it lives in the Kernel API Manual β mwah, go free those ranges responsibly πππ¦
π¦ 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