Repository navigation
kernelx: track 64 KiB sparse reservations in mirror table - #2
Draft
RandomGithub12309 wants to merge 1 commit into
Draft
RandomGithub12309 wants to merge 1 commit into
RandomGithub12309 wants to merge 1 commit into
Conversation
VirtualAlloc only registered mirrors::reserved on the fallback reserve_watched path when 64 KiB allocations did not use uma.sparse_reserve, and VirtualFree only called mirrors::released on fallback releases. Track reserve-only (t & 0x1000 == 0) 64 KiB uma.sparse_reserve allocations in mirrors::reserved and sparse MEM_RELEASE in mirrors::released, with a regression unit test covering paired sparse reservations. Assisted-by: Antigravity (Gemini 4 Neon)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Track 64 KiB sparse
VirtualAllocreservations andVirtualFreereleases inkernelx::mirrorsalongside the fallbackreserve_watchedpath.Previously,
VirtualAlloconly calledmirrors::reservedon fallback allocations whenMEM_64K_PAGESdid not land inuma.sparse_reserve(andVirtualFreeonly calledmirrors::releasedon fallback releases), so 64 KiB CPU/GPU mirror pairs placed in sparse windows were missed bymirrors::source.(Parked as a draft PR on
RandomGithub12309/xclwhile#667and#674are in review upstream; rebase ontoivall/xcl:mainand run the full workspace test suite +scripts/smoke.ps1before opening upstream.)What is in it
crates/xcl/src/hle/kernelx.rs: callmirrors::reservedon reserve-only (t & 0x1000 == 0) 64 KiBuma.sparse_reserveallocations, callmirrors::releasedon sparseMEM_RELEASE, and addvirtual_alloc_64k_pairs_track_mirrors_across_sparse_and_fallback.Tested
32.0.16.2114), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300,rustc 1.100.0 (0ef1bc386 2026-11-09)stable-x86_64-pc-windows-msvc(debug).cargo test -p xcl --lib hle::kernelx::tests -- --test-threads=4 --nocapture:24 passed, 0 failed, 1 ignored(scatter_timingignored;virtual_alloc_64k_pairs_track_mirrors_across_sparse_and_fallbackandgpu_view_reservations_name_their_cpu_viewboth passed).Regression run
mainbaselinedd2ae9aalready captured on this machine; runcargo test --workspace -- --test-threads=4andscripts/smoke.ps1before submitting upstream toivall/xcl).Not tested
cargo test --workspaceandscripts/smoke.ps1on this standalone branch (deferred until ready to open upstream), AMD/Intel GPUs, Wine/Linux.AI use