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

GRA changes to reduce JIT overhead at warm opt levels #7216

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Jan 4, 2024

The commit introduces a new option -Xjit:graFreqThresholdAtWarm= that can be used to control the JIT overhead for compilations performed at warm optimization level or below. The default value of the threshold is 500. A larger value leads to lower JIT overhead but also to potentially lower quality of the generated code. For hot compilations or in situations where we think we can afford more JIT overhead, the threshold is automatically set to 0.

@@ -2952,42 +2672,77 @@ void TR_GlobalRegisterAllocator::offerAllAutosAndRegisterParmAsCandidates(TR::Bl
interestedBlocks.set(block->getNumber());
}

// This first part isn't really looking for If-Then-Else candidates.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should delete this line

// This first part isn't really looking for If-Then-Else candidates.

since it does not really belong anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@vijaysun-omr
Copy link
Contributor

Looks okay to me otherwise. My only suggestion would be to run some proactive personal testing since there is a significant change in how global register candidates are chosen with this change.

@mpirvu mpirvu marked this pull request as ready for review January 5, 2024 17:29
@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 6, 2024

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 6, 2024

sanity functional on all the other platforms has the following problems which may not be due to these changes:

zLinux: https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal/407/tapResults/

VM_OPTIONS:  -XX:+UseCompressedOops -Xjit -Xgcpolicy:balanced 
...
+++ j9vm.test.arraylets.ArrayletAllocateTest: +++
command: /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/jdkbinary/j2sdk-image/bin/java  -XX:+UseCompressedOops -Xjit -Xgcpolicy:balanced  -Xdump -Xms65m -Xmx65m  -Xdisableexcessivegc   -classpath /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/../../jvmtest/functional/VM_Test/VM_Test.jar:/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/../../testDependency/lib/asm-all.jar  j9vm.test.arraylets.ArrayletAllocateTest 

Testing array allocation...
	Testing arrays from 1 to 32...
	Testing arrays from 32 to 64...
	Testing arrays from 96 to 128...
	Testing arrays from 224 to 256...
	Testing arrays from 480 to 512...
	Testing arrays from 992 to 1024...
	Testing arrays from 2016 to 2048...
	Testing arrays from 4064 to 4096...
	Testing arrays from 8160 to 8192...
	Testing arrays from 16352 to 16384...
	Testing arrays from 32736 to 32768...
	Testing arrays from 65504 to 65536...
	Testing arrays from 131040 to 131072...
	Testing arrays from 262112 to 262144...
	Testing arrays from 524256 to 524288...
	Testing arrays from 1048544 to 1048576...
	Testing arrays from 2097120 to 2097152...
	Testing arrays from 4194272 to 4194304...
Array allocation tests passed.
Testing hashed array allocation and growth...
	Testing arrays from 1 to 32...
	Testing arrays from 32 to 64...
	Testing arrays from 96 to 128...
	Testing arrays from 224 to 256...
	Testing arrays from 480 to 512...
	Testing arrays from 992 to 1024...
	Testing arrays from 2016 to 2048...
	Testing arrays from 4064 to 4096...
	Testing arrays from 8160 to 8192...
	Testing arrays from 16352 to 16384...
	Testing arrays from 32736 to 32768...
	Testing arrays from 65504 to 65536...
	Testing arrays from 131040 to 131072...
	Testing arrays from 262112 to 262144...
	Testing arrays from 524256 to 524288...
	Testing arrays from 1048544 to 1048576...
	Testing arrays from 2097120 to 2097152...
