Account for bounce and intermediate buffers in the storage staging gate #276

Manually merged
github merged 1 commit from github-bot/gh-276 into gh-pr/276/base 2026-12-06 00:55:40 +00:00 AGit
Owner

@⁠yyc160 on GitHub · 2026-12-05 22:27 UTC · original
yyc160:fix/account-dstorage-staging → main · +33 −15 · 1 files · 1 commits · merged 2026-12-05 22:51 UTC

Plain file requests already allocate a bounce buffer to avoid kernel writes into guarded title pages, but the scheduler charged them zero staging bytes. Zlib followed by BCPack can also hold the intermediate buffer alongside the source. A burst of such requests could exceed the intended scratch-memory allowance while the scheduler believed it still had room.

Account for these input buffers with 64-bit sizes. Keep memory-to-memory plain copies staging-free and preserve the existing lone-oversized-request rule. Read the plain file before opening its destination for the user-mode copy; a failed file read has not changed any destination bytes. A refused destination still fails before I/O.

Tested the storage module against upstream with a new gate-accounting regression test for file and memory sources. This bounds the charged allocations, not the whole decoder's memory. No claim about game frame-rate improvements.

AI-assisted by GPT-6.2 Astra.

**@⁠yyc160** on GitHub · 2026-12-05 22:27 UTC · [original](https://github.com/gamingwithhomie/larp/pull/276) `yyc160:fix/account-dstorage-staging` → `main` · +33 −15 · 1 files · 1 commits · merged 2026-12-05 22:51 UTC Plain file requests already allocate a bounce buffer to avoid kernel writes into guarded title pages, but the scheduler charged them zero staging bytes. Zlib followed by BCPack can also hold the intermediate buffer alongside the source. A burst of such requests could exceed the intended scratch-memory allowance while the scheduler believed it still had room. Account for these input buffers with 64-bit sizes. Keep memory-to-memory plain copies staging-free and preserve the existing lone-oversized-request rule. Read the plain file before opening its destination for the user-mode copy; a failed file read has not changed any destination bytes. A refused destination still fails before I/O. Tested the storage module against upstream with a new gate-accounting regression test for file and memory sources. This bounds the charged allocations, not the whole decoder's memory. No claim about game frame-rate improvements. AI-assisted by GPT-6.2 Astra.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:29:31 +00:00
github-bot changed target branch from main to gh-pr/276/base 2026-12-05 22:53:40 +00:00
github-bot referenced this pull request from a commit 2026-12-06 00:55:31 +00:00
github manually merged commit af51f8f758 into gh-pr/276/base 2026-12-06 00:55:40 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.