Skip to content
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

8249676: [REDO] G1 incorrectly limiting young gen size when using the reserve can result in repeated full gcs #108

Closed

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Sep 10, 2020

Hi,

please review this re-application of JDK-8249676. The change passes two tier8 (plus tier1-7 which never were a problem) runs w/o problems; the crashes I reported in the original review are gone after recent (other) changes.

Note that this PR contains two commits: the vanilla original patch and an update to fix merge errors with the recent IHOP changes.

Thanks,
Thomas


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8249676: [REDO] G1 incorrectly limiting young gen size when using the reserve can result in repeated full gcs

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/108/head:pull/108
$ git checkout pull/108

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 10, 2020

👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Sep 10, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 10, 2020

@tschatzl The following label will be automatically applied to this pull request: hotspot-gc.

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 (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-gc label Sep 10, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 10, 2020

Webrevs

@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Sep 10, 2020

I recommend looking only at the second commit via Github as the webrev is generated from a fully squashed change.

Copy link
Contributor

@kstefanj kstefanj left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Sep 11, 2020

@tschatzl This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8249676: [REDO] G1 incorrectly limiting young gen size when using the reserve can result in repeated full gcs

Reviewed-by: sjohanss, kbarrett
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 7 commits pushed to the master branch:

  • 9ea43a9: 8253148: Fix terminology in align_down comment
  • 3f455f0: 8253089: Windows (MSVC 2017) build fails after JDK-8243208
  • af8c678: 8247910: Improve alignment and power-of-2 utilities using C++14
  • 70cc7fc: 8253098: Archived full module graph should be disabled if CDS heap cannot be mapped
  • ac9d1b0: 8223187: Remove setLocale() call in jpackage native launcher
  • 9c24a56: 8253029: [PPC64] Remove obsolete Power6 code
  • e6a493a: 8252882: Clean up jdk.javadoc and the related parts of jdk.compiler

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 9ea43a9213e560f5a2b9c762677e8ad94a44a1d7.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Sep 11, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 11, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi,

On 11.09.20 13:28, Stefan Johansson wrote:

On Thu, 10 Sep 2020 10:14:57 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

Hi,

please review this re-application of JDK-8249676. The change passes two tier8 (plus tier1-7 which never were a problem)
runs w/o problems; the crashes I reported in the original review are gone after recent (other) changes.

Note that this PR contains two commits: the vanilla original patch and an update to fix merge errors with the recent
IHOP changes.
Thanks,
Thomas

Looks good.

thanks for your review.

Thomas

@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 13, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

Mostly looks good. A few minor nits, and a couple of questions.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
229 // The main reason is revising young length, with our without the GCLocker being

s/our/or/

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
253 // allocated more than that for reasons. In this case, use that.

s/for reasons/for various reasons/ ?

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
271 if (!next_gc_should_be_mixed(NULL, NULL)) {
272 desired_eden_length_by_pause =
273 calculate_desired_eden_length_by_pause(survivor_base_time_ms,
...
276 } else {
277 desired_eden_length_before_mixed =
278 calculate_desired_eden_length_before_mixed(survivor_base_time_ms,
...
282 // Above either sets desired_eden_length_by_pause or desired_eden_length_before_mixed,
283 // the other is zero. Use the one that has been set below.
284 uint desired_eden_length = MAX2(desired_eden_length_by_pause,
285 desired_eden_length_before_mixed);

This would be simpler if there were
calculate_desired_eden_length_by_pause
which conditionally called (based on next_gc_should_be_mixed) either
calculate_desired_eden_length_before_young_only (new name)
calculate_desired_eden_length_before_mixed

However, this would lose the logging distinction between the two. Is that
logging distinction important enough to justify uglifying the code?

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1116 uint max_length = target_young_length + expansion_region_num;
1117 assert(target_young_length <= max_length, "post-condition");

The assertion seems rather pointless, since we're dealing with unsigned
values. But maybe the intent is to check for overflow, in which case the
assertion message should say so.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1114 assert(expansion_region_num == 0, "sanity");

[pre-existing] This assertion seems pointless.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1364 if (reclaimable_percent <= threshold) {

The two logging messages that follow are rather excessively long.

And if they were formatted differently it might make it more obvious they
are identical except for the parenthetical part of the message. (Or at
least I *think* they are; not so easy to compare by eye across horizongal
scrolling or wrapping.)

(I looked at combining them; not sure it's worthwhile.)

------------------------------------------------------------------------------

@tschatzl tschatzl force-pushed the 8249676-redo-young-gen-sizing-changes branch from 93d8ba4 to ff64ae3 Sep 14, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 14, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi Kim,

thanks for your review.

On 13.09.20 03:41, Kim Barrett wrote:

Mostly looks good. A few minor nits, and a couple of questions.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
229 // The main reason is revising young length, with our without the GCLocker being

s/our/or/

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
253 // allocated more than that for reasons. In this case, use that.

s/for reasons/for various reasons/ ?

Fixed.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
271 if (!next_gc_should_be_mixed(NULL, NULL)) {
272 desired_eden_length_by_pause =
273 calculate_desired_eden_length_by_pause(survivor_base_time_ms,
...
276 } else {
277 desired_eden_length_before_mixed =
278 calculate_desired_eden_length_before_mixed(survivor_base_time_ms,
...
282 // Above either sets desired_eden_length_by_pause or desired_eden_length_before_mixed,
283 // the other is zero. Use the one that has been set below.
284 uint desired_eden_length = MAX2(desired_eden_length_by_pause,
285 desired_eden_length_before_mixed);

This would be simpler if there were
calculate_desired_eden_length_by_pause
which conditionally called (based on next_gc_should_be_mixed) either
calculate_desired_eden_length_before_young_only (new name)
calculate_desired_eden_length_before_mixed

However, this would lose the logging distinction between the two. Is that
logging distinction important enough to justify uglifying the code?

Refactored as suggested. I think the information loss is minimal as we
can easily infer from which path the value in the log message comes from.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1116 uint max_length = target_young_length + expansion_region_num;
1117 assert(target_young_length <= max_length, "post-condition");

The assertion seems rather pointless, since we're dealing with unsigned
values. But maybe the intent is to check for overflow, in which case the
assertion message should say so.

Fixed.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1114 assert(expansion_region_num == 0, "sanity");

[pre-existing] This assertion seems pointless.

Removed.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1Policy.cpp
1364 if (reclaimable_percent <= threshold) {

The two logging messages that follow are rather excessively long.

And if they were formatted differently it might make it more obvious they
are identical except for the parenthetical part of the message. (Or at
least I *think* they are; not so easy to compare by eye across horizongal
scrolling or wrapping.)

(I looked at combining them; not sure it's worthwhile.)

Fixed them a bit, but did not combine the messages. From starting on
this I saw that it made the code more complicated than worth.

I rebased the changes in the PR for easier testing (tier1,2 running).
The webrev did not work before and does not now
(https://bugs.openjdk.java.net/browse/SKARA-595), so it's probably best
again to look at the diff in github at

https://github.com//pull/108/commits/ff64ae374001706958062750b5144d2c61417a69

Thanks,
Thomas

Copy link
Contributor

@kstefanj kstefanj left a comment

Still good.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 15, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi Stefan,

On 15.09.20 10:36, Stefan Johansson wrote:

thanks for your review.

Thomas

@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 15, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 14, 2020, at 5:11 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
On 13.09.20 03:41, Kim Barrett wrote:

src/hotspot/share/gc/g1/g1Policy.cpp
1364 if (reclaimable_percent <= threshold) {
The two logging messages that follow are rather excessively long.
And if they were formatted differently it might make it more obvious they
are identical except for the parenthetical part of the message. (Or at
least I *think* they are; not so easy to compare by eye across horizongal
scrolling or wrapping.)
(I looked at combining them; not sure it's worthwhile.)

Fixed them a bit, but did not combine the messages. From starting on this I saw that it made the code more complicated than worth.

Agreed that the complications aren?t worth it.

I rebased the changes in the PR for easier testing (tier1,2 running). The webrev did not work before and does not now (https://bugs.openjdk.java.net/browse/SKARA-595), so it's probably best again to look at the diff in github at

https://github.com//pull/108/commits/ff64ae374001706958062750b5144d2c61417a69

Thanks. I hope the webrev problems get fixed soon.

@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Sep 15, 2020

/integrate

@openjdk openjdk bot closed this Sep 15, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Sep 15, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2020

@tschatzl Since your change was applied there have been 7 commits pushed to the master branch:

  • 9ea43a9: 8253148: Fix terminology in align_down comment
  • 3f455f0: 8253089: Windows (MSVC 2017) build fails after JDK-8243208
  • af8c678: 8247910: Improve alignment and power-of-2 utilities using C++14
  • 70cc7fc: 8253098: Archived full module graph should be disabled if CDS heap cannot be mapped
  • ac9d1b0: 8223187: Remove setLocale() call in jpackage native launcher
  • 9c24a56: 8253029: [PPC64] Remove obsolete Power6 code
  • e6a493a: 8252882: Clean up jdk.javadoc and the related parts of jdk.compiler

Your commit was automatically rebased without conflicts.

Pushed as commit fa30241.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 15, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi Kim,

On 15.09.20 11:58, Kim Barrett wrote:

On Sep 14, 2020, at 5:11 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
On 13.09.20 03:41, Kim Barrett wrote:

src/hotspot/share/gc/g1/g1Policy.cpp
1364 if (reclaimable_percent <= threshold) {
The two logging messages that follow are rather excessively long.
And if they were formatted differently it might make it more obvious they
are identical except for the parenthetical part of the message. (Or at
least I *think* they are; not so easy to compare by eye across horizongal
scrolling or wrapping.)
(I looked at combining them; not sure it's worthwhile.)

Fixed them a bit, but did not combine the messages. From starting on this I saw that it made the code more complicated than worth.

Agreed that the complications aren?t worth it.

I rebased the changes in the PR for easier testing (tier1,2 running). The webrev did not work before and does not now (https://bugs.openjdk.java.net/browse/SKARA-595), so it's probably best again to look at the diff in github at

https://github.com//pull/108/commits/ff64ae374001706958062750b5144d2c61417a69

Thanks. I hope the webrev problems get fixed soon.

thanks for your review.

Thomas

@tschatzl tschatzl deleted the 8249676-redo-young-gen-sizing-changes branch Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants