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
8278207: G1: Tighten verification in G1ResetSkipCompactingClosure #6698
Conversation
|
@albertnetymk The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
#ifdef ASSERT | ||
if (r->is_humongous()) { | ||
oop obj = cast_to_oop(r->humongous_start_region()->bottom()); | ||
assert(_collector->mark_bitmap()->is_marked(obj), "must be live"); | ||
} else if (r->is_open_archive()) { | ||
bool is_empty = (_collector->live_words(r->hrm_index()) == 0); | ||
assert(!is_empty, "should contain at least one live obj"); | ||
} else if (r->is_closed_archive()) { | ||
// nothing to assert | ||
} else { | ||
assert(_collector->live_words(region_index) > _collector->scope()->region_compaction_threshold(), | ||
"should be quite full"); | ||
} | ||
#endif |
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.
What do you think about extracting this to a function. Something like:
void assert_should_reset(HeapRegion*) PRODUCT_RETURN;
But you might be able to come up with a better name :)
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.
Considering this method is fairly short, I think having those asserts inlined doesn't hinder readability; instead, provides some documentation concerning in what context this method is invoked.
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 think the fact that the method is short a good reason to extract the asserts, now the bulk of the method is asserts. If we want more documentation I would rather see a comment explaining in what situations regions might be marked as "skip compacting". We do have some documentation on this in G1FullGCHeapRegionAttr
.
I'm fine with leaving the asserts here if you and others prefer it. One other question, can we ever end up here with a closed archive region? Those are marked SkipMarking
so I guess they should be filtered out above?
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.
If we want more documentation I would rather see a comment explaining in what situations regions might be marked as "skip compacting".
These asserts serve as "runnable" documentation -- less likely to deviate from the actual code.
One other question, can we ever end up here with a closed archive region? Those are marked SkipMarking so I guess they should be filtered out above?
Yes; you are right. I should put ShouldNotReachHere()
for closed-archive regions.
I would probably also have preferred to move this lengthy assert into an extra method, but lgtm.
@albertnetymk This change now passes all automated pre-integration checks. 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 374 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.
|
@albertnetymk This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Thanks for the review. /integrate |
Going to push as commit 08e14c6.
Your commit was automatically rebased without conflicts. |
@albertnetymk Pushed as commit 08e14c6. |
Simple change of expanding the verification logic to mirror its source.
Test: tier1-5
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6698/head:pull/6698
$ git checkout pull/6698
Update a local copy of the PR:
$ git checkout pull/6698
$ git pull https://git.openjdk.java.net/jdk pull/6698/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6698
View PR using the GUI difftool:
$ git pr show -t 6698
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6698.diff