-
Notifications
You must be signed in to change notification settings - Fork 722
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
Virtual Thread Support #18432
Virtual Thread Support #18432
Conversation
This improves perf by saving the resources used to store and initialize these variable. Signed-off-by: Babneet Singh <[email protected]>
Return JVMTI_ERROR_THREAD_NOT_SUSPENDED if the thread was not suspended and was not the current thread. For virtual threads, VirtualThread.state is read and it is checked if JVMTI_VTHREAD_STATE_SUSPENDED is set in VirtualThread.state. This check is incorrect because JVMTI_VTHREAD_STATE_SUSPENDED represents an internal state at the Java level. It does not imply if the virtual thread is suspended through JVMTI. JVMTI NotifyFramePop is updated to check if the virtual thread is suspended through JVMTI. Signed-off-by: Babneet Singh <[email protected]>
VM is entered by the invocation of internalEnterVMFromJNI. VM is exited by the invocation of internalExitVMToJNI. VM is always entered before acquireVThreadInspector and enterVThreadTransitionCritical are invoked. In these functions, the goal can be achieved by just releasing and re-acquiring VM access. The new changes just release and re-acquire VM access instead of exiting and entering the VM. This has less overhead. Addresses: eclipse-openj9#18420 (comment) Signed-off-by: Babneet Singh <[email protected]>
@gacholio Requesting your review. This PR address your feedback from #18420 (comment), and a few other issues. |
jenkins test sanity win jdk8 |
jenkins test sanity zlinux jdk21 |
@gacholio PR builds have unrelated failures. All testing passed, but the build failed with an infra issue:
Known failure seen twice: #18384. |
1. Update acquireVThreadInspector and enterVThreadTransitionCritical
VM is entered by the invocation of
internalEnterVMFromJNI
.VM is exited by the invocation of
internalExitVMToJNI
.VM is always entered before
acquireVThreadInspector
andenterVThreadTransitionCritical
are invoked.In these functions, the goal can be achieved by just releasing
and re-acquiring VM access. The new changes just release and
re-acquire VM access instead of exiting and entering the VM.
This has less overhead.
Addresses: #18420 (comment)
2. Update error handling in JVMTI NotifyFramePop
Return
JVMTI_ERROR_THREAD_NOT_SUSPENDED
if the thread was notsuspended and was not the current thread.
For virtual threads,
VirtualThread.state
is read and it is checkedif
JVMTI_VTHREAD_STATE_SUSPENDED
is set inVirtualThread.state
.This check is incorrect because
JVMTI_VTHREAD_STATE_SUSPENDED
represents an internal state at the Java level. It does not
imply if the virtual thread is suspended through JVMTI.
JVMTI NotifyFramePop is updated to check if the virtual thread
is suspended through JVMTI.
3. Remove unused variables in jvm.c
This improves perf by saving the resources used to store and
initialize these variable.
Signed-off-by: Babneet Singh [email protected]