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

Adjust inliner use of profiled fanin data #21001

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Jan 22, 2025

The inliner uses some heuristics that tries to avoid the inlining of large callees that have already been compiled. What constitutes a large method is determined in a routine called isLargeCompileMethod().
If the callee is in a large frequency block, then we always want to inline that callee.
If the callee is in a medium or low frequency block, then we look at callee size and at the fanin info (how many methods call this callee). For low frequency blocks we are more conservative with inlining than with medium frequency blocks. The existing code contained a bug in that, if there was no fanin info for a callee in a low frequency block, we would always inline the callee, regardless of its size.
This commit fixes this problem and considers the size of the callee first and then the fanin info. If there is no fanin info, then the size of the callee is the only criterion.

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 23, 2025

jenkins test sanity all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 23, 2025

zlinux failed one test j9vmtest_4. 50x grinder here: https://openj9-jenkins.osuosl.org/job/Grinder/4076/ passed

The inliner uses some heuristics that tries to avoid the
inlining of large callees that have already been compiled.
What constitutes a large method is determined in a
routine called `isLargeCompileMethod()`.
If the callee is in a large frequency block, then we always
want to inline that callee.
If the callee is in a medium or low frequency block, then we
look at callee size and at the fanin info (how many methods
call this callee). For low frequency blocks we are more
conservative with inlining than with medium frequency blocks.
The existing code contained a bug in that, if there was no fanin
info for a callee in a low/medium frequency block, we would always
inline the callee, regardless of its size.
This commit fixes this problem and considers the size of the callee
first and then the fanin info. If there is no fanin info, then
the size of the callee is the only criterion.

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 24, 2025

Rebased to incorporate the latest fanin change from #21004

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 24, 2025

jenkins test sanity all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Jan 25, 2025

All tests have passed, except on AIX. On AIX one of the 3 testlists has experienced an infra problem which I have seen before:

14:29:20  Running test jdk_security2_0 ...
14:29:20  ===============================================
14:29:20  jdk_security2_0 Start Time: Fri Jan 24 19:10:04 2025 Epoch Time (ms): 1737745804918
14:29:20  variation: Mode150
14:29:20  JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 
14:29:20  { \
14:29:20  echo "";	echo "TEST SETUP:"; \
14:29:20  "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image/bin/java" -Xshareclasses:destroyAll; "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image/bin/java" -Xshareclasses:groupAccess,destroyAll; echo "cache cleanup done"; \
14:29:20  mkdir -p "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0"; \
14:29:20  cd "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0"; \
14:29:20  echo "";	echo "TESTING:"; \
14:29:20  "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image/bin/java" -Xmx512m -jar "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../../jvmtest/openjdk/jtreg/lib/jtreg.jar" \
14:29:20  -agentvm -a -ea -esa -v:fail,error,time,nopass -retain:fail,error,*.dmp,javacore.*,heapdump.*,*.trc -ignore:quiet -timeoutFactor:8 -xml:verify  -concurrency:1 -nativepath:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/openjdk-test-image/jdk/jtreg/native" -vmoptions:"-Xmx512m  -XX:+UseCompressedOops -Xverbosegclog  " \
14:29:20  -timeoutHandler:jtreg.openj9.CoreDumpTimeoutHandler -timeoutHandlerDir:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/../../testDependency/lib/openj9jtregtimeouthandler.jar" \
14:29:20  -w ""/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0"/work" \
14:29:20  -r ""/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0"/report" \
14:29:20  -jdk:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image" \
14:29:20  -exclude:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../openjdk/openjdk-jdk/test/jdk/ProblemList.txt" \
14:29:20  -exclude:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../../jvmtest/openjdk/excludes/ProblemList_openjdk21-openj9.txt" \
14:29:20   \
14:29:20  -exclude:"/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../openjdk/excludes/vendors/eclipse/ProblemList_openjdk21.txt" \
14:29:20  "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../openjdk/openjdk-jdk/test/jdk:jdk_security2"; \
14:29:20  if [ $? -eq 0 ]; then echo "-----------------------------------"; echo "jdk_security2_0""_PASSED"; echo "-----------------------------------"; cd /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/..;  else echo "-----------------------------------"; echo "jdk_security2_0""_FAILED"; echo "-----------------------------------"; fi; \
14:29:20  echo "";	echo "TEST TEARDOWN:"; \
14:29:20  "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image/bin/java" -Xshareclasses:destroyAll; "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/jdkbinary/j2sdk-image/bin/java" -Xshareclasses:groupAccess,destroyAll; echo "cache cleanup done"; \
14:29:20   } 2>&1 | tee -a "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/TestTargetResult";
14:29:21  
14:29:21  TEST SETUP:
14:29:21  JVMSHRC005I No shared class caches available
14:29:21  JVMSHRC005I No shared class caches available
14:29:21  cache cleanup done
14:29:21  
14:29:21  TESTING:
14:29:22  Directory "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0/work" not found: creating
14:29:22  Directory "/home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/../TKG/output_17377411319147/jdk_security2_0/report" not found: creating
14:29:31  XML output with verification to /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_ppc64_aix_Personal_testList_2/aqa-tests/TKG/output_17377411319147/jdk_security2_0/work
14:37:43  Cannot contact p8-java1-ibm04: java.lang.InterruptedException

It's already tracked here: #19962

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.

1 participant