DirectStorage: a file released with reads of it in flight stays open until they are done #3586
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3586
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fl4rion on GitHub · 2026-11-30 01:23 UTC · original
fl4rion:dstorage-released-file→main· +72 −13 · 1 files · 1 commits · closed without mergingWhat 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
@trustno1-coder on GitHub · 2026-12-01 18:50 UTC · original
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