Skip to content

xmem: commit physical-page sections whole under Wine - #53

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
a55uka:fix/wine-physical-pages
Nov 24, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
a55uka:fix/wine-physical-pages

Conversation

@a55uka

@a55uka a55uka commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

XMemAllocatePhysicalPages creates SEC_RESERVE sections and commits their pages one view at a time. Under Wine, each commit is a wineserver request that scans every range committed so far. wineserver ran at full load, the title's threads sat blocked on its pipe (req_add_mapping_committed_range / req_map_view in gdb), and loading barely moved.

Tested:

  • Fedora with Wine 11.21 Staging, on an i7-12700K with an RTX 4070.
  • wineserver load drops after the first few seconds.
  • The title reaches its loading screen and draws and dispatches on the host (frame 128+).
  • Windows behaviour is unchanged, but I haven't run it there.

XMemAllocatePhysicalPages makes SEC_RESERVE sections and commits their
pages one view at a time. Under Wine each commit is a wineserver request
that scans every range committed so far, so wineserver ran at full load
while the title's threads waited on it, and loading hardly moved.

Under Wine (detected by ntdll's wine_get_version export) the sections
are now SEC_COMMIT and the per-view commit is skipped. Wine backs a
committed section with a sparse file, so untouched pages still cost
nothing. Windows keeps SEC_RESERVE, since a busy host may be unable to
commit the 6.1 GiB the title asks for in one go.

Tested: Linux (Wine 11.21), i7-12700K, RTX 4070. wineserver load drops
after the first seconds and the title gets to its loading screen,
drawing and dispatching.
@DaviTostes

Copy link
Copy Markdown

Tested 2fec09c stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass (no regression only).

  • cargo test --workspace: 155 passed, 0 failed, 3 ignored; merge with Build: make workspace tests run on Linux #39 clean.
  • Scope note: the change targets XMemVirtualAlloc's commit path under Wine, and this run does not launch the title under Wine, so only the portable HLE suite is covered.
  • No game data used.

AI-assisted (DeepSeek V4.1 Flash coding agent).

@a55uka
a55uka force-pushed the fix/wine-physical-pages branch from 2fec09c to 78b8404 Compare November 24, 2026 00:10
@Marvisak
Marvisak merged commit 8a8a38d into Marvisak:main Nov 24, 2026
brcly pushed a commit to brcly/TuxBox that referenced this pull request Nov 24, 2026
Each XMem physical-page batch is a SEC_RESERVE section whose views were
committed one at a time. Under Wine every such commit is a wineserver
request that scans all ranges committed so far, so a title that maps many
physical pages keeps wineserver busy and its threads wait on it.

Commit the whole section once through a temporary view when it is
created. If that fails (e.g. at the commit limit), views fall back to
committing their own range as before.

Idea from Marvisak/VIctory#53 (reimplemented; no code copied).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
suirentakamura referenced this pull request in suirentakamura/victory-suiren Nov 24, 2026
xmem: commit physical-page sections whole under Wine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants