-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8369609: Continuations preempt_epilog is missing a call to invalidate_jvmti_stack #27878
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
Open
sspitsyn
wants to merge
3
commits into
openjdk:master
Choose a base branch
from
sspitsyn:f1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2
−1
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not directly in
preempt_epilog
? Is it to cover the freeze fast case too? If that’s the case we should remove the call toinvalidate_jvmti_stack
fromjvmti_yield_cleanup
to avoid calling it twice for the freeze slow case. Also I wonder if this call toinvalidate_jvmti_stack
should just be moved toJvmtiVTMSTransitionDisabler::VTMS_unmount_end
instead.Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you for the comment! Yes, I had in mind but forgot to remove the call to
invalidate_jvmti_stack()
fromjvmti_yield_cleanup()
. I've pushed the update now.Unfortunately, this is not going to work for plain/pure continuations as
mount/unmount
code path does not work for them.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.
I see. What do you think about adding
invalidate_jvmti_stack
injvmti_yield_cleanup
if!cont.entry()->is_virtual_thread()
is true to address that case?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.
Good idea! It'd be nice to move the
invalidate_jvmti_stack()
calls out of the continuation code. I'll test it and let you know the results.Uh oh!
There was an error while loading. Please reload this page.
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.
Strangely, the test
serviceability/jvmti/vthread/ContStackDepthTest
is failing with theassert(_cur_stack_depth == num_frames)
. Obviously, some of the code paths is missed to callinvalidate_jvmti_stack()
.Uh oh!
There was an error while loading. Please reload this page.
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.
As I see, the calls to
invalidate_jvmti_stack()
are needed for plain continuations only (under conditionif (!cont.entry()->is_virtual_thread()
).The following patch does not cause regressions in mach5 tier 6 (mach5 tiers 1-5 are in progress):
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.
Ah, we need to call
invalidate_jvmti_stack
at the end injvmti_yield_cleanup
! The problem is that inJvmtiExport::continuation_yield_cleanup
we are setting again the stack depth when callingstate->cur_stack_depth()
. We count the enterSpecial frame at the top but we don’t decrement the depth when removing it (done in assembly code).