xmem: give freed physical page numbers again #124
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/124"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T17:33:11Z.
The page-number free list from #15 (your point 2 there), small and tested, like #108.
Why.
XMemAllocatePhysicalPageshanded out page numbers that only grew, andXMemFreePhysicalPagesgave none back. The title keeps them in 25 bits (number_kept, #111). So after about 128 GiB allocated since start-up, a live number came back as another page's.What.
Physical::number). This keeps numbers as low as the pages alive at once allow.Physical::pinned, keyed by its slice). It becomes free only once the last view showing that page is unmapped (unmap, checked after the Windows re-maps). So a mapped number never reaches two pages.map_fresh_scatter) no longer requires consecutive numbers: freed numbers come back in any order. It already checks that the pages are consecutive slices of one pool, which is what the batch needs.Test.
freed_page_numbers_are_given_again_once_unmapped, on its ownPhysical, since other tests allocate concurrently:It fails without the free list.
victory-hle tests (macOS x86_64, 246), Windows clippy and
cargo xtask policypass. Not checked in game.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:09:57Z.
Merged, thanks. This is the page-number free list from #15.