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

8271060: Merge G1CollectedHeap::determine_start_concurrent_mark_gc and G1Policy::decide_on_conc_mark_initiation #4867

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Jul 22, 2021

Hi all,

can I have reviews for this merge of two methods that have the same purpose: determine whether this pause should be a concurrent start pause. The reason for this merge is that G1CollectedHeap::determine_start_concurrent_mark_gc just calls the other, and

  • is the only caller
  • only adds another condition of the same type that G1Policy::decide_on_conc_mark_initiation does at the beginning
  • adds some return value checking and return value
    which all imho fit into G1Policy::decide_on_conc_mark_initiation too.

It also reduces G1CollectedHeap a bit. The main reason for me to put this in the new location is basically that that additional condition in G1CollectedHeap::determine_start_concurrent_mark_gc makes all conditions for that decision be located closer together.

If you think otherwise and this is a bad idea, I will close this PR.

Testing: manual gc/g1 runs

Thanks,
Thomas


Progress

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

Issue

  • JDK-8271060: Merge G1CollectedHeap::determine_start_concurrent_mark_gc and G1Policy::decide_on_conc_mark_initiation

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4867/head:pull/4867
$ git checkout pull/4867

Update a local copy of the PR:
$ git checkout pull/4867
$ git pull https://git.openjdk.java.net/jdk pull/4867/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4867

View PR using the GUI difftool:
$ git pr show -t 4867

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4867.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 22, 2021

👋 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
Copy link

@openjdk openjdk bot commented Jul 22, 2021

@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 pull request command.

@openjdk openjdk bot added the hotspot-gc label Jul 22, 2021
@tschatzl tschatzl marked this pull request as ready for review Jul 22, 2021
@openjdk openjdk bot added the rfr label Jul 22, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 22, 2021

Webrevs

Copy link
Member

@albertnetymk albertnetymk left a comment

bool should_start_concurrent_mark_operation = policy()->decide_on_concurrent_start_pause();

The name, decide_on_concurrent_start_pause(), is not very obvious, IMO; I feel it's because it's trying to do two things: 1. deciding the pause type, 2. returns whether the decided pause type is concurrent_start_gc.

I wonder if sth like the following (decoupling the two tasks) is clearer:

policy()->decide_pause_type();
bool should_start_concurrent_mark_operation = collector_state()->in_concurrent_start_gc();

Ofc, this is very subjective. The PR is fine as it is.

@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Jul 22, 2021

bool should_start_concurrent_mark_operation = policy()->decide_on_concurrent_start_pause();

The name, decide_on_concurrent_start_pause(), is not very obvious, IMO; I feel it's because it's trying to do two things: 1. deciding the pause type, 2. returns whether the decided pause type is concurrent_start_gc.

I wonder if sth like the following (decoupling the two tasks) is clearer:

policy()->decide_pause_type();
bool should_start_concurrent_mark_operation = collector_state()->in_concurrent_start_gc();

Ofc, this is very subjective. The PR is fine as it is.

Thanks for your review. I understand your concerns and will think about it. Are there any other opinions in that direction?

@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Jul 22, 2021

I updated the code according to @albertnetymk 's suggestions: I've been on the fence about this already anyway.

Copy link

@kimbarrett kimbarrett left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 22, 2021

@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:

8271060: Merge G1CollectedHeap::determine_start_concurrent_mark_gc and G1Policy::decide_on_conc_mark_initiation

Reviewed-by: ayang, kbarrett

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 2 new commits pushed to the master branch:

  • d1257d5: 8271126: ProblemList runtime/InvocationTests/invokevirtualTests.java
  • 50bb731: 8270286: com.sun.net.httpserver.spi.HttpServerProvider: remove use of deprecated API

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jul 22, 2021
@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Jul 23, 2021

Thanks @kimbarrett and @albertnetymk for your reviews.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jul 23, 2021

Going to push as commit ea182b5.
Since your change was applied there have been 26 commits pushed to the master branch:

  • fb85960: 8271149: remove unreferenced functions from EncodingSupport_md.c
  • 8156ff6: 8271147: java/nio/file/Path.java javadoc typo
  • 9935440: Merge
  • e3800e6: 8271162: runtime/StackTrace/LargeClassTest.java can be run in driver mode
  • ee93cef: 8271158: runtime/handshake/HandshakeTimeoutTest.java test doesn't check exit code
  • 84be910: 8271169: runtime/Safepoint/TestAbortVMOnSafepointTimeout.java can be run in driver mode
  • 2d165a2: 8271160: runtime/jni/checked/TestCheckedJniExceptionCheck.java doesn't set -Djava.library.path
  • 7165b3f: 8271155: Wrong path separator in env variable
  • ecc37b0: 8270916: Update java.lang.annotation.Target for changes in JLS 9.6.4.1
  • 4812e53: 8271094: runtime/duplAttributes/DuplAttributesTest.java doesn't check exit code
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/9131a8f5f241b04c28a875fddb7a060cc9a3c252...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 23, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 23, 2021

@tschatzl Pushed as commit ea182b5.

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

@tschatzl tschatzl deleted the submit/8271060-decide-on-conc-mark-termination branch Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants