Repository navigation
fix(hle): coalesce split placeholders when mapping physical pages - #1224
matheusfrta wants to merge 1 commit into
Conversation
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 9fb6294 on Windows 11, RTX 5070, MSVC:
cargo test -p victory-hlepasses on the head (95 passed).- Merged into our fork: workspace tests, shader tests and
clippy -D warnings(default and all features) are all clean.
The change is right:
- The coalesce only ever widens the placeholder that
mapsplits again around[base, base + len)just afterwards, withMEM_PRESERVE_PLACEHOLDER. A merged span bigger than the target is fine. - If
[AllocationBase, base)holds a mapped view, theMEM_COALESCE_PLACEHOLDERScall simply fails, and the old path runs unchanged. map_aliasonly joins a run while the slices stay in one section with consecutive indices (Arc::ptr_eqandindex == first.index + run / PAGE), so each grouped view shows the same pages the per-page views did.
Notes:
coalesce_placeholdersnow runs aVirtualQueryExwalk on everymapcall, including single-page maps that never need it. It might be worth calling it only afterMapViewOfFile3has failed once.- A few doubled blank lines that
cargo fmtwill collapse.
AI-assisted (Claude Code).
…map and group runs in map_alias Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Data point for this change under Wine, from an independent implementation of the same idea (map runs of consecutive pool pages in Why per-page views hurt under Wine. We profiled wineserver during the multi-minute zero-fps stalls at boot and story load. 91% of its CPU was in Result. Wine-staging 11.21, vkd3d-proton 3.2, RADV, first-boot setup already done. Boot reached the start of the first cutscene in about 4 minutes. Caveat: that run also used a wineserver patched so that We haven't run this PR's branch itself. If useful, we can do an A/B run with stock wineserver. |
|
@OsiPog Thanks for sharing those numbers! That wineserver bottleneck breakdown makes a lot of sense. An A/B test of this branch on stock wineserver would definitely be interesting and super helpful to see the isolated impact of the PR. If you have the time to run it, I'd really appreciate it! |
|
A/B follow-up to the data point above: same build (our run-coalescing
So under stock Wine, fewer views from this change are not enough on their own. The view-list scan in wineserver stays the bottleneck, presumably because other mapping paths still create many views. We replaced our byte patch with a source patch that keeps each process's mapped views in a red-black tree instead of a list. In a 40k-view benchmark it also fixes the address queries the byte patch missed (0.07 s vs 1.33 s stock). It is being prepared for Wine upstream. Caveat: these are single runs on a shared, loaded machine. |
…p runs in map_alias
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision between this PR and #76. Rebased cleanly. The final newline and the test command in the description are fixed. In What is still open:
On your reply: thanks for the rebase that keeps CI: passing. Generated by Claude Code |
|
Updated |
8f9f848 to
ac39370
Compare
|
Rebased onto |
Rebases the placeholder coalescing and run-grouped
map_aliaschanges ontomainwhile keepingshownalias tracking,low_guards, and commit-failure reporting intact. Verified againstcargo test -p victory-hle remapping_split_placeholders_and_coalesced_aliases.