STRUCT TTM_POOL_TT_RESTORE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 recent struct 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 to alloced_page, if dma_mapping is requested. only shows up when it's invited πŸ’«
  • alloced_pages β€” the number of allocated pages hanging out in the struct ttm_tt page vector from this restore session. session-scoped, periodt.
  • restored_pages β€” the number of 4K pages restored for alloced_page (which is typically a multi-order page). yes, 4K, keep that number, it matters 🌈
  • page_caching β€” the struct ttm_tt requested caching. lowkey just the caching the tt asked for.
  • order β€” the order of alloced_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:


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