DirectStorage: a file released with reads of it in flight stays open until they are done #3586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3586"
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 fl4rion on 2026-11-30T01:23:56Z.
What it changes
A title may release its last reference on an
IDStorageFileXright after submitting reads of it. On the console that last release (Close) waits for the file's reads, and they complete with the file's bytes. Here it freed the file object under the scheduler's workers: their reads failed with "The handle is invalid", or crashed in the freed object.Each read now holds a reference on its file object (
FileHold), taken at enqueue and dropped once a worker has read it, or when the read is dropped unrun. Reads from a memory source hold none. The worker drops its reference after the read and before it retakes the scheduler's lock, so a final close happens outside the lock.FileHoldis a new name becauseFileRefis already the file pointer's type alias. In the stuck-read warning, the one place that copied a queuedReadnow borrows it, sinceReadholds a reference and is no longerCopy.How it was tested
a_file_released_with_reads_in_flight_is_read: eight 64 KiB reads, the file released right after the submit; the reads complete with S_OK and the file's bytes.cargo test -p victory-hle --lib: 423 passed, 1 failed. The failure,xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it, fails the same way on main in every full run and passes alone.cargo build --release -p victoryand clippy: nothing new.Checked for overlap
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:50:47Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed