-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8314100: G1: Improve collection set candidate selection code #15243
8314100: G1: Improve collection set candidate selection code #15243
Conversation
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
Passed tier1-3 too. |
Webrevs
|
bool should_add = | ||
// We will skip any region that's currently used as an old GC | ||
// alloc region (we should not consider those for collection | ||
// before we fill them up). Otherwise the Old region must satisfy the liveness | ||
// condition and have a complete remembered set. | ||
!G1CollectedHeap::heap()->is_old_gc_alloc_region(r) && | ||
G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes()) && | ||
r->rem_set()->is_complete(); |
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.
Does this work?
assert(!r->rem_set()->is_updating(), "inv");
if (!r->rem_set()->is_complete()) {
return false;
}
if (G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes())) {
add_region(r);
} else {
r->rem_set()->clear(true /* only_cardset */);
}
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 do not think so. Old GC alloc regions need special handling either way (unregistering them as such), and the suggested code may keep them as candidates - they may have a (complete) remembered set here (unless you suggest to change the meaning).
Not sure if breaking up the conjunction any further improves the code; the breakout of the earlier if (is_old() || !...)
avoids the repetition for the remset clearing.
Something like
assert(!r->rem_set()->is_updating(), "must be");
if (!r->rem_set()->is_complete()) {
return false;
}
bool should_add = !r->is_old_gc_alloc_region() || G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes())
if (should_add) {
add_region(r);
} else {
r->rem_set()->clear(true /* only_cardset */);
}
would work if that is better for you.
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.
Yes, this looks better. The comment should make it clear whether is_old_gc_alloc_region
is required for correctness or not. (I believe it is not.)
@tschatzl This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 122 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks @walulyai @albertnetymk for your reviews /integrate |
Going to push as commit 8939d15.
Your commit was automatically rebased without conflicts. |
Hi all,
discussions during review of JDK-8140326 indicated that he code surrounding selecting candidates after marking/rebuild for the collection set could be improved.
Testing: gha
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15243/head:pull/15243
$ git checkout pull/15243
Update a local copy of the PR:
$ git checkout pull/15243
$ git pull https://git.openjdk.org/jdk.git pull/15243/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15243
View PR using the GUI difftool:
$ git pr show -t 15243
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15243.diff
Webrev
Link to Webrev Comment