Skip to content

PeiCore AllocatePages check free pages first - #13233

Draft
mdkinney wants to merge 2 commits into
tianocore:masterfrom
mdkinney:PeiCoreAllocatePagesCheckFreePagesFirst
Draft

mdkinney wants to merge 2 commits into
tianocore:masterfrom
mdkinney:PeiCoreAllocatePagesCheckFreePagesFirst

Conversation

@mdkinney

@mdkinney mdkinney commented Oct 1, 2026

Copy link
Copy Markdown
Member

Description

Search the active bin for the smallest suitable freed range before top-down allocation. Search the PHIT after type-bin exhaustion, while retaining the unrestricted final fallback.

Add GoogleTest coverage for best-fit reuse, bin boundaries, and the default-bin and final unrestricted fallback paths. Register the test in the MdeModulePkg host-test DSC.

  • Breaking change?
  • Impacts security?
  • Includes tests?

How This Was Tested

Tested with included unit tests and verified no regressions on existing platforms

Integration Instructions

N/A

@mdkinney

mdkinney commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Based on RFC: tianocore/tianocore-wiki.github.io#51

Search free HOBs before top-down allocation only after a pre-memory free
or alignment-padding event. Keep post-install ordering and final fallback.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
@mdkinney
mdkinney force-pushed the PeiCoreAllocatePagesCheckFreePagesFirst branch from f8afe0b to 1177622 Compare October 2, 2026 01:54
Cover reuse after pre-memory frees, the zero-event search skip, and
preserved top-down ordering after permanent memory installation.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
@mdkinney
mdkinney force-pushed the PeiCoreAllocatePagesCheckFreePagesFirst branch from 1177622 to 5dc2a31 Compare October 2, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant