fix(agc): cache Linux describePages results #4395
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4395"
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 oneandonlydean on 2026-10-12T09:12:20Z.
What
This carries #1810 by @Swastik-51, rebased onto
mainafter #3454, with the commits and their authors kept:fix(agc): cache Linux describePages results(@Swastik-51),fix(agc): store only the requested pages of a Linux page query(@ahir061) and the test commit I pushed to that branch on 10-10. #1810 was reviewed and accepted there; it could not go green because theAI-assisted:line of its description was never answered, which only the author can do on his PR. The only conflict was the name #3454 gave the query helper:ProcMapsQueryFd()is nowHostMapping::QueryFd(), and the carry uses the new name. The changed lines are otherwise the same as in #1810.Fixes #1791.
On Linux,
describePagesasked the kernel (PROCMAP_QUERY, or/proc/self/mapson kernels before 6.11) what a guest range maps to but did not store the readable pages it found in the page table, so every uncached guest-range check repeated the query.PageStates::record(), shared by both platforms, which stores the page state. The WindowsVirtualQuerypath already did this inline and now calls it.PROCMAP_QUERYpath and the/proc/self/mapspath store their results the same way.Titles, from the runs posted on #1810:
PROCMAP_QUERYioctl fromdescribePageswas the top frame in 116 of 400 samples of the AGC worker thread there./proc/self/mapspath is used: logos and intro movies 5-6 → 57-60 fps, and the title screen is reached (@johnmaia).Tested
Linux (CachyOS, kernel 7.2, GCC 16.2.1, RTX 4090, NVIDIA 610.57.04), Release, configured with the CI flags (
-DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON), onmain2979ae37:agc_driver_graphics(the arena block ofRunUnmappedGapTests, which runs on Linux since #861): withGuestMemory.cppas onmainand the test from this PR it fails witha checked arena page was queried again instead of read from the page table; with the change it passes.ctest -R "agc|guest_|memory|write": 752 of 752 pass, onmainand with the change (agc_driver_stencil_ref_exportreports skipped on both).python3 tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.Not tested here: the
/proc/self/mapspath (this kernel hasPROCMAP_QUERY; @johnmaia ran it on kernel 6.8, before the rebase), Windows (theVirtualQuerypath only moves intorecord(); the CI job is the test), and Hades II on this rebase.Checklist
main; no other open PR implements the same functions (#1810 is the PR this replaces)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)