On 02/12/2026 23:33, Matthew Brost wrote:
The defrag copy path submits its migration batches from the USM batch
pool. When the pool is small, xe_bb_new() backs up in the suballocator
waiting for prior migrate batches to retire, and that stall happens while
the BO reservation lock is held during the move. Traces of a 32MB defrag
move showed the entire ~37ms lock hold sitting inside xe_migrate_copy_*()
at xe_bb_new(), i.e. pool backpressure rather than actual copy time.
Grow the USM batch pool from 512K (integrated) / 1M (DGFX) to a uniform
2M to give the migrate engine enough in-flight batch space to avoid this
backpressure.
On integrated (non-DGFX) the pool is mapped into the migrate VM through
the shared level-0 pagetable alongside the 1M kernel batch pool. A full
2M needs 512 PTEs and no longer fits in that shared table's 2M window.
Instead, map the USM pool through a dedicated level-0 pagetable (reusing
an otherwise unused pt_bo page, as the vram identity map pages are only
consumed on DGFX) and point a single reserved 2M PDE at it, mirroring the
large_page_copy reservation. DGFX is unaffected as it reaches the pool
through the vram identity map.
Cc: Natalie Vock <[email protected]>
Cc: Arun Pravin <[email protected]>
Signed-off-by: Matthew Brost <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>