Skip to content
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

Refactor virtual thread inspector access #19076

Merged

Conversation

fengxue-IS
Copy link
Contributor

@fengxue-IS fengxue-IS commented Mar 5, 2024

  • Fix getVMThread API to account for suspended virtual thread under transition
  • Refactor acquire/releaseVThreadInspector to handle suspended transition case
  • Add wait in exitTransition, link J9VMThread to vthread object during transition
  • Introduce constant flags and common helper API
  • Convert jvmti API c file to cpp
    jvmtiForceEarlyReturn.c -> .cpp
    jvmtiLocalVariable.c -> .cpp
    jvmtiStackFrame.c -> .cpp

Fix: #18504

Signed-off-by: Jack Lu Jack.S.Lu@ibm.com

@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch from 278231f to e6752fa Compare March 5, 2024 21:30
@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch 8 times, most recently from 81e2f65 to d2b40f4 Compare March 6, 2024 22:31
@fengxue-IS fengxue-IS marked this pull request as ready for review March 6, 2024 22:36
@fengxue-IS
Copy link
Contributor Author

personal build in progress
@babsingh can you take a quick look at this?
local testing on #18735 test passed 30/30, I will launch a grinder to verify once the personal build passes

@fengxue-IS fengxue-IS requested a review from babsingh March 6, 2024 22:36
Copy link
Contributor

@babsingh babsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first review pass.

@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch 7 times, most recently from 81a5e10 to 389129f Compare March 8, 2024 20:37
@fengxue-IS
Copy link
Contributor Author

answered questions related to code change, updated code to use constant flags and common API as suggested.

@babsingh can you take another look please

@fengxue-IS fengxue-IS requested a review from babsingh March 8, 2024 20:43
Copy link
Contributor

@babsingh babsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the previous comments. The changes LGTM functionally.

re #18735 (comment): In addition to SuspendResume2.java, did you also run a grinder with SelfSuspendDisablerTest.java?

@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch from 389129f to 6d82a47 Compare March 11, 2024 16:22
@fengxue-IS
Copy link
Contributor Author

re #18735 (comment): In addition to SuspendResume2.java, did you also run a grinder with SelfSuspendDisablerTest.java?

No, I will launch a grinder once the new review comments have been addressed.

@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch 4 times, most recently from 7046eb2 to 02c7b29 Compare March 11, 2024 17:44
@fengxue-IS
Copy link
Contributor Author

squashed commits, updated PR description

@babsingh
Copy link
Contributor

jenkins test sanity.functional,extended.functional win,plinux jdk8,jdk11

@babsingh
Copy link
Contributor

jenkins test sanity.functional,extended.functional,sanity.openjdk,extended.openjdk zlinux,win,aix jdk21

@babsingh
Copy link
Contributor

jenkins test extended.functional,sanity.openjdk,extended.openjdk alinux jdk22

@keithc-ca
Copy link
Contributor

jenkins test sanity.functional,extended.functional,sanity.openjdk,extended.openjdk aix jdk21

@babsingh
Copy link
Contributor

PR builds:

The Windows PR builds failed due to infra issues. I didn't see any functional failures in them.

An unrelated and known failure is seen in the AIX extended.openjdk build:

java.lang.Error: Probable fatal error: No physical fonts found.
	at java.desktop/sun.font.SunFontManager.lambda$getDefaultPhysicalFont$0(SunFontManager.java:1034)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1034)
	at java.desktop/sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:291)
	at java.desktop/sun.font.CompositeFont.getSlotFont(CompositeFont.java:376)
	at java.desktop/sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
	at java.desktop/sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
	at java.desktop/sun.font.CompositeFont.getMapper(CompositeFont.java:433)
	at java.desktop/sun.font.GlyphList.mapChars(GlyphList.java:250)
	at java.desktop/sun.font.GlyphList.setFromString(GlyphList.java:225)
	at java.desktop/sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:70)
	at java.desktop/sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2931)
	at ImageWriterCompressionTest.main(ImageWriterCompressionTest.java:82)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1595)

@keithc-ca Do you have any feedback for this PR?

@fengxue-IS
Copy link
Contributor Author

Updated code to address review comments

Copy link
Contributor

@keithc-ca keithc-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat the commit message(s) so no lines in the body are longer than 72 characters. Before merging, I expect this should be squashed - feel free to do that now.

@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch from ddb058c to 392bf5e Compare March 15, 2024 17:22
@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch from 392bf5e to ff6c3d8 Compare March 16, 2024 04:03
- Fix getVMThread API to account for suspended virtual thread
  under transition
- Refactor acquire/releaseVThreadInspector to handle
  suspended transition cases
- Add wait loop in exitTransition, link J9VMThread to vthread object
  during transition
- Introduce constant flags and common helper API
- Convert jvmti API c file to cpp
    jvmtiForceEarlyReturn.c -> .cpp
    jvmtiLocalVariable.c -> .cpp
    jvmtiStackFrame.c -> .cpp

Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
@fengxue-IS fengxue-IS force-pushed the 18504-refactor-isSuspendedInternal branch from ff6c3d8 to 4161c8c Compare March 17, 2024 16:12
@babsingh
Copy link
Contributor

jenkins compile plinux jdk8

@babsingh
Copy link
Contributor

jenkins compile win jdk11

@babsingh
Copy link
Contributor

jenkins test extended.openjdk aix jdk21

@babsingh
Copy link
Contributor

jenkins test extended.openjdk alinux jdk22

Copy link
Contributor

@babsingh babsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Known ImageWriterCompressionTest and DatagramChannel failures are seen in the extended.openjdk PR builds, which are unrelated to this PR.

@babsingh babsingh merged commit c1c07c9 into eclipse-openj9:master Mar 19, 2024
6 of 9 checks passed
@babsingh
Copy link
Contributor

@pshipton Shall we backport this change to https://github.com/eclipse-openj9/openj9/tree/v0.44.0-release?

@pshipton
Copy link
Member

I'm open to it, if the testing today/tonight goes well. It seems there is little risk to any versions other than 21, 22, and mainly virtual threads are affected.

@pshipton
Copy link
Member

Pls go ahead with the backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid unsteady states during JVMTI Suspend and Resume All VThreads
4 participants