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

8143041: Unify G1CollectorPolicy::PauseKind and G1YCType #2870

Closed
wants to merge 3 commits into from

Conversation

walulyai
Copy link
Member

@walulyai walulyai commented Mar 8, 2021

Please review this refactoring change to unify G1CollectorPolicy::PauseKind and G1YCType enums under the same file. Additionally, make the distinction between collector types and phases clearer.


Progress

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

Issue

  • JDK-8143041: Unify G1CollectorPolicy::PauseKind and G1YCType

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 8, 2021

👋 Welcome back iwalulya! 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 Pull request is ready for review label Mar 8, 2021
@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@walulyai 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 hotspot-gc-dev@openjdk.org label Mar 8, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 8, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Looks good otherwise.


#include "utilities/debug.hpp"

enum G1YCType {
enum G1YCPhase {
Copy link
Contributor

Choose a reason for hiding this comment

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

I kind of think a better name would be G1YoungPhase - the C in that name is an abbreviation for "collection", and to me, YCPhase indicates the phases in the collection which this is not.
Better names are certainly possible.
Please also add some small documentation, like "The phases the collection cycle can be in".

};

class G1YCTypeHelper {
enum G1GCType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it might be better to name this G1PauseType since Cleanup and Remark aren't really collections. But maybe it's fine as is (or G1GCPauseType if you prefer).

@@ -46,6 +84,7 @@ class G1YCTypeHelper {
default: ShouldNotReachHere(); return NULL;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Extra newline that can be deleted.

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be 2012, 2021, - I do not see a reason to remove the former date.

Copy link
Member Author

Choose a reason for hiding this comment

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

webrev shows this as a new file, while github shows it as a renamed file. Not sure which one to consider.

static const char* to_string(G1YCType type) {

static bool is_young_only_pause(G1GCType type) {
assert(type != FullGC, "must be");
Copy link
Contributor

Choose a reason for hiding this comment

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

These three asserts could probably be moved into a helper method as the exact same code is used in is_mixed_pause() too. Your call.

public:
static const char* to_string(G1YCType type) {

static bool is_young_only_pause(G1GCType type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is_young_pause_young_only()? Just to match the method. Feel free to ignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think adding the assert_is_young_pause should remove the need to add is_young_pause prefix to these methods.

type == YoungGC;
}

static bool is_mixed_pause(G1GCType type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is_young_pause_mixed()? Just to match the method. Feel free to ignore.

return type == MixedGC;
}

static bool is_last_young_pause(G1GCType type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is_young_pause_last_young(). I also think this method is missing the three asserts of the other methods (pre-existing).

return type == LastYoungGC;
}

static bool is_concurrent_start_pause(G1GCType type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is_young_pause_concurrent_start(). Same as above, it should have the three asserts.

@walulyai
Copy link
Member Author

walulyai commented Mar 9, 2021

Thanks @tschatzl , I have updated with the proposed changes

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Lgtm.

@openjdk
Copy link

openjdk bot commented Mar 10, 2021

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

8143041: Unify G1CollectorPolicy::PauseKind and G1YCType

Reviewed-by: tschatzl, ayang

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

  • 7e52a6e: 8263380: Unintended use of Objects.nonNull in VarHandles
  • 4b5be40: 8238812: assert(false) failed: bad AD file
  • b2a2ddf: 8262438: sun/security/ssl/SSLLogger/LoggingFormatConsistency.java failed with "SocketException: Socket is closed"
  • c8c0234: 8262471: Fix coding style in src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java
  • 4d21a45: 8262913: KlassFactory::create_from_stream should never return NULL
  • fab5676: 8247869: Change NONCOPYABLE to delete the operations
  • c0542ed: 6251901: BasicTextUI: installDefaults method are contrary to the documentation
  • fdd3941: 8263233: Update java.net and java.nio to use instanceof pattern variable
  • 3fe8a46: 8263170: ComboBoxModel documentation refers to a nonexistent type
  • d8a9c3c: 8263002: Remove CDS MiscCode region
  • ... and 35 more: https://git.openjdk.java.net/jdk/compare/22a3117d229cba10c690a4e66baf9c754a09e57c...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 Pull request is ready to be integrated label Mar 10, 2021
@walulyai
Copy link
Member Author

Thanks @tschatzl and @albertnetymk for the reviews

@walulyai
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Mar 11, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 11, 2021
@openjdk
Copy link

openjdk bot commented Mar 11, 2021

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

  • f6b4ba0: 8261931: IGV: quick search fails on multi-line node labels
  • 7988c1d: 8262443: GenerateOopMap::do_interpretation can spin for a long time.
  • 32cbd19: 8263105: security-libs doclint cleanup
  • 6971c23: 8262351: Extra '0' in java.util.Formatter for '%012a' conversion with a sign character
  • c6d74bd: 8262910: Cleanup THREAD/TRAPS/naming and typing issues in ObjectMonitor and related code
  • 57f16f9: 8262377: Parallel class resolution loses constant pool error
  • b482733: 8259218: (fs) Add links in from overloaded methods in java.nio.file.Files
  • acda812: 8263333: Improve links from core reflection to JLS and JVMS
  • 9399e1b: 8261918: two runtime/cds/appcds/VerifierTest failed with "Unable to use shared archive"
  • 7e52a6e: 8263380: Unintended use of Objects.nonNull in VarHandles
  • ... and 44 more: https://git.openjdk.java.net/jdk/compare/22a3117d229cba10c690a4e66baf9c754a09e57c...master

Your commit was automatically rebased without conflicts.

Pushed as commit 470b150.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
3 participants