XMem: a page mapping that already shows the same pages is not made again #1598

Manually merged
github merged 1 commit from github-bot/gh-1598 into main 2026-11-29 08:21:21 +00:00 AGit
Owner

@⁠mizzied on GitHub · 2026-11-28 22:11 UTC · original
mizzied:up/xmem-same-pages → main · +123 −5 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

What it does. XMemMapPhysicalPages (and with it the scatter form) and the page-mapping copy (map_alias) now leave the views alone when every page asked for is already shown at its address. The bytes are the same and the views' guards stay valid, so mapping them again only cost time. The counts go to the log (the first, then every 4,096th). VICTORY_REMAP_SAME=0 maps them again as before.

How it was tested. RTX 5070, Windows 11.

  • Changed tests: two existing tests that remapped the same pages to exercise a mapping now move a page first.
  • New test: a mapping of the same pages leaves the view alone, shown by a protection set on the view surviving, which it wouldn't with a new view. Mappings of other pages, or after a page moved, still happen as before.

cargo test --workspace passes apart from repository_passes_policy, which already fails on main: lower.rs is over the 640 KiB file-size limit there (#1493 raises it). Clippy reports only the 16 findings already on main, none on lines this PR changes.

**@⁠mizzied** on GitHub · 2026-11-28 22:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1598) `mizzied:up/xmem-same-pages` → `main` · +123 −5 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC **What it does.** `XMemMapPhysicalPages` (and with it the scatter form) and the page-mapping copy (`map_alias`) now leave the views alone when every page asked for is already shown at its address. The bytes are the same and the views' guards stay valid, so mapping them again only cost time. The counts go to the log (the first, then every 4,096th). `VICTORY_REMAP_SAME=0` maps them again as before. **How it was tested.** RTX 5070, Windows 11. - **Changed tests:** two existing tests that remapped the same pages to exercise a mapping now move a page first. - **New test:** a mapping of the same pages leaves the view alone, shown by a protection set on the view surviving, which it wouldn't with a new view. Mappings of other pages, or after a page moved, still happen as before. `cargo test --workspace` passes apart from `repository_passes_policy`, which already fails on `main`: `lower.rs` is over the 640 KiB file-size limit there (#1493 raises it). Clippy reports only the 16 findings already on `main`, none on lines this PR changes.
XMemMapPhysicalPages, and with it the scatter form, and the page-mapping
copy (map_alias) leave the views alone when every page asked for is shown
at its address already: same bytes, and the guards of the views stay valid.
The counts are said in the log (first, then every 4,096th).
VICTORY_REMAP_SAME=0 maps them again.

Two tests that remapped the same pages to exercise a mapping now move a page
first. New test: a mapping of the same pages leaves the view alone (a
protection set on the view survives, which a new view would not), while
other pages, or a page moved, are mapped as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 22:13:14 +00:00
github manually merged commit a7bed2cd5c into main 2026-11-29 08:21:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1598
No description provided.