ttm_pool_free_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct ttm_tt holding the page pointers. this one's carrying the receipts (and the pointers) πŸ“‹
  • caching β€” the page caching mode used by the range. type is enum ttm_caching so 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:


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