Slot eviction: a slot another thread is making is not waited for (a freeze with the sampled marks) #1557
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1557"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Amar-D3V on 2026-11-28T21:43:30Z.
Related: #846 (one way to get its stall and the watchdog crash), #1425, #807
What it changes
Slot eviction (
resource::slot_evict) holds the table of textures (textures()) while it puts each slot back to null, andtexture_slot_evictedwaited for the slot's lock. A thread making a slot takes the same locks the other way round, the table last:mirror_innerholds the slot's lock, thenbegun_before→texture_at(PLACED_TEXTURES) →create_at_address→hand_out_resource(textures()). So the two can wait for each other forever:That is the stack dump (
VICTORY_STACKS, symbolized with the diag build's PDB) taken 25 s into a freeze. About 30 s after the frames stopped, the title's own hang watchdog ended the process with the write to 0 at+0x23cf683that #846 describes.The slot's lock is now only tried there (
Made::try_lock). A slot that another thread is making at that moment is in use, so it is not one to let go:evict_slotsreports it, andslot_evictkeeps that texture's host copy and goes through its existing "used meanwhile" branch, which makes the slots it already put back again before the next submission.It is rare without the sampled marks, because eviction then takes few slots. With
VICTORY_SAMPLED_MARKS=1 VICTORY_SAMPLED_EVICT=1it takes many (82,972 slots in nine minutes here), and it froze in both runs with them.How it was tested
cargo test -p victory-gpupassed (550 passed, 43 ignored). Clippy reports nothing in the changed lines;main's own findings elsewhere are unchanged.Checked for overlap
VICTORY_SAMPLED_MARKSto the shader cache key, which this needed too, so it is not repeated here), #972 and #943 (eviction's log lines).