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

Recognize Thread.onSpinWait() on Power #20907

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

IBMJimmyk
Copy link
Contributor

@IBMJimmyk IBMJimmyk commented Jan 10, 2025

Thread.onSpinWait() is a yield instruction on Power. The method is recognized and inlined into JIT code.

Original behavior can be restored by setting the TR_noPauseOnSpinWait environment variable.

Edit:
Depends on eclipse-omr/omr#7604
The OMR PR needs to be merged first since it implements the properties of the yield instruction.

@IBMJimmyk
Copy link
Contributor Author

@zl-wang Can you take a look at this when you get the chance?

Copy link
Contributor

@zl-wang zl-wang left a comment

Choose a reason for hiding this comment

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

LGTM

@zl-wang
Copy link
Contributor

zl-wang commented Jan 13, 2025

Jenkins test sanity plinux,aix jdk8,jdk23

@IBMJimmyk
Copy link
Contributor Author

This PR depends on an OMR PR to implement the yield instruction. The build failed for that reason.

Thread.onSpinWait() is a yield instruction on Power. The method is
recognized and inlined into JIT code.

Original behavior can be restored by setting the TR_noPauseOnSpinWait
environment variable.

Signed-off-by: jimmyk <[email protected]>
@zl-wang
Copy link
Contributor

zl-wang commented Jan 14, 2025

Jenkins test sanity plinux,aix jdk8,jdk23

@IBMJimmyk
Copy link
Contributor Author