JVMDUMP055I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError", exception "Java heap space" at 2024/01/06 02:49:04 - please wait.
JVMDUMP032I JVM requested System dump using '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/core.20240106.024904.2243671.0001.dmp' in response to an event
JVMDUMP010I System dump written to /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/core.20240106.024904.2243671.0001.dmp
JVMDUMP032I JVM requested Heap dump using '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/heapdump.20240106.024904.2243671.0002.phd' in response to an event
JVMDUMP010I Heap dump written to /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/heapdump.20240106.024904.2243671.0002.phd
JVMDUMP032I JVM requested Java dump using '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/javacore.20240106.024904.2243671.0003.txt' in response to an event
JVMDUMP010I Java dump written to /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/javacore.20240106.024904.2243671.0003.txt
JVMDUMP032I JVM requested Snap dump using '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/Snap.20240106.024904.2243671.0004.trc' in response to an event
JVMDUMP010I Snap dump written to /home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_s390x_linux_Personal_testList_0/aqa-tests/TKG/output_17045041347019/J9vmTest_4/Snap.20240106.024904.2243671.0004.trc
JVMDUMP013I Processed dump event "systhrow", detail "java/lang/OutOfMemoryError".
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at j9vm.test.arraylets.ArrayletAllocateTest.main(ArrayletAllocateTest.java:79)
no-zero exit value: 1
*** Test FAILED *** (j9vm.test.arraylets.ArrayletAllocateTest)

On windows, the build failed due to infra: https://openj9-jenkins.osuosl.org/job/Build_JDK17_x86-64_windows_Personal/974/

19:28:48  + git clone -b openj9 https://github.com/ibmruntimes/openj9-openjdk-jdk17.git . --reference /home/jenkins/openjdk_cache
19:28:48  Cloning into '.'...
19:28:48  fatal: unable to access 'https://github.com/ibmruntimes/openj9-openjdk-jdk17.git/': Could not resolve host: github.com

Link to all tests: https://openj9-jenkins.osuosl.org/job/Pipeline-Build-Test-Personal/477/

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 8, 2024

system.functional tests pass on all platforms. Link: https://openj9-jenkins.osuosl.org/job/Pipeline-Build-Test-Personal/478/

The commit introduces a new option -Xjit:graFreqThresholdAtWarm=<NNN>
that can be used to control the JIT overhead for compilations
performed at warm optimization level or below. The default value
of the threshold is 500. A larger value leads to lower JIT overhead
but also to potentially lower quality of the generated code.
For hot compilations or in situations where we think we can afford
more JIT overhead, the threshold is automatically set to 0.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 8, 2024

The latest push deletes some comment as suggested in the code review.

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 9, 2024

Latest round of testing with extended.functional and extended.system (https://openj9-jenkins.osuosl.org/job/Pipeline-Build-Test-Personal/479/) succeeded on aarch64_mac, ppc64_aix, plinux and had the following issues:

aarch64_linux failed the build due to infra

19:25:40  Update omr to commit ID: 263906a5a7d901457592f14d26f1d30e90ebe496
19:25:40  
19:25:40  fatal: reference is not a tree: 263906a5a7d901457592f14d26f1d30e90ebe496

zlinux had a similar build issue:

20:46:36  [2024-01-08 20:46:35] OpenJ9 clone repositories finished in 12 seconds
20:46:36  
20:46:36  Update omr to commit ID: 263906a5a7d901457592f14d26f1d30e90ebe496
20:46:36  
20:46:36  fatal: reference is not a tree: 263906a5a7d901457592f14d26f1d30e90ebe496

x86-64_mac had a similar build issue

20:05:45  Update omr to commit ID: 263906a5a7d901457592f14d26f1d30e90ebe496
20:05:45  
20:05:45  fatal: reference is not a tree: 263906a5a7d901457592f14d26f1d30e90ebe496

win64 had a similar build issue:

19:08:19  Update omr to commit ID: 263906a5a7d901457592f14d26f1d30e90ebe496
19:08:19  
19:08:19  fatal: reference is not a tree: 263906a5a7d901457592f14d26f1d30e90ebe496

xlinux had a trimeout on the crypto tests (part of extended.functional)

TEST RESULT: Error. Program `/home/jenkins/workspace/Test_openjdk17_j9_extended.functional_x86-64_linux_Personal_testList_0/jdkbinary/j2sdk-image/bin/java' timed out (timeout set to 240000ms, elapsed time including timeout handling was 241091ms).

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 15, 2024

OpenJ9 tests sanity.functional, system.functional, extended.functional and extended.system seem to pass on multiple platforms when not affected by infra problems (see links above). Thus I think this PR is ready to be delivered.

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

Successfully merging this pull request may close these issues.

2 participants