8350765: Need to pin when accessing thread container from virtual thread#23810
8350765: Need to pin when accessing thread container from virtual thread#23810AlanBateman wants to merge 10 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
|
@AlanBateman 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 28 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 |
|
@AlanBateman The following label will be automatically applied to this pull request:
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. |
|
@AlanBateman This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
src/java.base/share/classes/jdk/internal/vm/ContinuationSupport.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/ContinuationSupport.java
Outdated
Show resolved
Hide resolved
Webrevs
|
src/java.base/share/classes/jdk/internal/vm/ThreadContainer.java
Outdated
Show resolved
Hide resolved
jaikiran
left a comment
There was a problem hiding this comment.
Thank you for the update Alan. The change looks reasonable to me.
viktorklang-ora
left a comment
There was a problem hiding this comment.
Nice work, Alan!
|
/integrate |
|
Going to push as commit fa41948.
Your commit was automatically rebased without conflicts. |
|
@AlanBateman Pushed as commit fa41948. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Data structures that are accessed by both virtual threads and their carriers require the virtual thread to pin the continuation to avoid potential deadlock. A deadlock can arise when a virtual thread is preempted, is selected and scheduled to be the next owner of the lock/resource, but can't execute because all carriers are blocking on the same lock/resource. There are a small number of places that need to pin. One that was missed is the the notification to the thread container when threads are started or terminate. This is not currently an issue at this time but it is a potential hazard for ongoing and future work that will add further scheduling points to the code. Continuation.pin/unpin have intrinsics since JDK-8338745, and Continuation is initialized early in startup. Finally, the changes have been in the loom repo for several months with no issues.
Testing tier1-5, quick statup/footprint, noreg-hard
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23810/head:pull/23810$ git checkout pull/23810Update a local copy of the PR:
$ git checkout pull/23810$ git pull https://git.openjdk.org/jdk.git pull/23810/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23810View PR using the GUI difftool:
$ git pr show -t 23810Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23810.diff
Using Webrev
Link to Webrev Comment