- Notifications
You must be signed in to change notification settings - Fork 6.1k
8370807: G1: Improve region attribute table method naming #28038
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
8370807: G1: Improve region attribute table method naming #28038
Conversation
| 👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
| @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 4 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 |
Webrevs
|
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.
Change looks good, but the bug-title could be updated to reflect that this is not just a change to a comment.
| } | ||
| | ||
| void G1CollectedHeap::register_old_region_with_region_attr(G1HeapRegion* r) { | ||
| void G1CollectedHeap::register_old_collection_set_region_with_region_attr(G1HeapRegion* r) { |
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.
Why "collection_set" in the name? Is it a precondition that r is in cset?
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.
It must be a region that is currently being added to the collection set. I.e. registered to the attribute table to be in the collection set.
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.
Then in_cset is a postcondition, not a precondition. The new name seems to suggest the arg (r) is old + in_cset, as a precondition.
Looking at the impl, one can't see anything related to "collection_set" in this context. I'd suggest restoring the original name, but YMMV.
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 set_in_old call is the giveaway - in the region attribute table you only set a region to "Old" if it is
static const region_type_t Old = 1; // The region is in the collection set and an old region. Old regions not in the collection set are just NotInCset.
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 "NewSurvivor" do not have the collection_set tagging because they are always in the collection set (i.e. it's obvious).
I thought it would be good to make it clear in the name that for old regions, we only add (old) regions that are part of the collection set.
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 attribute table is an accelerator table - it only mirrors information from elsewhere used during GC. So the given region is already(*) in the collection set, but we can't check easily.
(*) Formally, from the code flow it isn't yet - the cardset group this region is contained in (which determines whether the related regions are in) will also be added during the G1CollectionSet::add_group_to_collection_set() call. This would just require some reordering of the calls, but logically it already is. If you really want I can do that in this change too.
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.
So the given region is already(*) in the collection set
If that's indeed precondition, the new name makes sense.
There is assert(!hr->in_collection_set(), in the caller, which is conflicting with this semantic.
If you really want I can do that in this change too.
I'd prefer doing that (new name + new precondition) in another PR, as the current title imply naming changes only, but up to 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.
There is assert(!hr->in_collection_set(), in the caller, which is conflicting with this semantic.
The reason is that that assert only checks the accelerator table, which must not indicate that we already added it. There is no long form of that in-collections-set check any more, we removed it quite some time ago because we thought it was superfluous.
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.
So reordering the calls does not change the situation, i.e. there is no long-form check for the condition (i.e. the region is in the collection set already and we are just updating the attribute table).
| Thanks @kstefanj @walulyai @albertnetymk for your reviews |
| Going to push as commit 17fd801.
Your commit was automatically rebased without conflicts. |
Hi all,
please review this cleanup of the region attribute registration methods.
Testing: gha
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28038/head:pull/28038$ git checkout pull/28038Update a local copy of the PR:
$ git checkout pull/28038$ git pull https://git.openjdk.org/jdk.git pull/28038/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28038View PR using the GUI difftool:
$ git pr show -t 28038Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28038.diff
Using Webrev
Link to Webrev Comment