-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8293210: G1: Remove redundant check in G1FreeHumongousRegionClosure #10119
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
Conversation
👋 Welcome back ayang! A progress list of the required criteria for merging this PR into |
@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
|
@albertnetymk 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 6 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@@ -182,10 +182,6 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { | |||
} | |||
|
|||
virtual bool do_heap_region(HeapRegion* r) { | |||
if (!r->is_starts_humongous()) { | |||
return false; | |||
} |
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 this check is a fast-path to quickly filter out definitely uninteresting regions, which will be nearly all of them. I'm not convinced it should be removed.
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's the same argument as JDK-8292858; the attr-table can (or should) be used instead of the region-type.
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.
Yeah, and I thought about objecting to that one on the same grounds. In retrospect I regret not doing so.
I see no issue with not using the attr-table. The attr-table is not the UR-source of the information. It is instead a cache of a non-trivial calculation. Avoiding it by directly using one of the inputs to that calculation because doing so gives us a fast-path for what is by far the most common case seems perfectly fine.
@@ -233,7 +233,6 @@ inline bool G1CollectedHeap::is_obj_dead_full(const oop obj) const { | |||
} | |||
|
|||
inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) { | |||
assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object"); |
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 I like the semantic requirement that this only be applied to starts-humongous regions. Unless there is some future change that needs this removal (and not just because of the change to G1FreeHumongousRegionClosure::do_heap_region that I don't like), then I'd prefer it stay.
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 are no other uses in the near future. However, this method doesn't really require that as a pre-condition, even before this PR.
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.
That it doesn't (currently) require that is arguably an implementation detail. I'm speaking of the intended semantics of the function. I think it's a query about the region that corresponds to a humongous object. It's placed near other predicates on objects. That its argument is a region rather than an oop is an inconsistency that arises from how it's being used. Maybe it's misplaced here?
Added a micro benchmark and some results to the ticket. On my box, this PR reduces the relevant phase length by ~50%. |
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.
Still good.
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.
Looks good. One optional suggestion.
if (!is_reclaimable(region_idx)) { | ||
return false; | ||
} | ||
G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
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.
Maybe look up the heap once at closure construction time, caching it in a data member?
Thanks for the review. /integrate |
Going to push as commit 4020ed5.
Your commit was automatically rebased without conflicts. |
@albertnetymk Pushed as commit 4020ed5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Simple change of removing unnecessary code.
Test: hotspot_gc
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10119/head:pull/10119
$ git checkout pull/10119
Update a local copy of the PR:
$ git checkout pull/10119
$ git pull https://git.openjdk.org/jdk pull/10119/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10119
View PR using the GUI difftool:
$ git pr show -t 10119
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10119.diff