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

8258284: clean up issues with nested ThreadsListHandles #1844

Closed
wants to merge 2 commits into from

Conversation

dcubed-ojdk
Copy link
Member

@dcubed-ojdk dcubed-ojdk commented Dec 18, 2020

While working on JDK-8231627, I discovered there were issues with nested
ThreadsListHandles. I added a new test to verify how ThreadsListHandles and
nested ThreadsListHandles are supposed to work. I found two bugs:

  1. A failure to restore the expected _threads_hazard_ptr when a nested
    ThreadsListHandle is destroyed.

  2. A failure to decrement _nested_threads_hazard_ptr_cnt when a nested
    ThreadsListHandle is destroyed.

The second failure mode is what tripped up my fix for JDK-8231627 so that
bug fix depends on this bug fix.

Mach5 Tier[1-3] testing has no regressions (macOSX testing is incomplete at the moment).


Progress

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

Issue

  • JDK-8258284: clean up issues with nested ThreadsListHandles

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 18, 2020

👋 Welcome back dcubed! 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.

@dcubed-ojdk
Copy link
Member Author

/label add hotspot-runtime

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Dec 18, 2020
@openjdk
Copy link

openjdk bot commented Dec 18, 2020

@dcubed-ojdk
The hotspot-runtime label was successfully added.

@dcubed-ojdk
Copy link
Member Author

@dholmes-ora, @fisk and @robehn - You three are the usual folks that review
Thread-SMR stuff. @fisk - this should be of particular interest to you since I'm
tweaking your changes to the nested ThreadsListHandle code.

@dcubed-ojdk dcubed-ojdk marked this pull request as ready for review December 18, 2020 17:15
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 18, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 18, 2020

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.

One small nit about using Atomic::store(). Otherwise it looks good. Great that you found this and added a test so it won't bite us again.

}
// Clear the hazard ptr so we can go through the fast path below and
// acquire a nested stable ThreadsList.
_thread->_threads_hazard_ptr = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be Atomic::store()

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a bug in the baseline also, but I can fix it since I'm already
touching that line.

I also noticed that we weren't really consistent about using atomic
operations with the _threads_hazard_ptr field and we don't always
use the (mis-named) get_threads_hazard_ptr(). I plan to make
another cleanup pass with a different bug ID for those.

@openjdk
Copy link

openjdk bot commented Dec 18, 2020

@dcubed-ojdk 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:

8258284: clean up issues with nested ThreadsListHandles

Reviewed-by: eosterlund, rehn

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 88 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 ready Pull request is ready to be integrated label Dec 18, 2020
@dcubed-ojdk
Copy link
Member Author

@fisk - Thanks for the fast review. Fixed in the incremental that I just pushed.

Copy link
Contributor

@robehn robehn left a comment

Choose a reason for hiding this comment

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

Thanks

@dcubed-ojdk
Copy link
Member Author

@robehn - Thanks for the review!

/integrate

@openjdk openjdk bot closed this Dec 22, 2020
@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 Dec 22, 2020
@openjdk
Copy link

openjdk bot commented Dec 22, 2020

@dcubed-ojdk Since your change was applied there have been 89 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 172af15.

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

@dcubed-ojdk dcubed-ojdk deleted the JDK-8258284 branch January 6, 2021 17:43
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
3 participants