STRUCT TTM_POOL_TT_RESTORE(9)
π struct ttm_pool_tt_restore(9) π
okay so first things first, bestie β this is a page straight out of the Kernel API Manual, and the star of the show is struct ttm_pool_tt_restore. Say it with me: ttm pool TT restore. Iconic name, honestly.
β¨ NAME β¨
struct ttm_pool_tt_restore β literally the state that represents restoring from a backup π«Ά
πΈ SYNOPSIS πΈ
struct ttm_pool_tt_restore {
struct ttm_pool *pool;
struct ttm_pool_alloc_state snapshot_alloc;
struct page *alloced_page;
dma_addr_t first_dma;
pgoff_t alloced_pages;
pgoff_t restored_pages;
enum ttm_caching page_caching;
unsigned int order;
};
no cap, that's the whole struct. every field accounted for, not one skipped π
π Members π
okay so let's do a little field-by-field vibe check, one at a time, no skipping:
poolβ the pool we're using for page allocation while restoring. it's giving "the supply closet" energy π§snapshot_allocβ a snapshot of the most recentstruct ttm_pool_alloc_state. like a screenshot but for alloc state, iykyk.alloced_pageβ pointer to the page that was most recently allocated, whether it came from a pool or from the system.first_dmaβ the dma address that corresponds toalloced_page, ifdma_mappingis requested. only shows up when it's invited π«alloced_pagesβ the number of allocated pages hanging out in thestruct ttm_ttpage vector from this restore session. session-scoped, periodt.restored_pagesβ the number of 4K pages restored foralloced_page(which is typically a multi-order page). yes, 4K, keep that number, it matters πpage_cachingβ thestruct ttm_ttrequested caching. lowkey just the caching the tt asked for.orderβ the order ofalloced_page. that's it, that's the field π¦
π Description π
here's the lore: recovery from backup might fail when we've recovered less than the full ttm_tt. and because we're absolutely not about to lose any data (yet π), the move is to keep information around that lets us restart a failed ttm backup recovery.
fr fr β this struct exists so a half-finished recovery can be picked back up instead of yeeting your data into the void. do not lose the data. the "yet" in that sentence is doing a lot of heavy lifting, bestie π
π¦ 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)Partial backup and restoration of a struct ttm_tt.(9)ttm_pool_free_range(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)
okay that's the whole page, you ate that π this one lives in ./drivers/gpu/drm/ttm, the manual's dated October 2026, and it's struct ttm_pool_tt_restore(9) β go be the main character of your own restore session πβ¨π
π¦ 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