-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8293922: Extend barrier-less Java thread transitions to native transitions #10302
Conversation
👋 Welcome back rehn! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Both, _thread_state
and _polling_word
are volatile, so the C++ compiler is not allowed to mess up the accesses. The speedup should more than justify the overhead of the SYS_membarrier
call. I hope that we can use it in production at some point of time.
@robehn 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:
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 31 new commits pushed to the
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 |
Thanks, great. But since you bring it up. We should use correct accessors for _thread_state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning it up!
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can't we do the same in ~ThreadBlockInVMPreprocess() for the blocked transition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up.
I do have to wonder why we had those casts that you removed.
Perhaps, but please use a new RFE/bug for that. |
The casts came from the time when the atomics didn't use templates, so it only supported integer types. TBIVM should not really notice any difference, since it mostly used together with VM Mutex, thus must emit a fence on front edge. As Dan says, do a separate RFE if you like it to be consistent. Thanks for reviewing! |
Thanks! |
/integrate |
Going to push as commit 1b49606.
Your commit was automatically rebased without conflicts. |
As suggested by @TheRealMDoerr, avoid the fence for native trans when UseSystemMemoryBarrier is enabled.
Locally I can see methods like Thread.holdsLock() getting a 4 ns speed boost, (~20% faster).
Running t1-5 with UseSystemMemoryBarrier on.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10302/head:pull/10302
$ git checkout pull/10302
Update a local copy of the PR:
$ git checkout pull/10302
$ git pull https://git.openjdk.org/jdk pull/10302/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10302
View PR using the GUI difftool:
$ git pr show -t 10302
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10302.diff