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

8270014: Add scoped objects for g1 young gc verification and young gc internal timing #4768

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Jul 13, 2021

Hi all,

can I get reviews for some further cleanup of the young collection code:

  • adding some more scoped objects (verification, gc pause timing)
  • some naming, minor related code movement

Thanks,
Thomas


Progress

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

Issue

  • JDK-8270014: Add scoped objects for g1 young gc verification and young gc internal timing

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4768

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 13, 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 openjdk bot added the rfr label Jul 13, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 13, 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 13, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 13, 2021

Webrevs

@@ -519,8 +519,6 @@ void G1GCPhaseTimes::print_other(double accounted_ms) const {
}

void G1GCPhaseTimes::print() {
note_gc_end();

if (_cur_verify_before_time_ms > 0.0) {
Copy link
Member

@albertnetymk albertnetymk Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this if just checking whether verification is enabled or not? If so, can VerifyBeforeGC be used? Otherwise, it's unclear to me why we are comparing it with 0.0.

Copy link
Contributor Author

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if checks whether any verification work has been done (it will be > 0.0 if it has been set) in this pause. We can't just use VerifyBefore/AfterGC because verification before/after does not always run for all young gc pauses (see VerifyGCType).
If we want to change this (existing) behavior to like always print the time if the flag is enabled I would suggest to file another CR instead of hiding it here (I can do all that and the associated work if that is desired).

Copy link
Member

@albertnetymk albertnetymk Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't just use VerifyBefore/AfterGC because...

I see; thank you for the explanation.

If we want to change this (existing) behavior to like always print the time if the flag is enabled

Either that or just put some comment there, since in what situation the condition is true is not obvious. Ofc, this is very subjective.

void note_young_gc_pause_start();
void note_young_gc_pause_end();
Copy link
Member

@albertnetymk albertnetymk Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious to me if there's a diff btw young_gc_pause and young_collection, or what the diff is. I think having some comments for these two pairs of methods would make it easier to understand.

Copy link
Contributor Author

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments. gc_pause is the whole pause, collection is about just the collection part (as defined by the inner scope of the do_collection_pause_at_safepoint_helper). Feel free to suggest better naming.

Copy link
Contributor Author

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like record_young_collection_work_start; another question is whether we should keep the note_ prefix for the pause or change it to record_ as well as it seems quite common.

Copy link
Member

@walulyai walulyai Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we change to record_

Copy link
Member

@walulyai walulyai left a comment

lgtm!

G1GCPhaseTimes* p = phase_times();

double end_time_sec = os::elapsedTime();
double start_time_sec = phase_times()->cur_collection_start_sec();
double start_time_s = phase_times()->cur_collection_start_sec();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike this change of nomenclature to use _s suffix instead of _sec suffix to indicate units of seconds. The latter is in wide use in GC code.

Copy link

@kimbarrett kimbarrett left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 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:

8270014: Add scoped objects for g1 young gc verification and young gc internal timing

Reviewed-by: ayang, iwalulya, 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 34 new commits pushed to the master branch:

  • 1ebd946: 8270333: -XX:+VerifyStringTableAtExit should not do linear search
  • 04b73bc: 8269656: The test test/langtools/tools/javac/versions/Versions.java has duplicate test cycles
  • 7c23491: 8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858
  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • 381bd62: 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
  • 82c256e: 8259499: Handling type arguments from outer classes for inner class in javadoc
  • e5db9a9: 8268620: InfiniteLoopException test may fail on x86 platforms
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/375fc2a2b29c454b36d3ae068a080b28f6ec04e9...master

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 15, 2021
@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Jul 15, 2021

Thanks @albertnetymk @walulyai @kimbarrett for your reviews.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2021

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

  • 793d772: 8270475: Remove unused G1STWDrainQueueClosure
  • 1ebd946: 8270333: -XX:+VerifyStringTableAtExit should not do linear search
  • 04b73bc: 8269656: The test test/langtools/tools/javac/versions/Versions.java has duplicate test cycles
  • 7c23491: 8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858
  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • 381bd62: 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
  • 82c256e: 8259499: Handling type arguments from outer classes for inner class in javadoc
  • ... and 25 more: https://git.openjdk.java.net/jdk/compare/375fc2a2b29c454b36d3ae068a080b28f6ec04e9...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Jul 15, 2021

@tschatzl Pushed as commit 7a89ffe.

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

@tschatzl tschatzl deleted the submit/8270014-scope-objects-verification-3 branch Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
4 participants