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

8319897: Move StackWatermark handling out of LockStack::contains #16609

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Nov 10, 2023

There are StackWatermark handling inside LockStack::contains. This is an indication that either:

  1. some thread has failed to start it's own StackWatermark processing, or
  2. that some thread is looking into the oops of another thread without starting the StackWatermark handling. The latter is usually more common.

I propose that we hoist the StackWatermark processing out of the LockStack into the code that actually performs pokes around in other thread's data. This is usually where we put the StackWatermark processing calls.

Note: that this doesn't fix a bug, it merely moves the processing code nearer the source of the problematic calls. I've found that jmm_GetThreadInfo looks straight into running thread's lock stacks without while those threads are running. That is a race that we should get rid of and I've created JDK-8319899 for that issue.


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-8319897: Move StackWatermark handling out of LockStack::contains (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16609

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 10, 2023

👋 Welcome back stefank! A progress list of the required criteria for merging this PR into pr/16605 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 Nov 10, 2023
@openjdk
Copy link

openjdk bot commented Nov 10, 2023

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Nov 10, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 10, 2023

Webrevs

Copy link
Contributor

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

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Relocation seems fine, but one request below.

Thanks.

src/hotspot/share/runtime/lockStack.inline.hpp Outdated Show resolved Hide resolved
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Update looks good! Thanks.

@stefank
Copy link
Member Author

stefank commented Nov 14, 2023

Thanks for reviewing!
This passes tier1-tier8 on Linux-x64

@stefank
Copy link
Member Author

stefank commented Nov 14, 2023

This passes tier1-3

Copy link
Member

@dcubed-ojdk dcubed-ojdk left a comment

Choose a reason for hiding this comment

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

Thumbs up. Thanks for adding the assert in LockStack::contains()
since that should catch any accidental new uses. Also thanks for
documenting the testing that has been done.

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/16605 to master November 17, 2023 07:08
@openjdk-notifier
Copy link

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout 8319897_StackWatermark_in_LockStack
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk
Copy link

openjdk bot commented Nov 17, 2023

@stefank this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8319897_StackWatermark_in_LockStack
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed rfr Pull request is ready for review labels Nov 17, 2023
@openjdk
Copy link

openjdk bot commented Nov 17, 2023

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

8319897: Move StackWatermark handling out of LockStack::contains

Reviewed-by: eosterlund, dholmes, dcubed

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 ready Pull request is ready to be integrated rfr Pull request is ready for review and removed merge-conflict Pull request has merge conflict with target branch labels Nov 17, 2023
@stefank
Copy link
Member Author

stefank commented Nov 17, 2023

Thanks for reviewing!
/integrate

@openjdk
Copy link

openjdk bot commented Nov 17, 2023

Going to push as commit bbf52e0.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 129c470: 8311932: Suboptimal compiled code of nested loop over memory segment

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 17, 2023
@openjdk openjdk bot closed this Nov 17, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 17, 2023
@openjdk
Copy link

openjdk bot commented Nov 17, 2023

@stefank Pushed as commit bbf52e0.

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