XMem: title-placed reservations are write-watched only when asked for (Series S boot, #3023) #3126
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3126"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by TheSovietWaffle on 2026-11-29T20:08:41Z.
Addresses #3023. The kernel stall itself is not explained here; this removes it from the default path and keeps the title-placed watch testable.
What it changes
78324212gave title-placed reservationsMEM_WRITE_WATCHby default. On the Series S the title's 3977 MB pool at0x2000000000goes throughVirtualAlloc2with that watch and never returns, so the profile hangs before the menu, the thread stays in the kernel, and the process cannot be killed. The reporter in #3023 bisected it to that commit and booted a build withwatch_placementforced tofalse(a one-line change); that is the evidence this change is built on.Comparing the last good build, v2026.11.28.03, with
main, the write-watch change inxmem.rsis this branch:.28.03watched only host-placed allocations (if constrained { ... kind |= MEM_WRITE_WATCH }). Unset now restores exactly that, and the switch keeps the newer path available.This makes that path opt-in instead of default:
VICTORY_WATCH_PLACED_XMEM=1: ask for the watch, as v2026.11.29.02 did, so the title-placed path can keep being tested.MEM_ADDRESS_REQUIREMENTS) are still watched exactly as before, a placeholder is still never watched, and aMEM_WRITE_WATCHthe title asked for itself is still honoured.can_watch_placement; the switch is read once through aOnceLock, likeVICTORY_WATCH_LARGE_XMEMbeside it.Nothing else changes: the existing fallback for a refused watch, the "XMemVirtualAlloc without write watching" line, and all host-placed watching stay as they were. Series X is unaffected, because its pool is placed by us, on the
constrainedpath.I considered limiting the watch by size instead (the hang is on the 3977 MB pool, the earlier 82 MB placements went through), but the cause is not understood, so a threshold would be a guess about which sizes are safe. Off by default is the conservative choice, and the switch leaves the experiment available.
How it was tested
a_placed_reservation_is_watched_only_when_asked_for: a placed reservation is watched only when the switch asks for it, never through the host-placed path, never for placeholders, and the title's ownMEM_WRITE_WATCHstill passes. It passes.cargo build --release --locked -p victory: finishes, same warnings asmain.cargo clippy -p victory-hle --lib: no finding inxmem.rs(the crate's other warnings are onmain, unchanged).asked_at=0x0), so the title-placed watch path of #3023 was never taken; the evidence for the fix remains the reporter's build with the same effective change (watch off) booting the profile, quoted in #3023. A build from this branch with the switch unset is the missing step; withVICTORY_WATCH_PLACED_XMEM=1the hang should come back, which is the knob for whoever wants to chase the kernel call.cargo test -p victory-hle --lib modules::xmem: 46 passed, 1 failed:a_read_by_range_waits_only_for_a_remapping_that_meets_it, the known parallel-run flake of #2420 item 2 (PR #2439). It passes when run alone, and it does not touch this path.Checked for overlap
watch_placement: none touches this code. Related: #2048 and #3086 (diagnostics build), #2792 (first Clippy gate), #2439 (the xmem flake above); none changesxmem.rs's placement watching.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.