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
8228609: G1 copy cost prediction uses used vs. actual copied bytes #927
Conversation
|
Webrevs
|
This PR is not recognized as backport. Please fix that (e.g. by changing the title to "Backport hash of original commit", https://wiki.openjdk.java.net/display/SKARA/Backports#Backports-BackportPullRequests). |
4574137
to
89870b8
Compare
This backport pull request has now been updated with issue and summary from the original commit. |
89870b8
to
be56589
Compare
@linade
|
be56589
to
c30b074
Compare
@GoeLin I enabled the tests. Some of them seem to be blocked by a gcc dependency issue. Would you take a look? |
Hi, you should only label a change jdk11u-fix-request once it is ready for integration. I'll remove the label, please add it again if you have a review. |
Gentle ping. Can anyone review this? The reason I believe it's worth a backport is, apart from what's mentioned in https://bugs.openjdk.java.net/browse/JDK-8228609, it correctly accounts for early reclaimed humongous objects. I think originally the oversight of the size of early reclaimed humongous objects cause the calculation to be erroneous, resulting in a very high copy time prediction and unstable gc frequency. |
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.
This change is very different from the original one, but fixing it in 11u sounds feasible to me. We'll test it.
Do you have a specific test case which allows observing unstable gc frequency?
src/hotspot/share/gc/g1/g1Policy.cpp
Outdated
@@ -667,10 +668,9 @@ void G1Policy::record_collection_pause_end(double pause_time_ms, size_t cards_sc | |||
|
|||
size_t freed_bytes = heap_used_bytes_before_gc - cur_used_bytes; |
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.
freed_bytes
is now unused.
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.
Removed. Thanks.
We observed this in an application. With additional logging, we can observe the miscalculation from, e.g., test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java The current way to get copied_bytes will result in negative value. I had
copied_bytes is negative because it is deduced from There currently is an if condition Not reporting is fine. At worst we lose some data points. But it can also happen that we get a positive, near-zero |
/reviewers 2 |
@TheRealMDoerr |
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 technically good and the fix makes sense to me. Our nightly tests haven't found any issues related to it. It extracts the essential fix from the original change which differs a lot: openjdk/jdk@9a4c257
An additional person with GC experience should review it.
Approvers will have to judge how relevant it is. A comment from the original author would be helpful.
@linade 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! |
I hink it makes sense. It is not exactly a backport, but rather a re-write, and I find it difficult to follow and convince myself that it's doing the correct thing. Therefore it seems somewhat risky. |
uint length = _g1h->collection_set()->young_region_length(); | ||
for (uint region_index = 0; region_index < length; region_index++) { | ||
surviving_young_words[region_index] += _surviving_young_words[region_index]; | ||
surviving_young_words[region_index] += G1ParScanThreadState::surviving_young_words()[region_index]; |
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.
Was that code using the wrong index before? IOW, it used the surviving_young_words of the wrong 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.
Yes, that's what I think.
So this pr is achieving two things (sorry if it were not clear):
- fix the index issue: this causes calculation of the total surviving young words to be incorrect. The correct stats are stored in _surviving_young_words[1, .., n] instead of [0, .., n-1]
- use a precise "copied bytes" instead of inferring from (used() - freed())
@linade 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! |
@linade This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
I would like to backport 8228609 which fixes a prediction error regarding cost per bytes copied.
The patch does not apply cleanly, so this backport is basically changing the calculation of copied bytes.
https://bugs.openjdk.java.net/browse/JDK-8227442 is not in 11u. So this patch also uses G1ParScanThreadState::surviving_young_words() in place of _surviving_young_words to adjust for the correct cset index.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk11u-dev pull/927/head:pull/927
$ git checkout pull/927
Update a local copy of the PR:
$ git checkout pull/927
$ git pull https://git.openjdk.java.net/jdk11u-dev pull/927/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 927
View PR using the GUI difftool:
$ git pr show -t 927
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk11u-dev/pull/927.diff