@zl-wang
The OMR PR ( eclipse-omr/omr#7604 ) just got merged in. It should be possible to run the tests now.

@zl-wang
Copy link
Contributor

zl-wang commented Jan 15, 2025

Jenkins test sanity plinux,aix jdk8,jdk23

1 similar comment
@zl-wang
Copy link
Contributor

zl-wang commented Jan 16, 2025

Jenkins test sanity plinux,aix jdk8,jdk23

@IBMJimmyk
Copy link
Contributor Author

Failing test is:

20:52:44      [javac] Assertion failed at /home/jenkins/workspace/Build_JDK23_ppc64_aix_Personal/omr/compiler/codegen/OMRTreeEvaluator.cpp:590: false
20:52:44      [javac] VMState: 0x0005ff04
20:52:44      [javac] 	badILOp BadILOp cannot be evaluated
20:52:44      [javac] 
20:52:44      [javac] compiling java/lang/ClassLoader.defineClass(Ljava/lang/String;Ljava/nio/ByteBuffer;Ljava/security/ProtectionDomain;)Ljava/lang/Class; at level: scorching
20:52:44      [javac] Unhandled exception
20:52:44      [javac] Type=Segmentation error vmState=0x0005ff04
20:52:44      [javac] J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000032
20:52:44      [javac] Handler1=09001000A0CA94A8 Handler2=09001000A0B44428
20:52:44      [javac] R0=0000000000000000 R1=00000100216596C0 R2=08001000A01CBC88 R3=0000010021659730
20:52:44      [javac] R4=7CC802A6F8010010 R5=7CC802A6F8010010 R6=08001000A0018098 R7=0000000000260000
20:52:44      [javac] R8=0000000000000000 R9=000000002F436C61 R10=0000000000000004 R11=00000100216622E0
20:52:44      [javac] R12=000000002220442B R13=000001002166D800 R14=000001002165D200 R15=000001002165D0D8
20:52:44      [javac] R16=000001002165D0DC R17=0000000000000080 R18=000001002165D0E0 R19=000001002165B557
20:52:44      [javac] R20=0000010021661528 R21=09001000A0B44428 R22=09001000A0B462F0 R23=0000000000000018
20:52:44      [javac] R24=0000000000000018 R25=00000100100BC650 R26=0000000000000000 R27=000000000000000B
20:52:44      [javac] R28=0000010021662280 R29=08001000A01D22F0 R30=0000000030012C00 R31=0000010021659770
20:52:44      [javac] IAR=0900000005B5F5AC LR=0900000005B5F018 MSR=A00000000000D032 CTR=0000000000000000
20:52:44      [javac] CR=2420442000000001 FPSCR=0000000000000000 XER=0000000100000000
20:52:44      [javac] FPR0=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR1=3fec39c3a0000000 (f: 2684354560.000000, d: 8.820513e-01)
20:52:44      [javac] FPR2=4034000000000000 (f: 0.000000, d: 2.000000e+01)
20:52:44      [javac] FPR3=00000000000000ac (f: 172.000000, d: 8.497929e-322)
20:52:44      [javac] FPR4=00000000000000a6 (f: 166.000000, d: 8.201490e-322)
20:52:44      [javac] FPR5=41efffffffe00000 (f: 4292870144.000000, d: 4.294967e+09)
20:52:44      [javac] FPR6=40c36c0000000000 (f: 0.000000, d: 9.944000e+03)
20:52:44      [javac] FPR7=412e848000000000 (f: 0.000000, d: 1.000000e+06)
20:52:44      [javac] FPR8=3ff0000000000000 (f: 0.000000, d: 1.000000e+00)
20:52:44      [javac] FPR9=4530000000000000 (f: 0.000000, d: 1.934281e+25)
20:52:44      [javac] FPR10=412e848000000000 (f: 0.000000, d: 1.000000e+06)
20:52:44      [javac] FPR11=43300000000f4240 (f: 1000000.000000, d: 4.503600e+15)
20:52:44      [javac] FPR12=4530000000000000 (f: 0.000000, d: 1.934281e+25)
20:52:44      [javac] FPR13=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR14=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR15=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR16=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR17=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR18=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR19=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR20=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR21=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR22=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR23=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR24=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR25=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR26=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR27=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR28=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR29=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR30=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] FPR31=0000000000000000 (f: 0.000000, d: 0.000000e+00)
20:52:44      [javac] Module=/home/jenkins/workspace/Test_openjdk23_j9_sanity.openjdk_ppc64_aix_Personal/jdkbinary/j2sdk-image/lib/default/libj9jit29.so
20:52:44      [javac] Module_base_address=0900000004979000
20:52:44      [javac] 
20:52:44      [javac] Method_being_compiled=java/lang/ClassLoader.defineClass(Ljava/lang/String;Ljava/nio/ByteBuffer;Ljava/security/ProtectionDomain;)Ljava/lang/Class;
20:52:44      [javac] Target=2_90_20250116_49 (AIX 7.1)
20:52:44      [javac] CPU=ppc64 (16 logical CPUs) (0x780000000 RAM)
20:52:44      [javac] ----------- Stack Backtrace -----------
20:52:46      [javac] Unhandled exception
20:52:46      [javac] Type=Segmentation error vmState=0x00070000
20:52:46      [javac] J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000032
20:52:46      [javac] Handler1=09001000A0CA94A8 Handler2=09001000A0B44428
20:52:46      [javac] JVMPORT001E 
20:52:46      [javac] R0=0000000000000001 R1=00000100100A9C70 R2=09001000A0CAE9F8 R3=0000000030010700
20:52:46      [javac] R4=00000000000BABE0 R5=0000000000000005 R6=0000010010128D30 R7=000000000005D5F0
20:52:46      [javac] R8=0900000006913D48 R9=0000000013810081 R10=0000000000000004 R11=09000000046D5630
20:52:46      [javac] R12=000000005IAR=090000000446C8D4 LR=0900000004462244 MSR=A00000000200D032 CTR=090000000054A314
20:52:46      [javac] CR=53949350E00FFFFF FPSCR=8200000000000000 XER=E00FFFFF82000000
20:52:46      [javac] JVMPORT001E 
20:52:46      [javac] FPR0=0000000000000001 (f: 1.000000, d: 4.940656e-324)
20:52:46      [javac] FPR1=c3e0000000000000 (f: 0.000000, d: -9.223372e+18)
20:52:46      [javac] FPR2=3ff0000000000000 (f: 0.000000, d: 1.000000e+00)
20:52:46      [javac] FPR3=433000000002e988 (f: 190856.000000, d: 4.503600e+15)
20:52:46      [javac] FPR4=0000000000000000 (f: 0.000000, Module=/home/jenkins/workspace/Test_openjdk23_j9_sanity.openjdk_ppc64_aix_Personal/jdkbinary/j2sdk-image/lib/default/libj9vm29.so

BadILOp when compiling ClassLoader.defineClass looks to be an existing issue:
#20267 (comment)

@zl-wang zl-wang merged commit 2e897d0 into eclipse-openj9:master Jan 17, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants