Skip to content

Scale background treatment candidate scan budget with heap size and cap collapses per pass. - #1769

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1009048454
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1009048454

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Scale background treatment candidate scan budget with heap size and cap collapses per pass.

Previously, HugePageUnbackedTrackerTreatment scanned at most 64 never-observed or stale split trackers per pass in occupancy order, which could starve lower-occupancy trackers on large heaps and repeatedly rescan the same uncollapsible trackers at the head of the filler lists.

Select eligible candidate trackers using an oldest-record-first buffer compacted with std::nth_element, placing never-observed trackers ahead of stale split records. Break equal-timestamp ties by treatment priority and list traversal order, and scale the per-pass scan budget linearly with filler heap size between 64 and 1,024 trackers so large heaps are swept within one record interval.

When applying treatments, cap userspace collapse attempts separately at 64 per pass in priority order while continuing to observe residency and subrelease unbacked, swapped, and stale free pages for all scanned split candidates.

Co-authored-by: Chris Kennelly ckennelly@google.com

@google-cla

google-cla Bot commented Oct 28, 2026

Copy link
Copy Markdown

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
copybara-service Bot force-pushed the test_1009048454 branch 5 times, most recently from 2cb9a5d to 42b1ec4 Compare October 30, 2026 04:50
…ap collapses per pass.

Previously, `HugePageUnbackedTrackerTreatment` scanned at most 64 never-observed or stale split trackers per pass in occupancy order, which could starve lower-occupancy trackers on large heaps and repeatedly rescan the same uncollapsible trackers at the head of the filler lists.

Select eligible candidate trackers using an oldest-record-first buffer compacted with `std::nth_element`, placing never-observed trackers ahead of stale split records. Break equal-timestamp ties by treatment priority and list traversal order, and scale the per-pass scan budget linearly with filler heap size between 64 and 1,024 trackers so large heaps are swept within one record interval.

When applying treatments, cap userspace collapse attempts separately at 64 per pass in priority order while continuing to observe residency and subrelease unbacked, swapped, and stale free pages for all scanned split candidates.

Co-authored-by: Chris Kennelly <ckennelly@google.com>
PiperOrigin-RevId: 1009048454

This branch has not been deployed

No deployments
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.

0 participants