perf(agc): release a heap mirror once a host import serves its range #1410
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1410"
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 boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-08T03:00:48Z.
What
An address-based build maps each readable registered range through a host import, else through a heap mirror, a host-visible copy kept current by write tracking. A range mirrored while
APS5_HOST_IMPORT_MIBwas full kept its mirror after a later pass imported it (budget freed by an unmap). Until the guest freed the range, the mirror held host-visible memory and bytes no build read.AcquireRegisterednow releases the heap mirror of each range its pass serves through an import. Recorded work that bound it keeps it until it completes, as for a swept mirror. Image mirrors are unchanged.[buffers] image mirrorsline (APS5_PROFILE_DRAW) counts the released mirrors.mainwith our open PRs and #290), heap mirrors held 10.6 GiB in 37k ranges while host imports swung between 0.7 and 3.7 GiB with the mirror count flat.importAllocationand its call in this pass (it conflicts withmainalready; this change adds no conflict). Its eviction drops imports of ranges that stay registered; the next pass then mirrors such a range anew from the guest bytes. #1085 (ours,acquireMirrorand the same tests), #1071 (ClearImageMirrors) and #1357, #1359 and #1361 (the importentryin the sameAcquireRegisteredloop) merge cleanly.Tested
maindf16c4c2: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 403/403 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_graphics(mock device, new case next to the heap mirror tests): a mirrored range that a later build imports loses its mirror, an imported range is not mirrored again, and a build without the import mirrors the current guest bytes anew. Fails onmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T13:18:09Z.
Tested on AMD under Linux, since this PR wasn't: RX 9070 XT (RDNA4, GFX1201), RADV / Mesa 26.2.4, Linux 7.2.9 (CachyOS), GCC Release build.
ctest: this PR merged ontomain07c2405c, all 452 tests pass withctest -j8(main alone: 452/452 on the same machine).main+ #759 (needed to boot this title onmain) + this PR, then one scripted run headless from boot through the title screen. No error and no amdgpu fault came from this change.main+ #759 alone: 226, 229, 226.storage image access to depth/stencil surface ... is not implemented(the gap #425 fills). So nothing past the title screen is covered.AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.