You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(agc): release cached address space on device teardown - #4849
GuestBufferMemory::AcquireRegistered can publish an address space that holds leases for every registered GPU allocation. ClearImageMirrors used to release that cache only after confirming the mirror table belonged to the device. When lease mirrors are disabled, the mirror table has no device, so teardown returned early and left the address-space cache pinning allocations after the Vulkan device was destroyed.
Clear the cached address space by its own device identity before the mirror-table early return. Add a focused mock-Vulkan regression that builds an address space with APS5_NO_LEASE_MIRROR=1, tears it down, and confirms freeing its allocation does not need the pin waiter's cache-drop fallback. The regression fails against the old teardown logic.
Related to #4846. The reported ProsperoEden exit hang also reproduces with APS5_NO_ADDRESS_SPACE_CACHE enabled, so this cache cleanup is not established as the cause or fix for that issue. The test covers a separate lease cleanup regression when lease mirrors are disabled.
agc_driver_address_space_teardown passes. Restoring the old cleanup order makes it fail with device teardown left the cached address space pinning guest allocations.
agc_driver_graphics passes (15.78 s).
python3 tools/check_conventions.py --base upstream/main and git diff --check pass.
Tests use the mock Vulkan context; no physical GPU was involved.
Checklist
Based on current main; no other open PR implements the same functions
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Hosted eligibility, conventions, and report checks pass; GitHub currently reports the PR mergeable.
The overlap report flags nearby changes to Graphics.cpp in #757 and #758. This fix does not depend on either; I’ll account for those edits if either lands first.
Please drop Fixes #4846. The issue reproduces with APS5_NO_ADDRESS_SPACE_CACHE set and with lease mirrors on, so this cache isn't what holds its lease; #4872 fixes the exit order and the title's run there goes from 134 to 0. The early return in ClearImageMirrors (GuestBufferMemory.cpp:1791) is still a real leak, so this stays open on its own. Which run reaches it without APS5_NO_LEASE_MIRROR?
Thanks for the correction. The ProsperoEden report reproduces with APS5_NO_ADDRESS_SPACE_CACHE enabled and lease mirrors on, and #4872 addresses the reported exit-order failure. I removed “Fixes #4846” and clarified that this PR only tests cache lease cleanup when lease mirrors are disabled; the current evidence does not establish that this change fixes the reported ProsperoEden hang.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GuestBufferMemory::AcquireRegisteredcan publish an address space that holds leases for every registered GPU allocation.ClearImageMirrorsused to release that cache only after confirming the mirror table belonged to the device. When lease mirrors are disabled, the mirror table has no device, so teardown returned early and left the address-space cache pinning allocations after the Vulkan device was destroyed.Clear the cached address space by its own device identity before the mirror-table early return. Add a focused mock-Vulkan regression that builds an address space with
APS5_NO_LEASE_MIRROR=1, tears it down, and confirms freeing its allocation does not need the pin waiter's cache-drop fallback. The regression fails against the old teardown logic.Related to #4846. The reported ProsperoEden exit hang also reproduces with
APS5_NO_ADDRESS_SPACE_CACHEenabled, so this cache cleanup is not established as the cause or fix for that issue. The test covers a separate lease cleanup regression when lease mirrors are disabled.Tested
Linux, GCC 12.2, Release, Ninja,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF.agc_driver_address_space_teardownpasses. Restoring the old cleanup order makes it fail withdevice teardown left the cached address space pinning guest allocations.agc_driver_graphicspasses (15.78 s).python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)