Skip to content

8335334: Stress mode to randomly execute unstable if traps #21037

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 23 commits into from

Conversation

TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Sep 17, 2024

Unstable if traps are supposed to be taken rarely. This patch introduces a StressUnstableIfTraps flag that forces unstable if traps to be taken randomly and thus potentially triggering intermittent bugs such as incorrect debug information. It works by adding another if before the unstable if that checks a "random" condition at runtime (a simple shared counter) and then either takes the trap or executes the original, unstable if.

This stress option also has the nice side effect of triggering re-compilation of methods that would otherwise not be re-compiled (see JDK-8335843).

I had to adjust a few tests that rely on methods being compiled / deoptimized because with the stress option enabled, deoptimization might unexpectedly (not) happen.

It reliably triggers JDK-8335977, JDK-8320308 and JDK-8335843 in our testing.

Tested with multiple runs up to tier6. I'll integrate it into our (Oracle internal) testing and CTW (JDK-8340302) once all the bugs that it currently triggers are fixed.

Thanks,
Tobias


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8335334: Stress mode to randomly execute unstable if traps (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21037/head:pull/21037
$ git checkout pull/21037

Update a local copy of the PR:
$ git checkout pull/21037
$ git pull https://git.openjdk.org/jdk.git pull/21037/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21037

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21037.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 17, 2024

👋 Welcome back thartmann! 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 Sep 17, 2024

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

8335334: Stress mode to randomly execute unstable if traps

Reviewed-by: chagedorn, 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 100 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.

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 17, 2024
@openjdk
Copy link

openjdk bot commented Sep 17, 2024

@TobiHartmann 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 Sep 17, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 17, 2024

Webrevs

@@ -719,6 +719,11 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
method()->ensure_method_data();
}

if (StressLCM || StressGCM || StressIGVN || StressCCP ||
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to initialize the seed earlier because StressUnstableIfTraps is already used during parsing.

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.

Few comments.

Copy link
Member Author

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

Thanks for your review, Vladimir! I uploaded a new version and addressed your comments.

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.

More comments.

Copy link
Member Author

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

Thanks again Vladimir. I updated the code and answered your comments.

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.

Looks good now.

@vnkozlov
Copy link
Contributor

What do you think?

Thank you for looking on this. I am fine with current code.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 19, 2024
@TobiHartmann
Copy link
Member Author

Thanks Vladimir!

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

Small suggestion, otherwise, it looks good to me, too!

}
}

void Parse::stress_trap(IfNode* orig_iff, Node* counter, Node* incr_store) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a brief summary as method comment (i.e. following the explanation in the PR)? This would help to understand the reason why we want to stress traps, how it looks in the IR, and how frequently the trap is taken.

@TobiHartmann
Copy link
Member Author

Thanks for the review Christian! I added a comment to Parse::stress_trap.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 23, 2024
Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

Thanks for adding the comment! Great to have this new stress mode :-)

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 23, 2024
@TobiHartmann
Copy link
Member Author

Thanks Christian!

@TobiHartmann
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 23, 2024

Going to push as commit 63e611c.
Since your change was applied there have been 101 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 Sep 23, 2024
@openjdk openjdk bot closed this Sep 23, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 23, 2024
@openjdk
Copy link

openjdk bot commented Sep 23, 2024

@TobiHartmann Pushed as commit 63e611c.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants