DirectStorage: requests reuse a worker's buffers, within one budget #1596
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1596"
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 mizzied on 2026-11-28T22:10:57Z.
What was wrong. Each DirectStorage request allocated its source buffer, its zlib intermediate and the buffer for a write to scattered pages with
vec![0; size]. That faulted in every page again for every request.The fix. A worker now keeps up to three spare buffers of at most 32 MiB each (
VICTORY_DSTORAGE_BUFFERS, on by default), zeroed before reuse. All workers together keep at most 256 MB of them (VICTORY_DSTORAGE_BUFFER_BUDGET, in MB,0for no bound). Without that bound, 16 workers × 3 × 32 MiB could hold 1.5 GB for the whole run, in a process that's often short of memory. A buffer that doesn't fit is freed at the end of its request.How it was tested. RTX 5070, Windows 11. New tests cover the following:
cargo test --workspacepasses apart fromrepository_passes_policy, which already fails onmain:lower.rsis over the 640 KiB file-size limit there (#1493 raises it). Clippy reports only the 16 findings already onmain, none on lines this PR changes.