Repository navigation
Improve cpu awareness on zos - #23589
Conversation
f8bba00 to
4849a4d
Compare
192f8c3 to
1311f37
Compare
|
Depends on eclipse-omr/omr#8190 |
|
Almost ready for review. Weβre seeing the same performance gains as with the previous prototype build; however, I still need to launch test buckets for these changes. I'm currently unable to launch zOS builds due to infra issues but I have launched test builds for other platforms. Iβll remove the WIP label once Iβve confirmed that this PR doesnβt introduce any failures. |
|
My personal build for non-z/OS platforms don't show any failures due to these changes. I tested sanity.functional, sanity.system, extended.functional and extended.system. There were 3 failures, 2 of which are already being tracked
MiniMix_extended_3h_0 failure: |
|
My zoS test buckets didn't complete due to infra issues, I have relaunched them. Since I didnβt see any z/OS failures in my earlier testing, Iβll mark this PR as ready for review while the tests finish running. |
|
looking into the Clang Format Check failure |
ab5ef00 to
caff59e
Compare
e0819e0 to
883d0e5
Compare
|
Format checks are passing, this is ready for review |
r30shah
left a comment
There was a problem hiding this comment.
Quick check through, changes overall looks ok to me, though I will review this together with OMR counter part, but small question,
| double cpuCapacity = 0.0; | ||
| if (0 == portLibraryStatusSys) { | ||
| portLibraryStatusSys = j9sysinfo_get_CPU_capacity(&cpuCapacity); | ||
| machineCpuStats->numberOfCpus = cpuCapacity; |
There was a problem hiding this comment.
There is implicit casting here. I assume this numberOfCpus being used later on to calculate the load, can you confirm trunacting this value does not impact - i.e. this is throwing away the factor for SMT gain.
There was a problem hiding this comment.
I have updated the code to query CPU capacity every time instead of caching it in machineCpuStats->numberOfCpus. We set machineCpuStats->numberOfCpus to -1 as an indicator that it isn't valid. I chose this approach over changing the memberβs type to avoid the added complexity of having platform-dependent types.
ff521e6 to
3171085
Compare
|
jenkins test sanity all jdk21 |
|
@VermaSh - Please share a status of z/OS testing here (Including IBM SDK8). |
|
My previous z/OS Jenkins testing didn't have any failures related to these changes. I've kicked off new set of test build (IBM JDK8 test build). I'll summarize the results here once they finish. |
|
jenkins test sanity.openjdk alinux jdk21 |
|
None of the test failures are related to this PR. Most of them are being tracked by open issues. AArch64 sanity.functional failures aren't being tracked but they don't look like real failures. The test failed because another JVM was using scc which prevented it from deleting it. AArch64:
x86-64_windows failures:
|
|
jenkins test sanity.functional alinux jdk21 |
This change enhances CPU awareness on z/OS by adding support for zIIP processors, SMT-2 detection, and more accurate CPU capacity calculations. Key changes: - Add helpers to retrieve zIIP and GCP counts separately - Extend z/OS control block mappings (J9CSD, J9CVTSVT, J9IRARMCTZ, J9CCT) to access CPU configuration data - Implement SMT-2 detection (isSMTEnabled()) with capacity adjustment using SMT_2_GAIN_FACTOR (1.3) - Add retrieveZOSCPUCapacity() that scales GCP contribution by 0.1 when zIIPs are available, reflecting Java's preference for zIIP execution - Include GCP capacity only when IIPHONORPRIORITY is enabled - Replace direct CCT field access with helper functions for CPU load retrieval - Add new port library APIs omrsysinfo_get_CPU_usage_stats() and omrsysinfo_get_CPU_capacity() - Add CPUUsageStats structure containing z/OS-specific metrics including per-process utilization, GCP/zIIP loads, capacities, and IIPHONORPRIORITY status - Update calculateProcessCpuLoad() to use adjusted CPU capacity instead of raw CPU count - Add TR_VerboseCPUStats verbose option for z/OS CPU statistics logging Signed-off-by: Shubham Verma <shubhamv.sv@gmail.com>
3171085 to
92362da
Compare
|
jenkins test sanity all jdk21 |
|
@VermaSh - Can you confirm the failures seen in the build are related or not ? |
|
The PR test failure is not related to this PR. |
|
jenkins test sanity.openjdk aix jdk21 |
|
From my personal z/OS build. There's only one failure that I am not 100% about, all other failures are either actively tracked or infra related. JDK21 z/OS extended.openjdk: JDk21 z/OS - sanity.openjdk failuressanity.openjdk failures jdk_lang_1 - failed due to garbeled characters jdk_lang_j9_0 - failed due to garbeled characters jdk_lang_j9_1 - failed due to garbeled characters jdk_security2_0 jdk_security2_1 jdk_security4_0 jdk_security4_1 jdk_util_other_0 - jdk_util_other_1 - jdk_collections_0 jdk_collections_1 jdk_concurrent_0 jdk_concurrent_1 - Test results: passed: 125; failed: 1; error: 1; excluded: 3; did not meet platform requirements: 1
jdk_foreign_0, jdk_foreign_1 TEST: java/foreign/TestUpcallException.java TEST: java/foreign/trivial/TestTrivialUpcall.java TEST: java/foreign/passheapsegment/TestPassHeapSegment.java TEST: java/foreign/TestAddressDereference.java jdk_vector_float128_j9_0
JDK21 z/OS extended.functional failuresextended.functional errors https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk21_ibm_extended.functional_s390x_zos_Personal_testList_2/1/console https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk21_ibm_extended.functional_s390x_zos_Personal_testList_1/6/consoleText JDK21 z/OS extended.openjdk failuresextended.openjdk failures https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk21_ibm_extended.openjdk_s390x_zos_Personal/6/console TOTAL: 102 EXECUTED: 32 PASSED: 15 FAILED: 17 DISABLED: 51 SKIPPED: 19 |
|
x86-64 windows failures are already being tracked (#23589 (comment)) |
|
@VermaSh - Do you think z/OS failures that you looked into are related to this change ? |
|
Most of them were already being tracked. There were 3 which I think are new failures, but don't look related to this PR. Specjbb failure (new internal issue) floatSanityTests failure (new internal issue) com/sun/tools/attach/warnings/DynamicLoadWarningTest.java failure JDK21 z/OS sanity.functional failuresFAILED test targets: FAILED test targets: |
|
Found an internal issue for |
r30shah
left a comment
There was a problem hiding this comment.
Based on #23589 (comment), I do feel the z/OS failures would be unrelated given that this change is more on control heuristics side and based on the testing done in past, I approve the changes.
@joransiu - If you are OK with the changes, can we merge this ?
|
@r30shah : I agree, the failures don't appear to be related to these changes. I'm OK with these changes. |
|
Merging - as per comment in #23589 (comment) and #23589 (review) |
| #define j9sysinfo_os_has_feature(param1,param2) OMRPORT_FROM_J9PORT(privatePortLibrary)->sysinfo_os_has_feature(OMRPORT_FROM_J9PORT(privatePortLibrary),param1,param2) | ||
| #define j9sysinfo_get_CPU_load(param1) OMRPORT_FROM_J9PORT(privatePortLibrary)->sysinfo_get_CPU_load(OMRPORT_FROM_J9PORT(privatePortLibrary),param1) | ||
| #if defined(J9ZOS390) | ||
| #define j9sysinfo_get_CPU_capacity(param1) OMRPORT_FROM_J9PORT(privatePortLibrary)->sysinfo_get_CPU_load(OMRPORT_FROM_J9PORT(privatePortLibrary),param1) |
There was a problem hiding this comment.
Should this be using sysinfo_get_CPU_capacity rather than sysinfo_get_CPU_load?
There was a problem hiding this comment.
ahh, yes that should be sysinfo_get_CPU_capacity. I'll open an PR to fix that
Enhance z/OS CPU monitoring by utilizing system control structures to
directly retrieve CPU load metrics. This provides more accurate CPU
utilization data for JIT compilation decisions and verbose logging.
Key changes:
port library APIs on z/OS to retrieve CPU metrics from control structures
including zIIP count, capacity, GCP count, utilization percentages,
and process timing information
This implementation leverages z/OS-specific control structures (CVT, CSD)
to provide accurate CPU metrics that account for zIIP processors, SMT
configurations, and the SVT normalization factor.
Signed-off-by: Shubham Verma shubhamv.sv@gmail.com