From sroy at openjdk.org Wed Aug 6 13:43:17 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 6 Aug 2025 13:43:17 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v3] In-Reply-To: References: Message-ID: > JBS Issue : [JDK-8030957](https://bugs.openjdk.org/browse/JDK-8030957) > > These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created). > > getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo > > For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407) > > Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: > > com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all > com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all Suchismith Roy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: - Merge branch 'master' into cpuprocessload - Merge branch 'master' into cpuprocessload - Update UnixOperatingSystem.c - Merge branch 'openjdk:master' into cpuprocessload - cleanup - system cpu load - restore problem list - cpu process load ------------- Changes: https://git.openjdk.org/jdk/pull/25332/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25332&range=02 Stats: 79 lines in 2 files changed: 73 ins; 2 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25332.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25332/head:pull/25332 PR: https://git.openjdk.org/jdk/pull/25332 From mbaesken at openjdk.org Wed Aug 6 13:51:04 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 6 Aug 2025 13:51:04 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v3] In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 13:43:17 GMT, Suchismith Roy wrote: >> JBS Issue : [JDK-8030957](https://bugs.openjdk.org/browse/JDK-8030957) >> >> These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created). >> >> getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo >> >> For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407) >> >> Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: >> >> com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all >> com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all > > Suchismith Roy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge branch 'master' into cpuprocessload > - Merge branch 'master' into cpuprocessload > - Update UnixOperatingSystem.c > - Merge branch 'openjdk:master' into cpuprocessload > - cleanup > - system cpu load > - restore problem list > - cpu process load test/jdk/ProblemList.txt line 558: > 556: > 557: > 558: com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java 8364314 generic-all Wondering - why is that added ? Is it intended ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2257230418 From sroy at openjdk.org Wed Aug 6 14:13:05 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 6 Aug 2025 14:13:05 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v3] In-Reply-To: References: Message-ID: <3Vwjg-ioaRzQHhcP2VoZTnDl9SSLk2BLlsoJ22Gia44=.5222663d-8705-47cc-a060-2b57f92f119a@github.com> On Wed, 6 Aug 2025 13:48:15 GMT, Matthias Baesken wrote: >> Suchismith Roy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge branch 'master' into cpuprocessload >> - Merge branch 'master' into cpuprocessload >> - Update UnixOperatingSystem.c >> - Merge branch 'openjdk:master' into cpuprocessload >> - cleanup >> - system cpu load >> - restore problem list >> - cpu process load > > test/jdk/ProblemList.txt line 558: > >> 556: >> 557: >> 558: com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java 8364314 generic-all > > Wondering - why is that added ? Is it intended ? @MBaesken it was part of master branch. shall I remove it ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2257317031 From mbaesken at openjdk.org Wed Aug 6 14:17:04 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 6 Aug 2025 14:17:04 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v3] In-Reply-To: <3Vwjg-ioaRzQHhcP2VoZTnDl9SSLk2BLlsoJ22Gia44=.5222663d-8705-47cc-a060-2b57f92f119a@github.com> References: <3Vwjg-ioaRzQHhcP2VoZTnDl9SSLk2BLlsoJ22Gia44=.5222663d-8705-47cc-a060-2b57f92f119a@github.com> Message-ID: On Wed, 6 Aug 2025 14:10:44 GMT, Suchismith Roy wrote: >> test/jdk/ProblemList.txt line 558: >> >>> 556: >>> 557: >>> 558: com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java 8364314 generic-all >> >> Wondering - why is that added ? Is it intended ? > > @MBaesken it was part of master branch. shall I remove it ? Did not expect this in your PR . Bit unsure why it is there. It is not here https://github.com/openjdk/jdk/blob/master/test/jdk/ProblemList.txt so why is it needed in your PR ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2257330020 From sroy at openjdk.org Wed Aug 6 15:08:18 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 6 Aug 2025 15:08:18 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v3] In-Reply-To: References: <3Vwjg-ioaRzQHhcP2VoZTnDl9SSLk2BLlsoJ22Gia44=.5222663d-8705-47cc-a060-2b57f92f119a@github.com> Message-ID: On Wed, 6 Aug 2025 14:14:53 GMT, Matthias Baesken wrote: >> @MBaesken it was part of master branch. shall I remove it ? > > Did not expect this in your PR . > Bit unsure why it is there. > > It is not here https://github.com/openjdk/jdk/blob/master/test/jdk/ProblemList.txt so why is it needed in your PR ? @MBaesken Not sure. It was showing as a conflict due a change from master, so I thought to keep it. Will remove it then. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2257492886 From sroy at openjdk.org Wed Aug 6 15:08:18 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 6 Aug 2025 15:08:18 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: References: Message-ID: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> > JBS Issue : [JDK-8030957](https://bugs.openjdk.org/browse/JDK-8030957) > > These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created). > > getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo > > For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407) > > Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: > > com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all > com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: Update ProblemList.txt ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25332/files - new: https://git.openjdk.org/jdk/pull/25332/files/80a6dba6..e4c076f7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25332&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25332&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25332.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25332/head:pull/25332 PR: https://git.openjdk.org/jdk/pull/25332 From stuefe at openjdk.org Thu Aug 7 05:39:17 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 7 Aug 2025 05:39:17 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> References: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> Message-ID: On Wed, 6 Aug 2025 15:08:18 GMT, Suchismith Roy wrote: >> JBS Issue : [JDK-8030957](https://bugs.openjdk.org/browse/JDK-8030957) >> >> These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created). >> >> getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo >> >> For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407) >> >> Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: >> >> com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all >> com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all > > Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: > > Update ProblemList.txt > Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: > Who? me? Other Reviewers? Strange PR description ;-) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25332#issuecomment-3162562129 From stuefe at openjdk.org Thu Aug 7 06:06:17 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 7 Aug 2025 06:06:17 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> References: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> Message-ID: On Wed, 6 Aug 2025 15:08:18 GMT, Suchismith Roy wrote: >> JBS Issue : [JDK-8030957](https://bugs.openjdk.org/browse/JDK-8030957) >> >> These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created). >> >> getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo >> >> For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407) >> >> Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: >> >> com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all >> com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all > > Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: > > Update ProblemList.txt Changes requested by stuefe (Reviewer). src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c line 43: > 41: static perfstat_cpu_total_t cpu_total_old; > 42: static time_t last_sample_time = 0; > 43: static double last_cpu_load = -1.0; Not threadsafe. What happens if you call this concurrently from multiple threads? Visibility of these three values can be in any order of updates. You'd get skewed values. Check out how Linux does it. They use mutexes to synchronize access to this function. src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c line 54: > 52: if (initialized && (now - last_sample_time < 5)) { > 53: return last_cpu_load; // Return cached value if less than 5s > 54: } Are you sure this is needed? How slow is perfstat_cpu_total? src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c line 102: > 100: prev_timebase = curr_stats.last_timebase; > 101: initialized = 1; > 102: return -1.0; Here, and above in the other function: this seems wrong and would result in the first measurement to be off (or very large if displayed as unsigned). See how Linux does it in perfInit(). ------------- PR Review: https://git.openjdk.org/jdk/pull/25332#pullrequestreview-3095405436 PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2259126398 PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2259127887 PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2259157137 From stuefe at openjdk.org Thu Aug 7 06:06:18 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 7 Aug 2025 06:06:18 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: References: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> Message-ID: <9IAX8fOEqLRoOeFdOR1lNTcFTtlipeXO5as2BFahcpg=.b40d3fac-17cd-4f0d-ad6c-5c59902042a4@github.com> On Thu, 7 Aug 2025 05:46:29 GMT, Thomas Stuefe wrote: >> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: >> >> Update ProblemList.txt > > src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c line 43: > >> 41: static perfstat_cpu_total_t cpu_total_old; >> 42: static time_t last_sample_time = 0; >> 43: static double last_cpu_load = -1.0; > > Not threadsafe. What happens if you call this concurrently from multiple threads? Visibility of these three values can be in any order of updates. You'd get skewed values. > > Check out how Linux does it. They use mutexes to synchronize access to this function. Style nit, you may want to group these together into a nice structure, too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25332#discussion_r2259142734 From duke at openjdk.org Fri Aug 8 13:09:42 2025 From: duke at openjdk.org (Lei Zhu) Date: Fri, 8 Aug 2025 13:09:42 GMT Subject: jmx-dev RFR: 8362533: Tests sun/management/jmxremote/bootstrap/* duplicate VM flags [v2] In-Reply-To: References: <0XgKkckS1Dk_jyA5ojiQzdopsrs-O5KLu__l7xsQV3g=.da19026b-55a6-4972-9e65-0f712b98ac99@github.com> Message-ID: On Thu, 31 Jul 2025 13:11:13 GMT, Kevin Walls wrote: >> Lei Zhu has updated the pull request incrementally with one additional commit since the last revision: >> >> remove duplicate -cp > > Looks good. > (More than trivial, but good. 8-) ) @kevinjwalls Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26555#issuecomment-3148349512