-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration #28036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@pengxiaolong The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
| result = allocate_with_affiliation(iterator, req.affiliation(), req, in_new_region); | ||
| } | ||
|
|
||
| bool allow_new_region = can_allocate_in_new_region(req); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we losing the check here? Before this change, the region had to be FREE and the generation affiliated with the request had to have free_unaffiliated_regions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused about this part, if we can find a FREE region in the partition, why we still need to test if the generation must have free_unaffiliated_regions, I can add can_allocate_in_new_region back to retain the original behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The young and old collector reserves both have FREE regions, but we need to make sure we don't exceed the reserves for one or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the can_allocate_in_new_region check back, it should have same behavior now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed can_allocate_in_new_region again after merging @kdnilsen's change unifying accountings, since we don't have consistency in accountings anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to enforce that requests for a young evacuation don't take memory that was reserved for old evacuations. can_allocate_in_new_region isn't about consistency between freeset and generation accounting, it's used to maintain old/young collector reserves.
To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice:
2 can be saved if we also remember the first FREE region seem in 1.
The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference)
Test:
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28036/head:pull/28036$ git checkout pull/28036Update a local copy of the PR:
$ git checkout pull/28036$ git pull https://git.openjdk.org/jdk.git pull/28036/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28036View PR using the GUI difftool:
$ git pr show -t 28036Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28036.diff
Using Webrev
Link to Webrev Comment