-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8253241: Update comment on java_suspend_self_with_safepoint_check() #225
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
Conversation
👋 Welcome back rrich! A progress list of the required criteria for merging this PR into |
@reinrich 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 |
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.
The updated wording in the comment looks good to me.
I still get a headache when thinking about the associated
suspend/resume races, but that's my problem and not yours.
@reinrich This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements After integration, the commit message will be:
Since the source branch of this PR was last updated there have been 79 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 automatic rebasing, please merge ➡️ To integrate this PR with the above commit message to the |
Please wait for @dholmes-ora to review this change. |
Thanks for looking over it.
I'd think the suspend/resume implementation could be simplified if the suspender would always direct handshake the suspendee. JavaThread::is_ext_suspend_completed() could be removed then. Likewise the suspend equivalent optimization. And I would not expect an impact on performance by doing it. |
Sure. |
src/hotspot/share/runtime/thread.cpp
Outdated
// The correct thread state of a suspended thread is _thread_blocked. With that state | ||
// safepoint/handshake code will count it as safepoint/handshake safe. Also it allows | ||
// another thread to continue if it is waiting in is_ext_suspend_completed() for this | ||
// thread to change state from _thread_in_native_trans to the target 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.
The revised wording doesn't really convey the situation to me. We have to set the thread-state to _thread_blocked so that a thread waiting in _is_ext_suspend_completed can proceed (there is no generic "target" state - it must be _thread_blocked). I would simplify and rephrase as follows:
"We have to set the thread state directly to _thread_blocked so that it will be seen to be safepoint/handshake safe whilst suspended. This is also necessary to allow a thread in is_ext_suspend_completed, that observed the _thread_in_native_trans state, to proceed."
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.
Ok, I will use your version.
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.
LGTM! :) Thanks
Thanks :) |
/integrate |
@reinrich Since your change was applied there have been 79 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 226faa5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
After JDK-8252414 the safepoint/handshake code does not take _suspend_flags into accout anymore in its assessment if a thread is safepoint/handshake safe. This change updates the comment on JavaThread::java_suspend_self_with_safepoint_check().
I have (not yet) fixed the line breaks (fill-paragraph in emacs lingo) for a clearer diff.
Also I could inline the (*) footnote.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/225/head:pull/225
$ git checkout pull/225