XMem: physical page numbers freed are given out again before they pass the title's 21 bits (#233) #316
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!316
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-316"
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?
@illuminatedfellow on GitHub · 2026-11-26 16:13 UTC · original
illuminatedfellow:xmem/reuse-page-numbers→main· +74 −4 · 1 files · 1 commits · openCloses #233.
XMemAllocatePhysicalPagesgave page numbers fromnext_page, which only ever grew. The title keeps a number as 21-bitnumber >> 4(FRAMES), so after about 124 GiB of allocations over a run its truncated numbers were unknown to us (XMemMapPhysicalPagesreturned null) or aliased live low pages.Pages::take(n): numbers are still given in order while they fit (no change in normal runs). Past the limit, the lowest run ofnnumbers not in use (free_run) is given, with a one-time log line.count0, the section released as on any other failure) instead of handing out a number the title cannot keep.n * FRAMESand the end of the range are checked, so an absurdncannot wrap.Test:
page_numbers_freed_are_given_again_past_the_title_s_21_bitscovers the in-order path up to the limit, reuse of the lowest free run, gaps too small, a full range and the 21-bit packing. The numbering logic was also run in a standalone crate on Linux (Rust 1.97); the module's own tests run on Windows CI. Not run in the game: the limit is only reached after ~124 GiB of allocate/free churn.Note:
main's CI is currently red for reasons unrelated to this PR (see #280).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.