Skip to content

JDK-8075816: Deprecate AliasLevel flag since it is broken #8140

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

Closed
wants to merge 3 commits into from

Conversation

tobiasholenstein
Copy link
Member

@tobiasholenstein tobiasholenstein commented Apr 7, 2022

Deprecate the AliasLevel flag. AliasLevel can have the following values:

"0 - for no aliasing, "
"1 - for oop/field/static/array split, "
"2 - for class split, "
"3 - for unique instances"

  • Deprecate AliasLevel in JDK 19.
  • Obsolete it in JDK 20
  • Expire it in JDK 21.

Users will now get the following message when running:
java -XX:AliasLevel= Java HotSpot(TM) 64-Bit Server VM warning: Option AliasLevel was deprecated in version 19.0 and will likely be removed in a future release.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed
  • Change requires a CSR request to be approved

Issues

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8140

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 7, 2022

👋 Welcome back tobiasholenstein! 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 bot commented Apr 7, 2022

@tobiasholenstein The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Apr 7, 2022
@tobiasholenstein tobiasholenstein marked this pull request as ready for review April 7, 2022 08:54
@tobiasholenstein
Copy link
Member Author

/csr needed

@openjdk openjdk bot added rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Apr 7, 2022
@openjdk
Copy link

openjdk bot commented Apr 7, 2022

@tobiasholenstein this pull request will not be integrated until the CSR request JDK-8284515 for issue JDK-8075816 has been approved.

Copy link
Member

@TobiHartmann TobiHartmann 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 to me.

@mlbridge
Copy link

mlbridge bot commented Apr 7, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

I would like to have full description about the issue. The flags has values range [0-3]. Which values are broken? Which default value will be after flags removal and why?

Comment on lines 1048 to 1051
if (!do_escape_analysis() && aliaslevel == 3) {
aliaslevel = 2; // No unique types without escape analysis
}
_AliasLevel = aliaslevel;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, test with EA switched off -XX:-DoEscapeAnalysis
There are tests which switch it off. Also it is off in tier7 and tier8 for compiler tests. So I am puzzled that bug say that it crash with aliasLevel=2.
Also update subject of PR to match new bug's subject.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right: the statement in the bug report that AliasLevel<3 is broken is wrong. The VM crashes for AliasLevel=0 and AliasLevel=1 but not for AliasLevel=2. So with -XX:-DoEscapeAnalysis it is always automatically set toAliasLevel=2.
But when -XX:+DoEscapeAnalysis -XX:+EliminateAllocations there is ONE use-case for AliasLevel :
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/escape.cpp#L336-L341

  • for -XX:AliasLevel=3 split_unique_types(alloc_worklist, arraycopy_worklist, mergemem_worklist); is called
  • for -XX:AliasLevel=2 split_unique_types(alloc_worklist, arraycopy_worklist, mergemem_worklist); is NOT called

So does the use case -XX:+DoEscapeAnalysis -XX:+EliminateAllocations -XX:AliasLevel=2 make sense and is it something that is used?

Since AliasLevel is not completely broken the question is if we should deprecated instead of making it obsolete?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think there is a real use case for -XX:AliasLevel=2 given that one can get similar behavior with -XX:-EliminateAllocations (or -XX:-DoEscapeAnalysis). I would therefore vote for deprecating AliasLevel.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree with Tobias. Lets treat -XX:AliasLevel=2 as -XX:-EliminateAllocations. There are tests which use this flags.
And yes, we should deprecate AliasLevel but correcting bug's and CSR's text with this new information about -XX:AliasLevel=2.

Copy link
Member Author

@tobiasholenstein tobiasholenstein Apr 19, 2022

Choose a reason for hiding this comment

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

The CSR request (JDK-8284515) is now updated for deprecating AliasLevel

@TobiHartmann
Copy link
Member

From looking at the code and history, it seems that AliasLevel values 0 and 1 are currently disabled due to issues. The VM will print:

AliasLevel (1) is not compatible with -Xcomp or -Xmixed
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

But 2 seems to work fine. 3 is the default. @tobiasholenstein did you find any issues with AliasLevel=2?

@tobiasholenstein tobiasholenstein changed the title JDK-8075816: AliasLevel is broken and should be deprecated JDK-8075816: Deprecate AliasLevel flag since it is broken Apr 14, 2022
Copy link
Member

@TobiHartmann TobiHartmann 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 to me.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Apr 19, 2022
@openjdk
Copy link

openjdk bot commented Apr 19, 2022

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

8075816: Deprecate AliasLevel flag since it is broken

Reviewed-by: thartmann, kvn

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 164 new commits pushed to 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann, @vnkozlov) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 19, 2022
@tobiasholenstein
Copy link
Member Author

thanks @TobiHartmann and @vnkozlov for the reviews!

@tobiasholenstein
Copy link
Member Author

tobiasholenstein commented Apr 20, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 20, 2022
@openjdk
Copy link

openjdk bot commented Apr 20, 2022

@tobiasholenstein
Your change (at version 782fb37) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 20, 2022

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 20, 2022
@openjdk openjdk bot closed this Apr 20, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 20, 2022
@openjdk
Copy link

openjdk bot commented Apr 20, 2022

@TobiHartmann @tobiasholenstein Pushed as commit 46b2e54.

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

@tobiasholenstein tobiasholenstein deleted the JDK-8075816 branch August 29, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants