Repository navigation
Order subrelease candidates by occupancy band and allocation time. - #1926
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_1021515523
branch
from
November 14, 2026 04:04
7976320 to
4189dd8
Compare
When `HugePageFiller::ReleasePages` selects hugepage trackers to break, `CompareForSubrelease` currently ranks candidates by exact used-page count at single-page resolution and breaks ties only by span density. Because `TryGet` prepends to the front of its freelist on every allocation, ties among trackers with the same occupancy and density select the most recently allocated-from tracker first, and a single-page occupancy difference within a 16-page band overrides both span density and how long a tracker has been idle. When `Parameters::subrelease_order_by_allocation_time()` (`TCMALLOC_SONIC_SUBRELEASE_ORDER_BY_ALLOCATION_TIME`) is enabled: - `HugePageFiller::TryGet` updates the tracker's last-allocation timestamp on every allocation using the clock sample already read on that path, and `PageTracker::LastAllocationTime` returns the maximum of tracker creation time and last page allocation time. - `HugePageFiller::CompareForSubrelease` groups used pages into 16-page occupancy bands and orders candidates by lower 16-page occupancy band first, sparse trackers ahead of dense trackers within the same band, oldest last-allocation timestamp first within the same band and density, and exact used-page count when timestamps are equal. Subrelease ordering by allocation time is disabled by default. Co-authored-by: Chris Kennelly <ckennelly@google.com> PiperOrigin-RevId: 1021515523
copybara-service
Bot
force-pushed
the
test_1021515523
branch
from
November 14, 2026 04:17
4189dd8 to
26920c7
Compare
This branch has not been deployed
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.
Order subrelease candidates by occupancy band and allocation time.
When
HugePageFiller::ReleasePagesselects hugepage trackers to break,CompareForSubreleasecurrently ranks candidates by exact used-page count at single-page resolution and breaks ties only by span density. BecauseTryGetprepends to the front of its freelist on every allocation, ties among trackers with the same occupancy and density select the most recently allocated-from tracker first, and a single-page occupancy difference within a 16-page band overrides both span density and how long a tracker has been idle.When
Parameters::subrelease_order_by_allocation_time()(TCMALLOC_SONIC_SUBRELEASE_ORDER_BY_ALLOCATION_TIME) is enabled:HugePageFiller::TryGetupdates the tracker's last-allocation timestamp on every allocation using the clock sample already read on that path, andPageTracker::LastAllocationTimereturns the maximum of tracker creation time and last page allocation time.HugePageFiller::CompareForSubreleasegroups used pages into 16-page occupancy bands and orders candidates by lower 16-page occupancy band first, sparse trackers ahead of dense trackers within the same band, oldest last-allocation timestamp first within the same band and density, and exact used-page count when timestamps are equal.Subrelease ordering by allocation time is disabled by default.
Co-authored-by: Chris Kennelly ckennelly@google.com