From egahlin at openjdk.org Wed Oct 1 19:57:18 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 1 Oct 2025 19:57:18 GMT Subject: RFR: 8368670: Deadlock in JFR on event register + class load Message-ID: Could I have a review a PR that prevents a deadlock? The MetadataRepository::isEnabled check is an optimization that allows JFR to instrument disabled event classes lazily. The available settings object is never modified after it has been created, so it is sufficient to publish it using a volatile. Testing: jdk/jdk/jfr Thanks Erik ------------- Commit messages: - Fix - Use volatile - Initial Changes: https://git.openjdk.org/jdk/pull/27592/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27592&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8368670 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27592.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27592/head:pull/27592 PR: https://git.openjdk.org/jdk/pull/27592 From dholmes at openjdk.org Wed Oct 1 21:27:28 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 1 Oct 2025 21:27:28 GMT Subject: RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing [v9] In-Reply-To: References: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> Message-ID: On Tue, 23 Sep 2025 15:02:51 GMT, Johannes Bechberger wrote: >> This change hopefully fixes the test failures by making the test cases more resilient. > > Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: > > Fix build issue The non-test changes only affect the WhiteBox API which in turn is only for testing, so that all seems fine to me. Approved. ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27293#pullrequestreview-3291185668 From ysuenaga at openjdk.org Thu Oct 2 04:17:48 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 2 Oct 2025 04:17:48 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU Can someone review this PR? I think I have to got reviewers both HotSpot and JFR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3358971095 From dholmes at openjdk.org Thu Oct 2 05:26:48 2025 From: dholmes at openjdk.org (David Holmes) Date: Thu, 2 Oct 2025 05:26:48 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Thu, 4 Sep 2025 11:29:14 GMT, Yasumasa Suenaga wrote: >> Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: >> >> - Merge branch 'master' into jfr-on-hy-cpu >> - Use jmc_undefined_long if runs on hybrid CPU >> - Revert "Update condition" >> >> This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. >> - Update condition >> - Add fallback code if logical_cpus == 0 >> - 8365633: JFR reports incorrect number of cores on hybrid CPU > > src/hotspot/cpu/x86/vm_version_x86.cpp line 2581: > >> 2579: // CPUID 0Bh (ECX = 1) might return 0 on older AMD processor (EPYC 7763 at least) >> 2580: threads_per_package = threads_per_core() * cores_per_cpu(); >> 2581: } > > Check `thread_per_package` from `CPUID` to avoid SIGFPE (div by zero). > > `CPUID` leaf 0Bh with ECX (subleaf) = 1 seems to return `0` as number of logical processors in spite of leaf 0Bh is supported in some older processors. It's strange, but I saw it on AMD EPYC 7763 on GitHub Actions runner. The problem appears as following. > > I haven't faced this problem on AMD Ryzen 3 3300X. > > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGFPE (0x8) at pc=0x00007f19e11ffeed, pid=11344, tid=11345 > # > # JRE version: OpenJDK Runtime Environment (26.0) (build 26-internal-YaSuenag-ebf4aec23fa95c8d54d1196c7be85e99f0846420) > # Java VM: OpenJDK 64-Bit Server VM (26-internal-YaSuenag-ebf4aec23fa95c8d54d1196c7be85e99f0846420, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) > # Problematic frame: > # V [libjvm.so+0x11ffeed] VM_Version::initialize_cpu_information()+0x2d > # > # CreateCoredumpOnCrash turned off, no core file dumped > # > # JFR recording file will be written. Location: /home/runner/work/jdk/jdk/build/run-test-prebuilt/test-support/jtreg_test_jdk_tier1_part3/scratch/1/hs_err_pid11344.jfr > # > # If you would like to submit a bug report, please visit: > # https://bugreport.java.com/bugreport/crash.jsp > # > > --------------- S U M M A R Y ------------ > > Command Line: -Xmx768m -XX:MaxRAMPercentage=12.5 -Dtest.boot.jdk=/home/runner/work/jdk/jdk/bootjdk/jdk -Djava.io.tmpdir=/home/runner/work/jdk/jdk/build/run-test-prebuilt/test-support/jtreg_test_jdk_tier1_part3/tmp -ea -esa -XX:-CreateCoredumpOnCrash -Xlog:jfr=trace -XX:StartFlightRecording:filename=./dumped.jfr,dumponexit=true,settings=profile jdk.jfr.startupargs.TestDumpOnExit$TestMain > > Host: AMD EPYC 7763 64-Core Processor, 4 cores, 15G, Ubuntu 22.04.5 LTS > Time: Thu Sep 4 07:17:02 2025 UTC elapsed time: 0.570221 seconds (0d 0h 0m 0s) > > --------------- T H R E A D --------------- > > Current thread (0x00007f19d802ad20): JavaThread "main" [_thread_in_vm, id=11345, stack(0x00007f19dff00000,0x00007f19e0000000) (1024K)] > > Stack: [0x00007f19dff00000,0x00007f19e0000000], sp=0x00007f19dfffbd40, free space=1007k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) > V [libjvm.so+0x11ffeed] VM_Version::initialize_cp... Sorry I don't follow this change. If there is a division-by-zero problem then don't we need a fix the method that would report zero i.e. `threads_per_core()` or `cores_per_cpu()` ?? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2396968555 From ysuenaga at openjdk.org Thu Oct 2 06:12:48 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 2 Oct 2025 06:12:48 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Thu, 2 Oct 2025 05:24:12 GMT, David Holmes wrote: >> src/hotspot/cpu/x86/vm_version_x86.cpp line 2581: >> >>> 2579: // CPUID 0Bh (ECX = 1) might return 0 on older AMD processor (EPYC 7763 at least) >>> 2580: threads_per_package = threads_per_core() * cores_per_cpu(); >>> 2581: } >> >> Check `thread_per_package` from `CPUID` to avoid SIGFPE (div by zero). >> >> `CPUID` leaf 0Bh with ECX (subleaf) = 1 seems to return `0` as number of logical processors in spite of leaf 0Bh is supported in some older processors. It's strange, but I saw it on AMD EPYC 7763 on GitHub Actions runner. The problem appears as following. >> >> I haven't faced this problem on AMD Ryzen 3 3300X. >> >> >> # >> # A fatal error has been detected by the Java Runtime Environment: >> # >> # SIGFPE (0x8) at pc=0x00007f19e11ffeed, pid=11344, tid=11345 >> # >> # JRE version: OpenJDK Runtime Environment (26.0) (build 26-internal-YaSuenag-ebf4aec23fa95c8d54d1196c7be85e99f0846420) >> # Java VM: OpenJDK 64-Bit Server VM (26-internal-YaSuenag-ebf4aec23fa95c8d54d1196c7be85e99f0846420, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) >> # Problematic frame: >> # V [libjvm.so+0x11ffeed] VM_Version::initialize_cpu_information()+0x2d >> # >> # CreateCoredumpOnCrash turned off, no core file dumped >> # >> # JFR recording file will be written. Location: /home/runner/work/jdk/jdk/build/run-test-prebuilt/test-support/jtreg_test_jdk_tier1_part3/scratch/1/hs_err_pid11344.jfr >> # >> # If you would like to submit a bug report, please visit: >> # https://bugreport.java.com/bugreport/crash.jsp >> # >> >> --------------- S U M M A R Y ------------ >> >> Command Line: -Xmx768m -XX:MaxRAMPercentage=12.5 -Dtest.boot.jdk=/home/runner/work/jdk/jdk/bootjdk/jdk -Djava.io.tmpdir=/home/runner/work/jdk/jdk/build/run-test-prebuilt/test-support/jtreg_test_jdk_tier1_part3/tmp -ea -esa -XX:-CreateCoredumpOnCrash -Xlog:jfr=trace -XX:StartFlightRecording:filename=./dumped.jfr,dumponexit=true,settings=profile jdk.jfr.startupargs.TestDumpOnExit$TestMain >> >> Host: AMD EPYC 7763 64-Core Processor, 4 cores, 15G, Ubuntu 22.04.5 LTS >> Time: Thu Sep 4 07:17:02 2025 UTC elapsed time: 0.570221 seconds (0d 0h 0m 0s) >> >> --------------- T H R E A D --------------- >> >> Current thread (0x00007f19d802ad20): JavaThread "main" [_thread_in_vm, id=11345, stack(0x00007f19dff00000,0x00007f19e0000000) (1024K)] >> >> Stack: [0x00007f19dff00000,0x00007f19e0000000], sp=0x00007f19dfffbd40, free space=1007k >> Native frames: (J=compiled Java code, j=interp... > > Sorry I don't follow this change. If there is a division-by-zero problem then don't we need a fix the method that would report zero i.e. `threads_per_core()` or `cores_per_cpu()` ?? I want to use number of logical processors from `CPUID` instruction directly because we can't believe `threads_per_core()` on hybrid CPU. Some of cores (e.g. E cores) might not have hyper threading even though `CPUID` reports HT flag. Thus I think we have to check the value here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2397133449 From egahlin at openjdk.org Thu Oct 2 06:39:47 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 2 Oct 2025 06:39:47 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <8iCd3iDn3FS3lVx_cXyKBUFpWy40a_9sfH4tJ848FNM=.69c598c7-3f0b-48bb-8ce4-24c036fcb469@github.com> On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU I'm not sure promoting the value to a long is a good idea anymore, but I'm not completely against it either. Maybe it's sufficient to update the description of the cores field and say the value may be incorrect if there is hybrid cores? Maybe there should be a field indicating hybrid cores, or maybe we should do something else. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3359374252 From ysuenaga at openjdk.org Thu Oct 2 07:16:00 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 2 Oct 2025 07:16:00 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <1HsPYcAAyNpsaiVYaYEmM3oNtOeSdWKIJg4hue1cmas=.bbc913bc-7345-440c-8014-4c88a8e7239c@github.com> On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU I saw similar behavior in `VM.info` dcmd, and I modified the output for CPU information in #26808 - removed thread-related information, and added "hybrid" flag. But I think we cannot apply similar method in JFR because we have to treat number of cores even if "hybrid" flag would be added in event definition, and also we might change all of viewer (JMC, jfr command, and more) to hide number of cores if hybrid flag is set. It is impractical I think. So I think it is the most reasonable to set `min_jlong` which already means "N/A". ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3359516888 From egahlin at openjdk.org Thu Oct 2 08:00:48 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 2 Oct 2025 08:00:48 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: <1HsPYcAAyNpsaiVYaYEmM3oNtOeSdWKIJg4hue1cmas=.bbc913bc-7345-440c-8014-4c88a8e7239c@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <1HsPYcAAyNpsaiVYaYEmM3oNtOeSdWKIJg4hue1cmas=.bbc913bc-7345-440c-8014-4c88a8e7239c@github.com> Message-ID: On Thu, 2 Oct 2025 07:12:49 GMT, Yasumasa Suenaga wrote: > So I think it is the most reasonable to set `min_jlong` which already means "N/A". I don't think using the min_jlong value is the problem, we do that for other event values, but promoting the field to a long value might be too disruptive. It's a value users are likely to extract programmatically. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3359711876 From ysuenaga at openjdk.org Thu Oct 2 08:44:06 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 2 Oct 2025 08:44:06 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <1HsPYcAAyNpsaiVYaYEmM3oNtOeSdWKIJg4hue1cmas=.bbc913bc-7345-440c-8014-4c88a8e7239c@github.com> Message-ID: On Thu, 2 Oct 2025 07:58:08 GMT, Erik Gahlin wrote: > but promoting the field to a long value might be too disruptive. It's a value users are likely to extract programmatically. If the data size is important than showing "N/A", I think we can set "0" for number of cores as I proposed [at first](https://openjdk.github.io/cr/?repo=jdk&pr=27080&range=00). But you said before that it should not be a problem to change to type long: https://github.com/openjdk/jdk/pull/27080#issuecomment-3270024207 Which is better? I think it is better not to change data size rather than showing "N/A" for compatibility. I think it is whether it feels natural for JFR that "0" means "N/A". ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3359903487 From egahlin at openjdk.org Thu Oct 2 09:34:49 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 2 Oct 2025 09:34:49 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU > But you said before that it should not be a problem to change to type long: [#27080 (comment)](https://github.com/openjdk/jdk/pull/27080#issuecomment-3270024207) I looked at it from a file format perspective (varint encoding), but from an API perspective, as you showed, both getInt("cores") and getValue("cores") may throw an exception. This could impact users who have no problem with hybrid cores today. Also, their code may work on a development or test machine but then break on production hardware. jcmd is meant for humans to read, so a change there has less impact. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3360138311 From ysuenaga at openjdk.org Thu Oct 2 11:15:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 2 Oct 2025 11:15:49 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <6yCL5Daetce0mtR_jN3O2y-qvJ5hSGPODW0-7HhO9SE=.b1eef5ad-ef9f-4472-baed-69538e836ea9@github.com> On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU So should I revert the change to original? I think it is better not to change data type. Compatibility should prefer than user friendly message ("N/A") in this case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3360629462 From mgronlun at openjdk.org Thu Oct 2 11:21:47 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Thu, 2 Oct 2025 11:21:47 GMT Subject: RFR: 8368670: Deadlock in JFR on event register + class load In-Reply-To: References: Message-ID: <2CG_eXs_33cwn0XFBbXHPZ2I5H_LdZSNwK-aArT0p9w=.723238c4-39b8-459b-b40f-85800dc288da@github.com> On Wed, 1 Oct 2025 16:56:53 GMT, Erik Gahlin wrote: > Could I have a review a PR that prevents a deadlock? The MetadataRepository::isEnabled check is an optimization that allows JFR to instrument disabled event classes lazily. > > The available settings object is never modified after it has been created, so it is sufficient to publish it using a volatile. > > > Testing: jdk/jdk/jfr > > Thanks > Erik Nice. ------------- Marked as reviewed by mgronlun (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27592#pullrequestreview-3294066759 From egahlin at openjdk.org Thu Oct 2 15:54:56 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 2 Oct 2025 15:54:56 GMT Subject: Integrated: 8368670: Deadlock in JFR on event register + class load In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 16:56:53 GMT, Erik Gahlin wrote: > Could I have a review a PR that prevents a deadlock? The MetadataRepository::isEnabled check is an optimization that allows JFR to instrument disabled event classes lazily. > > The available settings object is never modified after it has been created, so it is sufficient to publish it using a volatile. > > > Testing: jdk/jdk/jfr > > Thanks > Erik This pull request has now been integrated. Changeset: 5fccabff Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/5fccabff15ae8bcc3d03156fa331bbc0fefb0cbe Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod 8368670: Deadlock in JFR on event register + class load Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27592 From dholmes at openjdk.org Fri Oct 3 06:58:48 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 3 Oct 2025 06:58:48 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Thu, 2 Oct 2025 06:10:05 GMT, Yasumasa Suenaga wrote: >> Sorry I don't follow this change. If there is a division-by-zero problem then don't we need a fix the method that would report zero i.e. `threads_per_core()` or `cores_per_cpu()` ?? > > I want to use number of logical processors from `CPUID` instruction directly because we can't believe `threads_per_core()` on hybrid CPU. Some of cores (e.g. E cores) might not have hyper threading even though `CPUID` reports HT flag. > Thus I think we have to check the value here. Okay but this is not a JFR specific change - you are changing these values for all clients of the VM version info. Let me walk through an example to see if I have it right: We have a hybrid system with two sockets, each of which has 6P and 2E cores. Only the P cores have hyper-threading even though the HT bit is set. So the current code would do: _no_of_threads = 28 // I hope that is what the OS reports: 2 * (6*2 + 2) threads_per_core() = 2 // because of HT bit cores_per_cpu() = 8 threads_per_package = 2 * 8 = 16 _no_of_sockets = 28 / 16 = 1 // integer division -> gives wrong answer with new code: threads_per_package = 14 // direct from CPUID logical processors _no_of_sockets = 28 / 14 = 12 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2400974344 From dholmes at openjdk.org Fri Oct 3 06:58:52 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 3 Oct 2025 06:58:52 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <3EbBfiANbzyez4insW9WqZcbNTged0_EMHnJrbm5h4Y=.9ee9ca3d-087c-4430-b4c4-f037127e09fa@github.com> On Tue, 9 Sep 2025 13:47:45 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jfr-on-hy-cpu > - Use jmc_undefined_long if runs on hybrid CPU > - Revert "Update condition" > > This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. > - Update condition > - Add fallback code if logical_cpus == 0 > - 8365633: JFR reports incorrect number of cores on hybrid CPU src/hotspot/cpu/x86/vm_version_x86.cpp line 2595: > 2593: // estimate the number of cores. > 2594: // -1 if hybrid CPU because it is difficult to derive number of cores. > 2595: _no_of_cores = supports_hybrid() ? -1 : (cores_per_cpu() * _no_of_sockets); It is only meant to be an estimate and -1 is not an estimate at all it is a "I don't know" answer. But why do we not know - using my earlier example won't number of cores be 8 as expected 6P+2E? Even if not it would yield a better approximation than -1. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2400979011 From ysuenaga at openjdk.org Fri Oct 3 12:42:52 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Fri, 3 Oct 2025 12:42:52 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Fri, 3 Oct 2025 06:53:26 GMT, David Holmes wrote: > Okay but this is not a JFR specific change - you are changing these values for all clients of the VM version info. Yes, so I think this PR needs reviewer(s) from HotSpot folks. > So the current code would do: Unfortunately, no. It would derive wrong number of sockets as following: _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) threads_per_core() = 2 // HT enabled cores_per_cpu() = 7 // ** different from your thought ** 14 threads per cpu / 2 logical processors threads_per_package = 14 // 2 threads per core * 7 cores per cpu _no_of_sockets = 2 // 28 threads / 14 threads per package `cores_per_cpu()` would return `CPUID` leaf 0Bh for modern Intel CPU as following. According to Software Developer's Manual, leaf 0Bh returns number of "logical" processor in each domains (selected by subleaf (ECX)). if (is_intel()) { bool supports_topology = supports_processor_topology(); if (supports_topology) { result = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus / _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus; } In this PR, all of variables are same with current implementation, thus we can calculate `_no_of_sockets` correctly. But only `threads_per_package` comes from `CPUID`. _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) threads_per_core() = 2 // HT enabled cores_per_cpu() = 7 // incorrect, but it would be calculated by values from `CPUID` threads_per_package = 14 // ** different from current implementation ** the value from `CPUID` _no_of_sockets = 2 // 28 threads / 14 threads per package I uploaded test code for `CPUID` leaf 0Bh: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2401759645 From ysuenaga at openjdk.org Fri Oct 3 12:59:50 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Fri, 3 Oct 2025 12:59:50 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: <3EbBfiANbzyez4insW9WqZcbNTged0_EMHnJrbm5h4Y=.9ee9ca3d-087c-4430-b4c4-f037127e09fa@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3EbBfiANbzyez4insW9WqZcbNTged0_EMHnJrbm5h4Y=.9ee9ca3d-087c-4430-b4c4-f037127e09fa@github.com> Message-ID: On Fri, 3 Oct 2025 06:55:56 GMT, David Holmes wrote: >> Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: >> >> - Merge branch 'master' into jfr-on-hy-cpu >> - Use jmc_undefined_long if runs on hybrid CPU >> - Revert "Update condition" >> >> This reverts commit ebf4aec23fa95c8d54d1196c7be85e99f0846420. >> - Update condition >> - Add fallback code if logical_cpus == 0 >> - 8365633: JFR reports incorrect number of cores on hybrid CPU > > src/hotspot/cpu/x86/vm_version_x86.cpp line 2595: > >> 2593: // estimate the number of cores. >> 2594: // -1 if hybrid CPU because it is difficult to derive number of cores. >> 2595: _no_of_cores = supports_hybrid() ? -1 : (cores_per_cpu() * _no_of_sockets); > > It is only meant to be an estimate and -1 is not an estimate at all it is a "I don't know" answer. But why do we not know - using my earlier example won't number of cores be 8 as expected 6P+2E? Even if not it would yield a better approximation than -1. I think incorrect value is not useful because it causes confusing. If we have to keep current code to set estimated value, I can use `VM_Version::supports_hybrid()` in JFR code to emit -1 on the event. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2401819924 From egahlin at openjdk.org Fri Oct 3 13:17:58 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Fri, 3 Oct 2025 13:17:58 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3EbBfiANbzyez4insW9WqZcbNTged0_EMHnJrbm5h4Y=.9ee9ca3d-087c-4430-b4c4-f037127e09fa@github.com> Message-ID: <_xWKjgnQjsDHTvxZqp_l5tQE0etiJoK5nu8PuLAr4v0=.1b91e771-d0e2-4829-9928-26e118691f10@github.com> On Fri, 3 Oct 2025 12:56:59 GMT, Yasumasa Suenaga wrote: >> src/hotspot/cpu/x86/vm_version_x86.cpp line 2595: >> >>> 2593: // estimate the number of cores. >>> 2594: // -1 if hybrid CPU because it is difficult to derive number of cores. >>> 2595: _no_of_cores = supports_hybrid() ? -1 : (cores_per_cpu() * _no_of_sockets); >> >> It is only meant to be an estimate and -1 is not an estimate at all it is a "I don't know" answer. But why do we not know - using my earlier example won't number of cores be 8 as expected 6P+2E? Even if not it would yield a better approximation than -1. > > I think incorrect value is not useful because it causes confusing. > > If we have to keep current code to set estimated value, I can use `VM_Version::supports_hybrid()` in JFR code to emit -1 on the event. Even if the value is incorrect, it still has some value as an approximation. We could update the description to make this clearer, or perhaps provide additional information to help users. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2401874712 From dcubed at openjdk.org Fri Oct 3 21:05:16 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 3 Oct 2025 21:05:16 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs Message-ID: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option ------------- Commit messages: - 8369133: Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option - 8369132 disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC - 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs Changes: https://git.openjdk.org/jdk/pull/27629/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27629&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369128 Stats: 4 lines in 4 files changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27629.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27629/head:pull/27629 PR: https://git.openjdk.org/jdk/pull/27629 From ayang at openjdk.org Fri Oct 3 21:05:17 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 3 Oct 2025 21:05:17 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> Message-ID: <63cMLQaAuITwPnfrDch2UblWoWXcKu1pwJk54-ehVXA=.feee83fd-1d9b-47dd-8a3e-fd6b98f3f3e0@github.com> On Fri, 3 Oct 2025 20:41:31 GMT, Daniel D. Daugherty wrote: > In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: > > [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs > > [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC > > [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27629#pullrequestreview-3300900845 From dcubed at openjdk.org Fri Oct 3 21:05:19 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 3 Oct 2025 21:05:19 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: <63cMLQaAuITwPnfrDch2UblWoWXcKu1pwJk54-ehVXA=.feee83fd-1d9b-47dd-8a3e-fd6b98f3f3e0@github.com> References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> <63cMLQaAuITwPnfrDch2UblWoWXcKu1pwJk54-ehVXA=.feee83fd-1d9b-47dd-8a3e-fd6b98f3f3e0@github.com> Message-ID: <_a422YA5GgS6goxf5CnnaG-YsMmfn-M6vYqkK0XYnR4=.21894e92-f2f6-4d93-8fd7-3cfa0447f7c8@github.com> On Fri, 3 Oct 2025 20:47:42 GMT, Albert Mingkun Yang wrote: >> In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: >> >> [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs >> >> [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC >> >> [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option > > Marked as reviewed by ayang (Reviewer). @albertnetymk - Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27629#issuecomment-3367206699 From dcubed at openjdk.org Fri Oct 3 21:05:18 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 3 Oct 2025 21:05:18 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> Message-ID: On Fri, 3 Oct 2025 20:41:31 GMT, Daniel D. Daugherty wrote: > In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: > > [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs > > [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC > > [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option Blasted auto-correct keeps changing what I type... It's been too long since I've bundled multiple fixes together. I forgot a couple of steps... All Mach5 testing that I've done is documented in each bug report. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27629#issuecomment-3367198386 PR Comment: https://git.openjdk.org/jdk/pull/27629#issuecomment-3367205612 PR Comment: https://git.openjdk.org/jdk/pull/27629#issuecomment-3367207761 From dholmes at openjdk.org Fri Oct 3 21:10:53 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 3 Oct 2025 21:10:53 GMT Subject: RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing [v9] In-Reply-To: References: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> Message-ID: On Tue, 30 Sep 2025 10:15:44 GMT, Johannes Bechberger wrote: >> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix build issue > > Andrei has already reviewed. Maybe @jbachorik could rereview it. @parttimenerd this has been ready for integration for a couple of days now. But now the test is being ProblemListed so you will need to merge with master and remove it again and then get a re-review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27293#issuecomment-3367219277 From dholmes at openjdk.org Fri Oct 3 21:14:58 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 3 Oct 2025 21:14:58 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> Message-ID: On Fri, 3 Oct 2025 20:41:31 GMT, Daniel D. Daugherty wrote: > In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: > > [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs > > [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC > > [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option Seems reasonable. I approved the fix for jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java a couple of days ago but for some reason the author has not been around to integrate it. I have made a note on the PR that now they will need to fix the PL too. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27629#pullrequestreview-3300964363 From dcubed at openjdk.org Fri Oct 3 21:14:59 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 3 Oct 2025 21:14:59 GMT Subject: Integrated: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> Message-ID: On Fri, 3 Oct 2025 20:41:31 GMT, Daniel D. Daugherty wrote: > In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: > > [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs > > [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC > > [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option This pull request has now been integrated. Changeset: 837f634b Author: Daniel D. Daugherty URL: https://git.openjdk.org/jdk/commit/837f634bf29fd877dd62a2e0f7d7a1bd383372d3 Stats: 4 lines in 4 files changed: 4 ins; 0 del; 0 mod 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs 8369132: Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC 8369133: Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option Reviewed-by: ayang, dholmes ------------- PR: https://git.openjdk.org/jdk/pull/27629 From egahlin at openjdk.org Fri Oct 3 21:19:04 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Fri, 3 Oct 2025 21:19:04 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId Message-ID: Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? Testing: 500 * jdk/jfr/tool/TestPrintContextual.java Thanks Erik ------------- Commit messages: - Initial Changes: https://git.openjdk.org/jdk/pull/27626/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27626&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365630 Stats: 13 lines in 1 file changed: 13 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27626.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27626/head:pull/27626 PR: https://git.openjdk.org/jdk/pull/27626 From dcubed at openjdk.org Fri Oct 3 22:15:55 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 3 Oct 2025 22:15:55 GMT Subject: RFR: 8369128: ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs In-Reply-To: References: <2y3lFDzY9oh1bIIt57Bd3hAXXrGyivq2AKI_l2Lhhvc=.41331210-c95c-4811-a567-81a8fb72c2e3@github.com> Message-ID: <0aO_PY7lyXtH0jQ2_Zhk7QYFdDtZjYFr_-oluOpdF8k=.e7659811-f5a6-40a9-a4e6-7e2357cc77ac@github.com> On Fri, 3 Oct 2025 21:10:15 GMT, David Holmes wrote: >> In order to reduce noise in the JDK26 CI, I'm bundling the following three trivial fixes: >> >> [JDK-8369128](https://bugs.openjdk.org/browse/JDK-8369128) ProblemList jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java in Xcomp configs >> >> [JDK-8369132](https://bugs.openjdk.org/browse/JDK-8369132) Disable vmTestbase/gc/vector/CircularListLow and LinearListLow with SerialGC >> >> [JDK-8369133](https://bugs.openjdk.org/browse/JDK-8369133) Disable gc/g1/TestShrinkAuxiliaryDataRunner.java with UseLargePages option > > Seems reasonable. > > I approved the fix for jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java a couple of days ago but for some reason the author has not been around to integrate it. I have made a note on the PR that now they will need to fix the PL too. > > Thanks @dholmes-ora - Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27629#issuecomment-3367369658 From ysuenaga at openjdk.org Sat Oct 4 00:39:50 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 4 Oct 2025 00:39:50 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: <_xWKjgnQjsDHTvxZqp_l5tQE0etiJoK5nu8PuLAr4v0=.1b91e771-d0e2-4829-9928-26e118691f10@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3EbBfiANbzyez4insW9WqZcbNTged0_EMHnJrbm5h4Y=.9ee9ca3d-087c-4430-b4c4-f037127e09fa@github.com> <_xWKjgnQjsDHTvxZqp_l5tQE0etiJoK5nu8PuLAr4v0=.1b91e771-d0e2-4829-9928-26e118691f10@github.com> Message-ID: On Fri, 3 Oct 2025 13:15:03 GMT, Erik Gahlin wrote: >> I think incorrect value is not useful because it causes confusing. >> >> If we have to keep current code to set estimated value, I can use `VM_Version::supports_hybrid()` in JFR code to emit -1 on the event. > > Even if the value is incorrect, it still has some value as an approximation. We could update the description to make this clearer, or perhaps provide additional information to help users. This PR adds "Hybrid Architecture" to the description field. Do you think it is enough only it? I think it is better to add some notice that number of cores is approximate value, and it might be incorrect on hybrid CPU. However I have no idea where to add it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2403620724 From suenaga at oss.nttdata.com Sat Oct 4 02:02:40 2025 From: suenaga at oss.nttdata.com (Yasumasa Suenaga) Date: Sat, 4 Oct 2025 11:02:40 +0900 Subject: Scrubbing recording data by datetime Message-ID: Hi all, I want to propose to add a feature to scrub recording data by datetime in `jfr scrub` command. CSR of `jfr scrub` [1] says a possibility to dump the last 30 seconds for later analysis. I completely agree with this use case, but `jfr scrub` hasn't yet had a feature to scrub recording data to datetime. Currently we can scrub recording data by thread, event, and categories. However it is more useful if all of contents which emitted in the time window we want to focus especially the analyst doesn't know what happened yet. I think we can add both `--start` and `--end` commandline option to `jfr scrub` command for this purpose. Implementation POV, I think we can implement it easily with `RecordingFile::write` API. I think it needs CSR because to add new commandline options to `jfr` command, so I want to hear your comments before to work. Thanks, Yasumasa [1] https://bugs.openjdk.org/browse/JDK-8271585 From erik.gahlin at oracle.com Sun Oct 5 15:29:36 2025 From: erik.gahlin at oracle.com (Erik Gahlin) Date: Sun, 5 Oct 2025 15:29:36 +0000 Subject: Scrubbing recording data by datetime In-Reply-To: References: Message-ID: Hi Yasumasa, As you?ve probably noticed, this question came up when we added ?jfr scrub?. Before adding flags, it would help to understand your concrete use case. Why do you need to select a datetime interval on an existing recording file? If you can describe the underlying goal, we can design the right option. For example, if the intent is to split a large recording into smaller pieces - say, to send them as attachments - then a size-based approach might be a better fit than a time-based one, e.g. ?jfr disassemble --max-size 5000000? JFR.dump can select an interval precisely because the user knows the current wall-clock time, so choosing start and end is straightforward. With an offline file like dump.jfr, absolute times are usually not obvious, and time zones can complicate matters further. Erik Confidential ? Oracle Internal ________________________________ From: hotspot-jfr-dev on behalf of Yasumasa Suenaga Sent: Saturday, October 4, 2025 4:02 AM To: hotspot-jfr-dev at openjdk.org Cc: yasuenag at gmail.com Subject: Scrubbing recording data by datetime Hi all, I want to propose to add a feature to scrub recording data by datetime in `jfr scrub` command. CSR of `jfr scrub` [1] says a possibility to dump the last 30 seconds for later analysis. I completely agree with this use case, but `jfr scrub` hasn't yet had a feature to scrub recording data to datetime. Currently we can scrub recording data by thread, event, and categories. However it is more useful if all of contents which emitted in the time window we want to focus especially the analyst doesn't know what happened yet. I think we can add both `--start` and `--end` commandline option to `jfr scrub` command for this purpose. Implementation POV, I think we can implement it easily with `RecordingFile::write` API. I think it needs CSR because to add new commandline options to `jfr` command, so I want to hear your comments before to work. Thanks, Yasumasa [1] https://bugs.openjdk.org/browse/JDK-8271585 -------------- next part -------------- An HTML attachment was scrubbed... URL: From duke at openjdk.org Sun Oct 5 17:43:56 2025 From: duke at openjdk.org (jonghoonpark) Date: Sun, 5 Oct 2025 17:43:56 GMT Subject: RFR: 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp Message-ID: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> related jira issue: https://bugs.openjdk.org/browse/JDK-8365782 --- ### Changes As described in the issue, I have removed the unnecessary inclusion of `stdlib.h`. This was first discussed in [this comment](https://github.com/openjdk/jdk/pull/26800#discussion_r2278998210). As noted in the discussion, `generate_environment_variables_events` also appears to be unimplemented, so it has been removed as well. --- ### Verification - Verified that no functions from stdlib.h are called in the file. - Checked that the `generate_environment_variables_events` function is not implemented anywhere in the codebase. - Ran the `tier1` tests after the changes and confirmed that there were no issues. Please let me know if there are any additional or more appropriate verification steps I should perform. ------------- Commit messages: - cleanup: Remove unnecessary inclusion of in jfrOSInterface.cpp Changes: https://git.openjdk.org/jdk/pull/27639/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27639&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365782 Stats: 6 lines in 1 file changed: 0 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27639.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27639/head:pull/27639 PR: https://git.openjdk.org/jdk/pull/27639 From suenaga at oss.nttdata.com Sun Oct 5 23:11:16 2025 From: suenaga at oss.nttdata.com (Yasumasa Suenaga) Date: Mon, 6 Oct 2025 08:11:16 +0900 Subject: Scrubbing recording data by datetime In-Reply-To: References: Message-ID: <3f294ed3-add7-4f5e-879a-e9103b4e2e58@oss.nttdata.com> Hi Erik, I agree with you that we can use `JFR.dump` to cutout flight record on living process, however I think it is not enough in some use cases. For example, the user was aware something wrong in their batch system few days ago, but the process was already finished. The user could know when it happend, so he could find out the recording file, but it was very big ( > 250MB), thus it is difficult to show thread lanes (very heavy!!). I want to propose very simple option to cutout by datetime like [1]. Thanks, Yasumasa [1] https://github.com/YaSuenag/garakuta/blob/master/trjfr/src/main/java/com/yasuenag/trjfr/Main.java On 10/6/2025 12:29 AM, Erik Gahlin wrote: > Hi Yasumasa, > > As you?ve probably noticed, this question came up when we added ?jfr scrub?. > > Before adding flags, it would help to understand your concrete use case. Why do you need to select a datetime interval on an existing recording file? If you can describe the underlying goal, we can design the right option. > > For example, if the intent is to split a large recording into smaller pieces - say, to send them as attachments - then a size-based approach might be a better fit than a time-based one, e.g. ?jfr disassemble?--max-size 5000000? > > JFR.dump can select an interval precisely because the user knows the current wall-clock time, so choosing start and end is straightforward. With an offline file like dump.jfr, absolute times are usually not obvious, and time zones can complicate matters further. > > Erik > > Confidential ? Oracle Internal > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > *From:* hotspot-jfr-dev on behalf of Yasumasa Suenaga > *Sent:* Saturday, October 4, 2025 4:02 AM > *To:* hotspot-jfr-dev at openjdk.org > *Cc:* yasuenag at gmail.com > *Subject:* Scrubbing recording data by datetime > Hi all, > > I want to propose to add a feature to scrub recording data by datetime in `jfr scrub` command. > > CSR of `jfr scrub` [1] says a possibility to dump the last 30 seconds for later analysis. I completely agree with this use case, but `jfr scrub` hasn't yet had a feature to scrub recording data to datetime. Currently we can scrub recording data by thread, event, and categories. However it is more useful if all of contents which emitted in the time window we want to focus especially the analyst doesn't know what happened yet. > > > I think we can add both `--start` and `--end` commandline option to `jfr scrub` command for this purpose. > Implementation POV, I think we can implement it easily with `RecordingFile::write` API. > > I think it needs CSR because to add new commandline options to `jfr` command, so I want to hear your comments before to work. > > > Thanks, > > Yasumasa > > > [1] https://bugs.openjdk.org/browse/JDK-8271585 From shade at openjdk.org Mon Oct 6 07:46:05 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 6 Oct 2025 07:46:05 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 16:33:31 GMT, Erik Gahlin wrote: > Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? > > Testing: 500 * jdk/jfr/tool/TestPrintContextual.java > > Thanks > Erik test/jdk/jdk/jfr/tool/TestPrintContextual.java line 288: > 286: Thread.sleep(1); > 287: } catch (InterruptedException e) { > 288: // ignore Why ignore, though? This would make the thread stuck even if someone actively tries to interrupt it. A common practice in these non-critical methods is to restore the interrupt status and return. } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27626#discussion_r2405211347 From egahlin at openjdk.org Mon Oct 6 09:20:24 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 09:20:24 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 07:43:47 GMT, Aleksey Shipilev wrote: >> Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? >> >> Testing: 500 * jdk/jfr/tool/TestPrintContextual.java >> >> Thanks >> Erik > > test/jdk/jdk/jfr/tool/TestPrintContextual.java line 288: > >> 286: Thread.sleep(1); >> 287: } catch (InterruptedException e) { >> 288: // ignore > > Why ignore, though? This would make the thread stuck even if someone actively tries to interrupt it. A common practice in these non-critical methods is to restore the interrupt status and return. > > > } catch (InterruptedException e) { > Thread.currentThread().interrupt(); > return; > } The purpose is to save CPU cycles instead of spinning. I'm not sure how returning would help? The test would become unreliable, since two timestamp may be the same. I could let the method throw an InterruptedException so the test fails, but it would result in a false positive. Perhaps, if jtreg for some reason wanted to shut down the test early, it could serve a purpose. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27626#discussion_r2405451608 From ayang at openjdk.org Mon Oct 6 10:40:45 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Mon, 6 Oct 2025 10:40:45 GMT Subject: RFR: 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp In-Reply-To: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> References: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> Message-ID: <7JAKgfo9eUOE-boaoMkHG5p9pYhzrc3sz8JEw7MqDsw=.269de662-39e2-407d-887a-960e8c5250d0@github.com> On Sun, 5 Oct 2025 17:34:16 GMT, jonghoonpark wrote: > related jira issue: https://bugs.openjdk.org/browse/JDK-8365782 > > --- > > ### Changes > > As described in the issue, I have removed the unnecessary inclusion of `stdlib.h`. > > This was first discussed in [this comment](https://github.com/openjdk/jdk/pull/26800#discussion_r2278998210). > > As noted in the discussion, `generate_environment_variables_events` also appears to be unimplemented, so it has been removed as well. > > --- > > ### Verification > > - Checked that no functions from `stdlib.h` are called in the file. > - Checked that the `generate_environment_variables_events` function is not implemented anywhere in the codebase. > - Ran the `tier1` tests after the changes and confirmed that there were no issues. > > Please let me know if there are any additional or more appropriate verification steps I should perform. Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27639#pullrequestreview-3303800195 From tschatzl at openjdk.org Mon Oct 6 10:44:49 2025 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Mon, 6 Oct 2025 10:44:49 GMT Subject: RFR: 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp In-Reply-To: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> References: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> Message-ID: <5iZUeM1_8tEiNwxOkexvQzydWuivSLzfBWS3mN5yE_I=.44d00140-1a1b-4c89-9586-c5d09a01a6f6@github.com> On Sun, 5 Oct 2025 17:34:16 GMT, jonghoonpark wrote: > related jira issue: https://bugs.openjdk.org/browse/JDK-8365782 > > --- > > ### Changes > > As described in the issue, I have removed the unnecessary inclusion of `stdlib.h`. > > This was first discussed in [this comment](https://github.com/openjdk/jdk/pull/26800#discussion_r2278998210). > > As noted in the discussion, `generate_environment_variables_events` also appears to be unimplemented, so it has been removed as well. > > --- > > ### Verification > > - Checked that no functions from `stdlib.h` are called in the file. > - Checked that the `generate_environment_variables_events` function is not implemented anywhere in the codebase. > - Ran the `tier1` tests after the changes and confirmed that there were no issues. > > Please let me know if there are any additional or more appropriate verification steps I should perform. Marked as reviewed by tschatzl (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27639#pullrequestreview-3303813998 From duke at openjdk.org Mon Oct 6 11:21:48 2025 From: duke at openjdk.org (duke) Date: Mon, 6 Oct 2025 11:21:48 GMT Subject: RFR: 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp In-Reply-To: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> References: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> Message-ID: On Sun, 5 Oct 2025 17:34:16 GMT, jonghoonpark wrote: > related jira issue: https://bugs.openjdk.org/browse/JDK-8365782 > > --- > > ### Changes > > As described in the issue, I have removed the unnecessary inclusion of `stdlib.h`. > > This was first discussed in [this comment](https://github.com/openjdk/jdk/pull/26800#discussion_r2278998210). > > As noted in the discussion, `generate_environment_variables_events` also appears to be unimplemented, so it has been removed as well. > > --- > > ### Verification > > - Checked that no functions from `stdlib.h` are called in the file. > - Checked that the `generate_environment_variables_events` function is not implemented anywhere in the codebase. > - Ran the `tier1` tests after the changes and confirmed that there were no issues. > > Please let me know if there are any additional or more appropriate verification steps I should perform. @dev-jonghoonpark Your change (at version 9687a4bcb092637e60e9b9c1b2c2976c5d4c965f) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27639#issuecomment-3371116448 From egahlin at openjdk.org Mon Oct 6 11:48:29 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 11:48:29 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId [v2] In-Reply-To: References: Message-ID: > Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? > > Testing: 500 * jdk/jfr/tool/TestPrintContextual.java > > Thanks > Erik Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision: Rethrow ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27626/files - new: https://git.openjdk.org/jdk/pull/27626/files/27d913c5..d433a73d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27626&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27626&range=00-01 Stats: 7 lines in 1 file changed: 0 ins; 4 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27626.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27626/head:pull/27626 PR: https://git.openjdk.org/jdk/pull/27626 From shade at openjdk.org Mon Oct 6 12:58:49 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 6 Oct 2025 12:58:49 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId [v2] In-Reply-To: References: Message-ID: <9ypKdkwy-RVdsCu5UA5Ng7A4Uu4cYa8e6pGnw8Aei4o=.f08318bd-4173-4d16-b225-9195a4681162@github.com> On Mon, 6 Oct 2025 11:48:29 GMT, Erik Gahlin wrote: >> Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? >> >> Testing: 500 * jdk/jfr/tool/TestPrintContextual.java >> >> Thanks >> Erik > > Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision: > > Rethrow This looks better, thanks! ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27626#pullrequestreview-3304417869 From egahlin at openjdk.org Mon Oct 6 17:33:12 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 17:33:12 GMT Subject: RFR: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId [v2] In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 11:48:29 GMT, Erik Gahlin wrote: >> Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? >> >> Testing: 500 * jdk/jfr/tool/TestPrintContextual.java >> >> Thanks >> Erik > > Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision: > > Rethrow Thanks for the review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27626#issuecomment-3372979104 From egahlin at openjdk.org Mon Oct 6 17:33:14 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 17:33:14 GMT Subject: Integrated: 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 16:33:31 GMT, Erik Gahlin wrote: > Could I get a review of a test fix that emits events with unique timestamps, so the contextual information is printed in chronological order? > > Testing: 500 * jdk/jfr/tool/TestPrintContextual.java > > Thanks > Erik This pull request has now been integrated. Changeset: 2376a9e9 Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/2376a9e9727e9cb3020dd3f57584950a4cdcdab6 Stats: 10 lines in 1 file changed: 9 ins; 0 del; 1 mod 8365630: jdk/jfr/tool/TestPrintContextual.java fails with wrong spanId Reviewed-by: shade ------------- PR: https://git.openjdk.org/jdk/pull/27626 From egahlin at openjdk.org Mon Oct 6 17:36:22 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 17:36:22 GMT Subject: RFR: 8247776: JFR: TestThreadContextSwitches.java failed "RuntimeException: No events: expected false, was true" Message-ID: Could I have a review of a PR that retries if a Thread Context Switch Rate event is not emitted on Windows? This is similar to TestCPULoad. Testing: 500 * jdk/jdk/jfr/event/TestThreadContextSwitches.java Thanks Erik ------------- Commit messages: - Initial Changes: https://git.openjdk.org/jdk/pull/27654/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27654&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8247776 Stats: 20 lines in 1 file changed: 11 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/27654.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27654/head:pull/27654 PR: https://git.openjdk.org/jdk/pull/27654 From duke at openjdk.org Mon Oct 6 18:24:01 2025 From: duke at openjdk.org (Larry Cable) Date: Mon, 6 Oct 2025 18:24:01 GMT Subject: RFR: JDK-8365400: add JFR event to capture location (if available) of class files loaded Message-ID: while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. this association can be used for various "applications" such as basic auditing etc ------------- Commit messages: - Merge branch 'openjdk:master' into JDK-8365400 - JDK-8365400: add JFR event to capture location (if available) of class files loaded Changes: https://git.openjdk.org/jdk/pull/27656/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27656&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365400 Stats: 111 lines in 6 files changed: 103 ins; 1 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/27656.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27656/head:pull/27656 PR: https://git.openjdk.org/jdk/pull/27656 From lmesnik at openjdk.org Mon Oct 6 18:39:50 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Mon, 6 Oct 2025 18:39:50 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 18:15:51 GMT, Larry Cable wrote: > while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. > > therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. > > this association can be used for various "applications" such as basic auditing etc Can you please a new test for the added functionality? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27656#issuecomment-3373312592 From egahlin at openjdk.org Mon Oct 6 22:38:45 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 22:38:45 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 18:15:51 GMT, Larry Cable wrote: > while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. > > therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. > > this association can be used for various "applications" such as basic auditing etc I have not reviewed SecureClassLoader, as this is better done by people who are more knowledgeable in the area. That said, toExternalForm() appears to be a somewhat expensive function, so you may want to add a guard. Also check for null. ClassFileDefineEvent event = new ClassFileDefineEvent(); if (event.isEnabled()) { event.definedClass = cls; if (cs != null) { URL location = cs.getLocation(); if (location != null) { event.path = location.toExternalForm(); } } event.commit(); } Could you also add the event to profile.jfc? Please remove "Name" from the label "Defined Class Name," as the whole class is serialized, and add a test to test/jdk/jdk/jfr/event/runtime. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27656#issuecomment-3374488908 From duke at openjdk.org Mon Oct 6 22:42:45 2025 From: duke at openjdk.org (Larry Cable) Date: Mon, 6 Oct 2025 22:42:45 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 18:15:51 GMT, Larry Cable wrote: > while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. > > therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. > > this association can be used for various "applications" such as basic auditing etc sounds good, will do so! thx On 10/6/25 3:33 PM, Erik Gahlin wrote: > *egahlin* left a comment (openjdk/jdk#27656) > > > I have not reviewed SecureClassLoader, as this is better done by > people who are more knowledgeable in the area. That said, > toExternalForm() appears to be a somewhat expensive function, so you > may want to add a guard. Also check for null. > > |ClassFileDefineEvent evt = new ClassFileDefineEvent(); if > (event.shouldCommit()) { event.definedClass = cls; if (cs != null) { > URL location = cs.getLocation(); if (location != null) { event = > location.toExternalForm(); } } event.commit(); } | > > Could you also add the event to profile.jfc? Please remove "Name" from > the label "Defined Class Name," as the whole class is serialized, and > add a test to test/jdk/jdk/jfr/event/runtime. > > ? > Reply to this email directly, view it on GitHub > , > or unsubscribe > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> > --------------H8Nh870r73JozTO7kRSnjvm6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit sounds good, will do so!

thx


On 10/6/25 3:33 PM, Erik Gahlin wrote:
egahlin left a comment (openjdk/jdk#27656)

I have not reviewed SecureClassLoader, as this is better done by people who are more knowledgeable in the area. That said, toExternalForm() appears to be a somewhat expensive function, so you may want to add a guard. Also check for null.

    ClassFileDefineEvent evt = new ClassFileDefineEvent();
    if (event.shouldCommit()) {
        event.definedClass = cls;
        if (cs != null) {
            URL location = cs.getLocation();
            if (location != null) {
                event = location.toExternalForm();
            }
        }
        event.commit();   
    }

Could you also add the event to profile.jfc? Please remove "Name" from the label "Defined Class Name," as the whole class is serialized, and add a test to test/jdk/jdk/jfr/event/runtime.

?
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: <openjdk/jdk/pull/27656/c3374488908@github.com>


--------------H8Nh870r73JozTO7kRSnjvm6-- ------------- PR Comment: https://git.openjdk.org/jdk/pull/27656#issuecomment-3374507982 From egahlin at openjdk.org Mon Oct 6 22:50:44 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 22:50:44 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 18:15:51 GMT, Larry Cable wrote: > while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. > > therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. > > this association can be used for various "applications" such as basic auditing etc What is the scope of the event? I assume it will not work for all classes. Could more be added, or could the limitation be stated somewhere, e.g. Label("Secure Class File Define")? The event name can still be generic. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27656#issuecomment-3374538971 From duke at openjdk.org Mon Oct 6 23:15:57 2025 From: duke at openjdk.org (Steven Schlansker) Date: Mon, 6 Oct 2025 23:15:57 GMT Subject: RFR: 8368670: Deadlock in JFR on event register + class load In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 16:56:53 GMT, Erik Gahlin wrote: > Could I have a review a PR that prevents a deadlock? The MetadataRepository::isEnabled check is an optimization that allows JFR to instrument disabled event classes lazily. > > The available settings object is never modified after it has been created, so it is sufficient to publish it using a volatile. > > > Testing: jdk/jdk/jfr > > Thanks > Erik Thank you so much! We really appreciate the quick fix :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27592#issuecomment-3374603416 From egahlin at openjdk.org Mon Oct 6 23:47:53 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 6 Oct 2025 23:47:53 GMT Subject: RFR: 8368670: Deadlock in JFR on event register + class load In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 23:13:30 GMT, Steven Schlansker wrote: > Thank you so much! We really appreciate the quick fix :) The high-quality bug report made it easy. I will do the backport after the change has been running without issues for a week or two. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27592#issuecomment-3374659178 From dholmes at openjdk.org Tue Oct 7 01:08:47 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 7 Oct 2025 01:08:47 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Fri, 3 Oct 2025 12:39:55 GMT, Yasumasa Suenaga wrote: >> Okay but this is not a JFR specific change - you are changing these values for all clients of the VM version info. >> >> Let me walk through an example to see if I have it right: >> >> We have a hybrid system with two sockets, each of which has 6P and 2E cores. Only the P cores have hyper-threading even though the HT bit is set. So the current code would do: >> >> _no_of_threads = 28 // I hope that is what the OS reports: 2 * (6*2 + 2) >> threads_per_core() = 2 // because of HT bit >> cores_per_cpu() = 8 >> threads_per_package = 2 * 8 = 16 >> _no_of_sockets = 28 / 16 = 1 // integer division -> gives wrong answer >> >> with new code: >> >> threads_per_package = 14 // direct from CPUID logical processors >> _no_of_sockets = 28 / 14 = 12 > >> Okay but this is not a JFR specific change - you are changing these values for all clients of the VM version info. > > Yes, so I think this PR needs reviewer(s) from HotSpot folks. > >> So the current code would do: > > Unfortunately, no. It would derive wrong number of sockets as following: > > > _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) > threads_per_core() = 2 // HT enabled > cores_per_cpu() = 7 // ** different from your thought ** 14 threads per cpu / 2 logical processors > threads_per_package = 14 // 2 threads per core * 7 cores per cpu > _no_of_sockets = 2 // 28 threads / 14 threads per package > > > `cores_per_cpu()` would return `CPUID` leaf 0Bh for modern Intel CPU as following. According to Software Developer's Manual, leaf 0Bh returns number of "logical" processor in each domains (selected by subleaf (ECX)). > > > if (is_intel()) { > bool supports_topology = supports_processor_topology(); > if (supports_topology) { > result = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus / > _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus; > } > > > In this PR, all of variables are same with current implementation, thus we can calculate `_no_of_sockets` correctly. But only `threads_per_package` comes from `CPUID`. > > > _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) > threads_per_core() = 2 // HT enabled > cores_per_cpu() = 7 // incorrect, but it would be calculated by values from `CPUID` > threads_per_package = 14 // ** different from current implementation ** the value from `CPUID` > _no_of_sockets = 2 // 28 threads / 14 threads per package > > > I uploaded test code for `CPUID` leaf 0Bh: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c Sorry I am very confused as to what is being calculated by what. IIUC (big IF!) we will always calculate `cores_per_cpu` incorrectly because we will assume all cores have the same HT setting - hence when we divide total-threads-per-cpu by threads-per-core, to get cores-per-cpu, the answer may be incorrect. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409066160 From ysuenaga at openjdk.org Tue Oct 7 02:34:54 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Tue, 7 Oct 2025 02:34:54 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> On Tue, 7 Oct 2025 01:06:31 GMT, David Holmes wrote: >>> Okay but this is not a JFR specific change - you are changing these values for all clients of the VM version info. >> >> Yes, so I think this PR needs reviewer(s) from HotSpot folks. >> >>> So the current code would do: >> >> Unfortunately, no. It would derive wrong number of sockets as following: >> >> >> _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) >> threads_per_core() = 2 // HT enabled >> cores_per_cpu() = 7 // ** different from your thought ** 14 threads per cpu / 2 logical processors >> threads_per_package = 14 // 2 threads per core * 7 cores per cpu >> _no_of_sockets = 2 // 28 threads / 14 threads per package >> >> >> `cores_per_cpu()` would return `CPUID` leaf 0Bh for modern Intel CPU as following. According to Software Developer's Manual, leaf 0Bh returns number of "logical" processor in each domains (selected by subleaf (ECX)). >> >> >> if (is_intel()) { >> bool supports_topology = supports_processor_topology(); >> if (supports_topology) { >> result = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus / >> _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus; >> } >> >> >> In this PR, all of variables are same with current implementation, thus we can calculate `_no_of_sockets` correctly. But only `threads_per_package` comes from `CPUID`. >> >> >> _no_of_threads = 28 // 2 sockets * (6 P-cores * 2 threads + 2 E-cores) >> threads_per_core() = 2 // HT enabled >> cores_per_cpu() = 7 // incorrect, but it would be calculated by values from `CPUID` >> threads_per_package = 14 // ** different from current implementation ** the value from `CPUID` >> _no_of_sockets = 2 // 28 threads / 14 threads per package >> >> >> I uploaded test code for `CPUID` leaf 0Bh: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c > > Sorry I am very confused as to what is being calculated by what. IIUC (big IF!) we will always calculate `cores_per_cpu` incorrectly because we will assume all cores have the same HT setting - hence when we divide total-threads-per-cpu by threads-per-core, to get cores-per-cpu, the answer may be incorrect. Agree! HT flag is set even though it is E-core (do not have HT), and also we cannot get number of physical cores, hence cores-per-cpu is always incorrect as you said. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409166531 From dholmes at openjdk.org Tue Oct 7 04:46:47 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 7 Oct 2025 04:46:47 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 02:32:08 GMT, Yasumasa Suenaga wrote: >> Sorry I am very confused as to what is being calculated by what. IIUC (big IF!) we will always calculate `cores_per_cpu` incorrectly because we will assume all cores have the same HT setting - hence when we divide total-threads-per-cpu by threads-per-core, to get cores-per-cpu, the answer may be incorrect. > > Agree! HT flag is set even though it is E-core (do not have HT), and also we cannot get number of physical cores, hence cores-per-cpu is always incorrect as you said. Can we not check for "Intel Hybrid Information" CPUID leaf (0x1A) that reports the type of each core and use that to get an accurate core count? So that: int cores_per_cpu() { if (is_hybrid()) { if (hyper_threaded() ) { return _no_of_threads - _no_of_e_cores; } else { return _no_of_threads; } } else { return _no_of_threads / threads_per_core(); } } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409331900 From alanb at openjdk.org Tue Oct 7 05:31:47 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 7 Oct 2025 05:31:47 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 22:40:22 GMT, Larry Cable wrote: >> while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. >> >> therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. >> >> this association can be used for various "applications" such as basic auditing etc > > sounds good, will do so! > > thx > > > On 10/6/25 3:33 PM, Erik Gahlin wrote: >> *egahlin* left a comment (openjdk/jdk#27656) >> >> >> I have not reviewed SecureClassLoader, as this is better done by >> people who are more knowledgeable in the area. That said, >> toExternalForm() appears to be a somewhat expensive function, so you >> may want to add a guard. Also check for null. >> >> |ClassFileDefineEvent evt = new ClassFileDefineEvent(); if >> (event.shouldCommit()) { event.definedClass = cls; if (cs != null) { >> URL location = cs.getLocation(); if (location != null) { event = >> location.toExternalForm(); } } event.commit(); } | >> >> Could you also add the event to profile.jfc? Please remove "Name" from >> the label "Defined Class Name," as the whole class is serialized, and >> add a test to test/jdk/jdk/jfr/event/runtime. >> >> ? >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> . >> You are receiving this because you were mentioned.Message ID: >> ***@***.***> >> > > --------------H8Nh870r73JozTO7kRSnjvm6 > Content-Type: text/html; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > > > > > sounds good, will do so!
>
> thx
>
>
>
On 10/6/25 3:33 PM, Erik Gahlin wrote:
>
>
> >
egahlin left a comment References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 04:44:24 GMT, David Holmes wrote: >> Agree! HT flag is set even though it is E-core (do not have HT), and also we cannot get number of physical cores, hence cores-per-cpu is always incorrect as you said. > > Can we not check for "Intel Hybrid Information" CPUID leaf (0x1A) that reports the type of each core and use that to get an accurate core count? So that: > > int cores_per_cpu() { > if (is_hybrid()) { > if (hyper_threaded() ) { > return _no_of_threads - _no_of_e_cores; > } else { > return _no_of_threads; > } > } else { > return _no_of_threads / threads_per_core(); > } > } I think it is difficult for the following reasons: 1. We need to set affinity & issue `CPUID` leaf 1Ah on all of cores. See example: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c 2. E-core does not have HT for now, but we don't know this architecture (P core has HT, both E core and LP E core do not have HT) keeps in future. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409430996 From dholmes at openjdk.org Tue Oct 7 07:10:49 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 7 Oct 2025 07:10:49 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v3] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 05:43:45 GMT, Yasumasa Suenaga wrote: >> Can we not check for "Intel Hybrid Information" CPUID leaf (0x1A) that reports the type of each core and use that to get an accurate core count? So that: >> >> int cores_per_cpu() { >> if (is_hybrid()) { >> if (hyper_threaded() ) { >> return _no_of_threads - _no_of_e_cores; >> } else { >> return _no_of_threads; >> } >> } else { >> return _no_of_threads / threads_per_core(); >> } >> } > > I think it is difficult for the following reasons: > > 1. We need to set affinity & issue `CPUID` leaf 1Ah on all of cores. See example: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c > 2. E-core does not have HT for now, but we don't know this architecture (P core has HT, both E core and LP E core do not have HT) keeps in future. Oh that is awful - I did not realize that, I assumed we got some kind of bit vector we could query. I'm less concerned about them adding HT to E-cores in the future as we will likely have to expand the code to deal with specific chips anyway. So where does this leave us? - `cores_per_cpu` is an approximation - anything reporting the `cores_per_cpu` value needs to include some text (if it is a hybrid) to indicate it is an approximation ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2409613404 From duke at openjdk.org Tue Oct 7 08:49:58 2025 From: duke at openjdk.org (Larry Cable) Date: Tue, 7 Oct 2025 08:49:58 GMT Subject: Withdrawn: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 18:15:51 GMT, Larry Cable wrote: > while existing class loading JFR events exist, none of these provide the path (if available) from which a class is loaded/defined, nor are they easily modified to do so from a compatibility standpoint. > > therefore this ER/PR adds a simple JFR event that encapsulates a tuple of class and path that can be enabled in order to provide an audit/debug trail of locations (path, if available) from which a particular class is loaded/defined. > > this association can be used for various "applications" such as basic auditing etc This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/27656 From jbechberger at openjdk.org Tue Oct 7 10:26:14 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Tue, 7 Oct 2025 10:26:14 GMT Subject: RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing [v10] In-Reply-To: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> References: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> Message-ID: > This change hopefully fixes the test failures by making the test cases more resilient. Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision: - Remove from ProblemList - Merge branch 'master' into parttimenerd_make_auto_size_test_more_resilient - Fix build issue - Fix disabling out-of-stack walking and time box handling - Make main assertion less strict - Add synchronized - Add @requires vm.flagless - Remove synchronized - Tiny fixes - Simplify code - ... and 1 more: https://git.openjdk.org/jdk/compare/33b311d0...3f6fa333 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27293/files - new: https://git.openjdk.org/jdk/pull/27293/files/afd9815f..3f6fa333 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27293&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27293&range=08-09 Stats: 162276 lines in 1928 files changed: 132930 ins; 17108 del; 12238 mod Patch: https://git.openjdk.org/jdk/pull/27293.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27293/head:pull/27293 PR: https://git.openjdk.org/jdk/pull/27293 From dholmes at openjdk.org Tue Oct 7 10:49:07 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 7 Oct 2025 10:49:07 GMT Subject: RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing [v10] In-Reply-To: References: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> Message-ID: On Tue, 7 Oct 2025 10:26:14 GMT, Johannes Bechberger wrote: >> This change hopefully fixes the test failures by making the test cases more resilient. > > Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision: > > - Remove from ProblemList > - Merge branch 'master' into parttimenerd_make_auto_size_test_more_resilient > - Fix build issue > - Fix disabling out-of-stack walking and time box handling > - Make main assertion less strict > - Add synchronized > - Add @requires vm.flagless > - Remove synchronized > - Tiny fixes > - Simplify code > - ... and 1 more: https://git.openjdk.org/jdk/compare/298af78f...3f6fa333 Marked as reviewed by dholmes (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27293#pullrequestreview-3309536074 From ysuenaga at openjdk.org Tue Oct 7 13:05:21 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Tue, 7 Oct 2025 13:05:21 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v4] In-Reply-To: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: > On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. > > > $ jfr print --events jdk.CPUInformation test.jfr > jdk.CPUInformation { > startTime = 10:49:27.692 (2025-09-04) > cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" > description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel > Family: (0x6), Model: (0xb5), Stepping: 0x0 > Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 > Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff > Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 > Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruc tion, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" > sockets = 1 > cores = 7 > hwThreads = 14 > } > > > Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. > > We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. > > This patch sets `0` to `cores` and "Hybrid Architecture" ... Yasumasa Suenaga has updated the pull request incrementally with three additional commits since the last revision: - Fix comment line - Fix comments - Revert "Use jmc_undefined_long if runs on hybrid CPU" This reverts commit 2ebbde5f963eec47b8709afd68f45cb169b096a8. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27080/files - new: https://git.openjdk.org/jdk/pull/27080/files/aeea3fb0..d7b2edd0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=02-03 Stats: 18 lines in 4 files changed: 4 ins; 8 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27080.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27080/head:pull/27080 PR: https://git.openjdk.org/jdk/pull/27080 From ysuenaga at openjdk.org Tue Oct 7 14:04:46 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Tue, 7 Oct 2025 14:04:46 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: > On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. > > > $ jfr print --events jdk.CPUInformation test.jfr > jdk.CPUInformation { > startTime = 10:49:27.692 (2025-09-04) > cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" > description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel > Family: (0x6), Model: (0xb5), Stepping: 0x0 > Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 > Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff > Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 > Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruc tion, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" > sockets = 1 > cores = 7 > hwThreads = 14 > } > > > Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. > > We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. > > This patch sets `0` to `cores` and "Hybrid Architecture" ... Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Fix build error ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27080/files - new: https://git.openjdk.org/jdk/pull/27080/files/d7b2edd0..a0520474 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27080.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27080/head:pull/27080 PR: https://git.openjdk.org/jdk/pull/27080 From duke at openjdk.org Tue Oct 7 15:16:49 2025 From: duke at openjdk.org (jonghoonpark) Date: Tue, 7 Oct 2025 15:16:49 GMT Subject: Integrated: 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp In-Reply-To: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> References: <7TfH8AHuR9rZARwf66xGwIjgJ-wNSs0KvbwfeiAicTc=.9113bd83-5868-45fe-b2d9-c1a320370c45@github.com> Message-ID: <1mwzlth9Ci6HOBVmQO8jJtgh0OgkxvCrCW5WOBrFWnY=.88ae04b6-616e-4fcd-8549-d1ec46d7f407@github.com> On Sun, 5 Oct 2025 17:34:16 GMT, jonghoonpark wrote: > related jira issue: https://bugs.openjdk.org/browse/JDK-8365782 > > --- > > ### Changes > > As described in the issue, I have removed the unnecessary inclusion of `stdlib.h`. > > This was first discussed in [this comment](https://github.com/openjdk/jdk/pull/26800#discussion_r2278998210). > > As noted in the discussion, `generate_environment_variables_events` also appears to be unimplemented, so it has been removed as well. > > --- > > ### Verification > > - Checked that no functions from `stdlib.h` are called in the file. > - Checked that the `generate_environment_variables_events` function is not implemented anywhere in the codebase. > - Ran the `tier1` tests after the changes and confirmed that there were no issues. > > Please let me know if there are any additional or more appropriate verification steps I should perform. This pull request has now been integrated. Changeset: 0f2a95c1 Author: jonghoonpark Committer: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/0f2a95c15d7c1e3796660d786c9a72497dab5ab1 Stats: 6 lines in 1 file changed: 0 ins; 5 del; 1 mod 8365782: Remove unnecessary inclusion of in jfrOSInterface.cpp Reviewed-by: ayang, tschatzl ------------- PR: https://git.openjdk.org/jdk/pull/27639 From mgronlun at openjdk.org Tue Oct 7 15:29:29 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Tue, 7 Oct 2025 15:29:29 GMT Subject: RFR: 8247776: JFR: TestThreadContextSwitches.java failed "RuntimeException: No events: expected false, was true" In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 17:24:33 GMT, Erik Gahlin wrote: > Could I have a review of a PR that retries if a Thread Context Switch Rate event is not emitted on Windows? This is similar to TestCPULoad. > > Testing: 500 * jdk/jdk/jfr/event/TestThreadContextSwitches.java > > Thanks > Erik Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27654#pullrequestreview-3310694356 From egahlin at openjdk.org Tue Oct 7 15:42:18 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 7 Oct 2025 15:42:18 GMT Subject: Integrated: 8247776: JFR: TestThreadContextSwitches.java failed "RuntimeException: No events: expected false, was true" In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 17:24:33 GMT, Erik Gahlin wrote: > Could I have a review of a PR that retries if a Thread Context Switch Rate event is not emitted on Windows? This is similar to TestCPULoad. > > Testing: 500 * jdk/jdk/jfr/event/TestThreadContextSwitches.java > > Thanks > Erik This pull request has now been integrated. Changeset: eb729f0a Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/eb729f0aaa2297c3b3dbadadf40a502d2d9ed124 Stats: 20 lines in 1 file changed: 11 ins; 0 del; 9 mod 8247776: JFR: TestThreadContextSwitches.java failed "RuntimeException: No events: expected false, was true" Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27654 From dcubed at openjdk.org Tue Oct 7 18:58:37 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Tue, 7 Oct 2025 18:58:37 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 07:07:51 GMT, David Holmes wrote: >> I think it is difficult for the following reasons: >> >> 1. We need to set affinity & issue `CPUID` leaf 1Ah on all of cores. See example: https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c >> 2. E-core does not have HT for now, but we don't know this architecture (P core has HT, both E core and LP E core do not have HT) keeps in future. > > Oh that is awful - I did not realize that, I assumed we got some kind of bit vector we could query. > > I'm less concerned about them adding HT to E-cores in the future as we will likely have to expand the code to deal with specific chips anyway. > > So where does this leave us? > - `cores_per_cpu` is an approximation > - anything reporting the `cores_per_cpu` value needs to include some text (if it is a hybrid) to indicate it is an approximation Based on the comments that I'm reading in this PR, it seems like the existing logic presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing (AMP) or is the AMP support in a different place in the code. A very long time ago, Solaris SPARC servers could be provisioned with differing processors with different core counts and speed ratings. I don't know if we supported those AMP servers in Java or not, but there was definitely support in Solaris itself. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2411598511 From ysuenaga at openjdk.org Wed Oct 8 00:13:42 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 00:13:42 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 18:56:11 GMT, Daniel D. Daugherty wrote: >> Oh that is awful - I did not realize that, I assumed we got some kind of bit vector we could query. >> >> I'm less concerned about them adding HT to E-cores in the future as we will likely have to expand the code to deal with specific chips anyway. >> >> So where does this leave us? >> - `cores_per_cpu` is an approximation >> - anything reporting the `cores_per_cpu` value needs to include some text (if it is a hybrid) to indicate it is an approximation > > Based on the comments that I'm reading in this PR, it seems like the existing logic > presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing > (AMP) or is the AMP support in a different place in the code. > > A very long time ago, Solaris SPARC servers could be provisioned with differing processors > with different core counts and speed ratings. I don't know if we supported those AMP > servers in Java or not, but there was definitely support in Solaris itself. I updated this PR to revert data type change to `uint`, so number of cores might be incorrect on hybrid CPU. "cores" in `jdk.CPUInformation` event would be set "approximated" value, but "Hybrid Architecture" would be added into "description" field in that case. I grep'ed to find user of `cores_per_cpu`, this value would be used in JFR and reporting only like I've fixed in #26808 , thus this change affects limited area only AFAICS. > Based on the comments that I'm reading in this PR, it seems like the existing logic presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing (AMP) or is the AMP support in a different place in the code. Has Intel released AMP processor for Xeon / Core line? If AMP is SPARC only in context of Java, it would be implemented on SPARC-specific code, but it has already gone... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412215707 From dholmes at openjdk.org Wed Oct 8 03:15:02 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 8 Oct 2025 03:15:02 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> <3uYc5vP8m6zRthfgWuBy59ooA3xqNKAu_v-SPrm7RXU=.a739b7eb-5135-43c8-ae33-c746d8187a79@github.com> Message-ID: On Tue, 7 Oct 2025 18:56:11 GMT, Daniel D. Daugherty wrote: >> Oh that is awful - I did not realize that, I assumed we got some kind of bit vector we could query. >> >> I'm less concerned about them adding HT to E-cores in the future as we will likely have to expand the code to deal with specific chips anyway. >> >> So where does this leave us? >> - `cores_per_cpu` is an approximation >> - anything reporting the `cores_per_cpu` value needs to include some text (if it is a hybrid) to indicate it is an approximation > > Based on the comments that I'm reading in this PR, it seems like the existing logic > presumes Symmetric Multi-Processing (SMP) instead of Asymmetric Multi-Processing > (AMP) or is the AMP support in a different place in the code. > > A very long time ago, Solaris SPARC servers could be provisioned with differing processors > with different core counts and speed ratings. I don't know if we supported those AMP > servers in Java or not, but there was definitely support in Solaris itself. @dcubed-ojdk my recollection is that the "symmetry" in SMP related to memory accesses - but there are differing definitions. There is also a presumption that all "logical processors" behave effectively the same, and for multi-socket systems all CPU's are the same. That is still true-enough with these Hybrid chips, they just don't have the same internal topology so we can't coarsely assume we can calculate things like "number of cores" by knowing number-of-threads and whether hyper-threading is enabled. Unfortunately you also cannot easily get the exact details of that topology. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412394944 From dholmes at openjdk.org Wed Oct 8 03:34:05 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 8 Oct 2025 03:34:05 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Tue, 7 Oct 2025 14:04:46 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Fix build error src/hotspot/cpu/x86/vm_version_x86.cpp line 2579: > 2577: if (threads_per_package == 0) { > 2578: // Fallback code to avoid div by zero in subsequent code. > 2579: // CPUID 0Bh (ECX = 1) might return 0 on older AMD processor (EPYC 7763 at least) Can we assert that this is not a hybrid CPU? src/hotspot/share/jfr/metadata/metadata.xml line 855: > 853: > 854: 855: description="Characteristics and descriptions of the processor(s) the JVM is running on. Note that "cores" field would be incorrect on hybrid CPU." Perhaps better stated on the cores field: ? But really this is for JFR folk to decide. Do these labels get used for GUI tools like JMC? BTW I assume that "hwThreads" is the number of logical processors - right? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412407479 PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412412315 From ysuenaga at openjdk.org Wed Oct 8 06:17:06 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 06:17:06 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Wed, 8 Oct 2025 03:25:52 GMT, David Holmes wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix build error > > src/hotspot/cpu/x86/vm_version_x86.cpp line 2579: > >> 2577: if (threads_per_package == 0) { >> 2578: // Fallback code to avoid div by zero in subsequent code. >> 2579: // CPUID 0Bh (ECX = 1) might return 0 on older AMD processor (EPYC 7763 at least) > > Can we assert that this is not a hybrid CPU? Maybe yes. I checked `CPUID` 0Bh subleaf 1 on both Core Ultra 5 135U and 225U, they reports correct number of logical processors. However I cannot check all of hybrid CPUs and I'm not sure all of them should return correct value at here. Thus I'm not sure we can add `assert` here for hybrid CPU. > BTW I assume that "hwThreads" is the number of logical processors - right? Yes ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412657326 PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412657709 From ysuenaga at openjdk.org Wed Oct 8 06:27:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 06:27:49 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v6] In-Reply-To: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: > On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. > > > $ jfr print --events jdk.CPUInformation test.jfr > jdk.CPUInformation { > startTime = 10:49:27.692 (2025-09-04) > cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" > description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel > Family: (0x6), Model: (0xb5), Stepping: 0x0 > Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 > Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff > Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 > Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruc tion, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" > sockets = 1 > cores = 7 > hwThreads = 14 > } > > > Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. > > We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. > > This patch sets `0` to `cores` and "Hybrid Architecture" ... Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Update metadata.xml ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27080/files - new: https://git.openjdk.org/jdk/pull/27080/files/a0520474..126feb9d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=04-05 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27080.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27080/head:pull/27080 PR: https://git.openjdk.org/jdk/pull/27080 From ysuenaga at openjdk.org Wed Oct 8 06:53:26 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 06:53:26 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v7] In-Reply-To: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: > On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. > > > $ jfr print --events jdk.CPUInformation test.jfr > jdk.CPUInformation { > startTime = 10:49:27.692 (2025-09-04) > cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" > description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel > Family: (0x6), Model: (0xb5), Stepping: 0x0 > Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 > Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff > Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 > Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruc tion, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" > sockets = 1 > cores = 7 > hwThreads = 14 > } > > > Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. > > We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. > > This patch sets `0` to `cores` and "Hybrid Architecture" ... Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Add description attribute to Field ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27080/files - new: https://git.openjdk.org/jdk/pull/27080/files/126feb9d..a9dbfb99 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27080&range=05-06 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27080.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27080/head:pull/27080 PR: https://git.openjdk.org/jdk/pull/27080 From ysuenaga at openjdk.org Wed Oct 8 06:53:28 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 06:53:28 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Wed, 8 Oct 2025 06:14:03 GMT, Yasumasa Suenaga wrote: >> src/hotspot/share/jfr/metadata/metadata.xml line 855: >> >>> 853: >>> 854: >> 855: description="Characteristics and descriptions of the processor(s) the JVM is running on. Note that "cores" field would be incorrect on hybrid CPU." >> >> Perhaps better stated on the cores field: >> >> >> >> ? But really this is for JFR folk to decide. Do these labels get used for GUI tools like JMC? >> >> BTW I assume that "hwThreads" is the number of logical processors - right? > >> BTW I assume that "hwThreads" is the number of logical processors - right? > > Yes > Perhaps better stated on the cores field: Thanks for your comment! I added that sentence to `description` attribute in `Field` element. After this change, flight record contains following metadata. I believe it would be parsed in some tools like JMC (JMC shows the description as a tooltip) $ jfr metadata --events jdk.CPUInformation /tmp/test.jfr @Name("jdk.CPUInformation") @Category({"Operating System", "Processor"}) @Label("CPU Information") @Description("Characteristics and descriptions of the processor(s) the JVM is running on") class CPUInformation extends jdk.jfr.Event { @Label("Start Time") @Timestamp("TICKS") long startTime; @Label("Type") String cpu; @Label("Description") String description; @Unsigned @Label("Sockets") int sockets; @Unsigned @Label("Cores") @Description("Approximation on a hybrid CPU") int cores; @Unsigned @Label("Hardware Threads") int hwThreads; } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412763021 From egahlin at openjdk.org Wed Oct 8 07:53:13 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 8 Oct 2025 07:53:13 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Wed, 8 Oct 2025 06:50:27 GMT, Yasumasa Suenaga wrote: >>> BTW I assume that "hwThreads" is the number of logical processors - right? >> >> Yes > >> Perhaps better stated on the cores field: > > Thanks for your comment! I added that sentence to `description` attribute in `Field` element. > After this change, flight record contains following metadata. I believe it would be parsed in some tools like JMC (JMC shows the description as a tooltip) > > > $ jfr metadata --events jdk.CPUInformation /tmp/test.jfr > @Name("jdk.CPUInformation") > @Category({"Operating System", "Processor"}) > @Label("CPU Information") > @Description("Characteristics and descriptions of the processor(s) the JVM is running on") > class CPUInformation extends jdk.jfr.Event { > @Label("Start Time") > @Timestamp("TICKS") > long startTime; > > @Label("Type") > String cpu; > > @Label("Description") > String description; > > @Unsigned > @Label("Sockets") > int sockets; > > @Unsigned > @Label("Cores") > @Description("Approximation on a hybrid CPU") > int cores; > > @Unsigned > @Label("Hardware Threads") > int hwThreads; > } Metadata looks good ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412915309 From dholmes at openjdk.org Wed Oct 8 08:05:28 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 8 Oct 2025 08:05:28 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v7] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Wed, 8 Oct 2025 06:53:26 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Add description attribute to Field If @egahlin is happy with the JFR side then nothing further from me. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27080#pullrequestreview-3313499645 From jbechberger at openjdk.org Wed Oct 8 08:07:00 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Wed, 8 Oct 2025 08:07:00 GMT Subject: Integrated: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing In-Reply-To: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> References: <_r1coqZyHEizPTOsA2G7GwvCirLxzmPPCx5SHmFwhfo=.a3d42724-c1e3-416d-9d6f-bb58e48b626e@github.com> Message-ID: <9lF5MKUxf3lTZV9yUPqQx47DRn6zZCEnWSGy6Ld2uyo=.1d778c1e-44ae-405a-9395-d4cc93edb072@github.com> On Mon, 15 Sep 2025 12:17:13 GMT, Johannes Bechberger wrote: > This change hopefully fixes the test failures by making the test cases more resilient. This pull request has now been integrated. Changeset: d27649fe Author: Johannes Bechberger URL: https://git.openjdk.org/jdk/commit/d27649fe22a5bed9db72ac6c2595ac91f1fa28f8 Stats: 138 lines in 6 files changed: 47 ins; 46 del; 45 mod 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing Reviewed-by: dholmes, apangin ------------- PR: https://git.openjdk.org/jdk/pull/27293 From ysuenaga at openjdk.org Wed Oct 8 09:50:27 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 8 Oct 2025 09:50:27 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: On Wed, 8 Oct 2025 07:50:47 GMT, Erik Gahlin wrote: >>> Perhaps better stated on the cores field: >> >> Thanks for your comment! I added that sentence to `description` attribute in `Field` element. >> After this change, flight record contains following metadata. I believe it would be parsed in some tools like JMC (JMC shows the description as a tooltip) >> >> >> $ jfr metadata --events jdk.CPUInformation /tmp/test.jfr >> @Name("jdk.CPUInformation") >> @Category({"Operating System", "Processor"}) >> @Label("CPU Information") >> @Description("Characteristics and descriptions of the processor(s) the JVM is running on") >> class CPUInformation extends jdk.jfr.Event { >> @Label("Start Time") >> @Timestamp("TICKS") >> long startTime; >> >> @Label("Type") >> String cpu; >> >> @Label("Description") >> String description; >> >> @Unsigned >> @Label("Sockets") >> int sockets; >> >> @Unsigned >> @Label("Cores") >> @Description("Approximation on a hybrid CPU") >> int cores; >> >> @Unsigned >> @Label("Hardware Threads") >> int hwThreads; >> } > > Metadata looks good @egahlin Can you approve this PR? Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2413260517 From zgu at openjdk.org Wed Oct 8 12:04:34 2025 From: zgu at openjdk.org (Zhengyu Gu) Date: Wed, 8 Oct 2025 12:04:34 GMT Subject: RFR: 8369419: Error reporting of JFR JNI method registration crash on MacOSX Message-ID: Please review this small change to avoid crash during error reporting of JFR JNI method registration on MacOSX. ------------- Commit messages: - 8369419: Error reporting of JFR JNI method registration crash on MacOSX Changes: https://git.openjdk.org/jdk/pull/27691/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27691&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369419 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27691.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27691/head:pull/27691 PR: https://git.openjdk.org/jdk/pull/27691 From jbachorik at openjdk.org Thu Oct 9 08:06:09 2025 From: jbachorik at openjdk.org (Jaroslav Bachorik) Date: Thu, 9 Oct 2025 08:06:09 GMT Subject: RFR: 8369419: Error reporting of JFR JNI method registration crash on MacOSX In-Reply-To: References: Message-ID: <5WD984-DuD3Ux9MeFgDHFARYcUG-7ZL7vWb3CGE0mew=.bb9d6d49-da3f-48bb-92c0-18f04941dcfd@github.com> On Wed, 8 Oct 2025 11:54:02 GMT, Zhengyu Gu wrote: > Please review this small change to avoid crash during error reporting of JFR JNI method registration on MacOSX. Marked as reviewed by jbachorik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27691#pullrequestreview-3317688467 From mgronlun at openjdk.org Thu Oct 9 10:13:27 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Thu, 9 Oct 2025 10:13:27 GMT Subject: RFR: 8369255: Assess and remedy any unsafe usage of the Semaphores used by JFR Message-ID: Greetings, Please help review this change set that prevents a race in the shutdown of the VM, where the CRT is destroyed while threads might still be running JFR code. Please see the JIRA issue for an explanation. Testing: jdk_jfr, tier 1 - 3 Thanks Markus ------------- Commit messages: - adjustment - 8369255 Changes: https://git.openjdk.org/jdk/pull/27722/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27722&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369255 Stats: 51 lines in 2 files changed: 33 ins; 13 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/27722.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27722/head:pull/27722 PR: https://git.openjdk.org/jdk/pull/27722 From egahlin at openjdk.org Thu Oct 9 15:48:26 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 9 Oct 2025 15:48:26 GMT Subject: RFR: 8369510: JFR: Remove flush handler from Dispatcher lookup Message-ID: Could I get a review of a PR that removes dead code? Testing: test/jdk/jdk/jfr To ensure the code is not used, I added Thread.sleep(10000000) to the lambda, but no tests timed out. Thanks Erik ------------- Commit messages: - Initial Changes: https://git.openjdk.org/jdk/pull/27733/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27733&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369510 Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27733.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27733/head:pull/27733 PR: https://git.openjdk.org/jdk/pull/27733 From egahlin at openjdk.org Thu Oct 9 20:47:03 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 9 Oct 2025 20:47:03 GMT Subject: RFR: 8369255: Assess and remedy any unsafe usage of the Semaphores used by JFR In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 10:07:35 GMT, Markus Gr?nlund wrote: > Greetings, > > Please help review this change set that prevents a race in the shutdown of the VM, where the CRT is destroyed while threads might still be running JFR code. Please see the JIRA issue for an explanation. > > Testing: jdk_jfr, tier 1 - 3 > > Thanks > Markus Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27722#pullrequestreview-3320588749 From egahlin at openjdk.org Thu Oct 9 23:23:01 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 9 Oct 2025 23:23:01 GMT Subject: RFR: 8369419: Error reporting of JFR JNI method registration crash on MacOSX In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 11:54:02 GMT, Zhengyu Gu wrote: > Please review this small change to avoid crash during error reporting of JFR JNI method registration on MacOSX. Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27691#pullrequestreview-3320895452 From egahlin at openjdk.org Thu Oct 9 23:27:03 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 9 Oct 2025 23:27:03 GMT Subject: RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v7] In-Reply-To: References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <9wBvd5DT0I-3MdnYv4PJh1i8z5rYHaSUpH1v50hD4Ig=.210a8d17-cddc-4a65-9d88-2f0064183049@github.com> On Wed, 8 Oct 2025 06:53:26 GMT, Yasumasa Suenaga wrote: >> On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. >> >> >> $ jfr print --events jdk.CPUInformation test.jfr >> jdk.CPUInformation { >> startTime = 10:49:27.692 (2025-09-04) >> cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" >> description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel >> Family: (0x6), Model: (0xb5), Stepping: 0x0 >> Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 >> Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff >> Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 >> Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instru ction, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" >> sockets = 1 >> cores = 7 >> hwThreads = 14 >> } >> >> >> Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. >> >> We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. >> >> This patc... > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Add description attribute to Field Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27080#pullrequestreview-3320902481 From ysuenaga at openjdk.org Fri Oct 10 05:06:14 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Fri, 10 Oct 2025 05:06:14 GMT Subject: Integrated: 8366847: JFR reports incorrect number of cores on hybrid CPU In-Reply-To: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> References: <9ILw1TZZxnRFUkbaN-RBptc1hThJtSYS9ht6AA-6xss=.453edc4d-7efd-4b86-8ef3-c5ad4f3d3611@github.com> Message-ID: <8NtYMtIQcTEJPXa_QJKW9D8gfVXfyBiUMf8nUzbCnpM=.ba9e817a-975c-497e-832f-dc9287e32eb8@github.com> On Thu, 4 Sep 2025 02:15:01 GMT, Yasumasa Suenaga wrote: > On hybrid CPU like Intel Arrow Lake, JFR reports incorrect number of cores in `jdk.CPUInformation`. > > > $ jfr print --events jdk.CPUInformation test.jfr > jdk.CPUInformation { > startTime = 10:49:27.692 (2025-09-04) > cpu = "Intel (null) (HT) SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 Core Intel64" > description = "Brand: Intel(R) Core(TM) Ultra 5 225U, Vendor: GenuineIntel > Family: (0x6), Model: (0xb5), Stepping: 0x0 > Ext. family: 0x0, Ext. model: 0xb, Type: 0x0, Signature: 0x000b0650 > Features: ebx: 0x40800800, ecx: 0xfffaf38b, edx: 0xbfcbfbff > Ext. features: eax: 0x00000000, ebx: 0x00000000, ecx: 0x00000121, edx: 0x2c100800 > Supports: On-Chip FPU, Virtual Mode Extensions, Debugging Extensions, Page Size Extensions, Time Stamp Counter, Model Specific Registers, Physical Address Extension, Machine Check Exceptions, CMPXCHG8B Instruction, On-Chip APIC, Fast System Call, Memory Type Range Registers, Page Global Enable, Machine Check Architecture, Conditional Mov Instruction, Page Attribute Table, 36-bit Page Size Extension, CLFLUSH Instruction, ACPI registers in MSR space, Intel Architecture MMX Technology, Fast Float Point Save and Restore, Streaming SIMD extensions, Streaming SIMD extensions 2, Self-Snoop, Hyper Threading, Thermal Monitor, Streaming SIMD Extensions 3, PCLMULQDQ, MONITOR/MWAIT instructions, Enhanced Intel SpeedStep technology, Thermal Monitor 2, Supplemental Streaming SIMD Extensions 3, Fused Multiply-Add, CMPXCHG16B, xTPR Update Control, Perfmon and Debug Capability, Process-context identifiers, Streaming SIMD extensions 4.1, Streaming SIMD extensions 4.2, x2APIC, MOVBE, Popcount instruc tion, TSC-Deadline, AESNI, XSAVE, OSXSAVE, AVX, F16C, LAHF/SAHF instruction support, Advanced Bit Manipulations: LZCNT, SYSCALL/SYSRET, Execute Disable Bit, RDTSCP, Intel 64 Architecture, Invariant TSC" > sockets = 1 > cores = 7 > hwThreads = 14 > } > > > Flight record in above was created on Intel Core Ultra 5 225U. According to [datasheet](https://www.intel.com/content/www/us/en/products/sku/241861/intel-core-ultra-5-processor-225u-12m-cache-up-to-4-80-ghz/specifications.html), it has 12 cores, 14 threads. Thus JFR should report `12` in `cores`. > > We tackled similar issue on [JDK-8365633](https://bugs.openjdk.org/browse/JDK-8365633), then we concluded it is difficult to calculate number of physical cores. Thus we might not set correct value at here, but we should avoid to set incorrect value at least. > > This patch sets `0` to `cores` and "Hybrid Architecture" ... This pull request has now been integrated. Changeset: be107224 Author: Yasumasa Suenaga URL: https://git.openjdk.org/jdk/commit/be10722436f20df26de66c00c4bc1b6772aa9087 Stats: 11 lines in 2 files changed: 9 ins; 0 del; 2 mod 8366847: JFR reports incorrect number of cores on hybrid CPU Reviewed-by: dholmes, egahlin ------------- PR: https://git.openjdk.org/jdk/pull/27080 From zgu at openjdk.org Fri Oct 10 07:40:11 2025 From: zgu at openjdk.org (Zhengyu Gu) Date: Fri, 10 Oct 2025 07:40:11 GMT Subject: Integrated: 8369419: Error reporting of JFR JNI method registration crash on MacOSX In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 11:54:02 GMT, Zhengyu Gu wrote: > Please review this small change to avoid crash during error reporting of JFR JNI method registration on MacOSX. This pull request has now been integrated. Changeset: b00720ed Author: Zhengyu Gu URL: https://git.openjdk.org/jdk/commit/b00720edd72226ae9ffecbcb9c1062d3ceb8c6df Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod 8369419: Error reporting of JFR JNI method registration crash on MacOSX Reviewed-by: jbachorik, egahlin ------------- PR: https://git.openjdk.org/jdk/pull/27691 From mgronlun at openjdk.org Fri Oct 10 09:21:11 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 10 Oct 2025 09:21:11 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 21:04:41 GMT, Larry Cable wrote: > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof Why is this change not getting a hotspot-jfr label? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3389029340 From mgronlun at openjdk.org Fri Oct 10 09:27:24 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 10 Oct 2025 09:27:24 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: <7HeGUHbKpK4hPMNj3_qkp3mTEjI5ucNXFwKziLd1Nx8=.d83f286e-e24c-47a7-85f8-e200b0d4dca8@github.com> On Thu, 9 Oct 2025 21:04:41 GMT, Larry Cable wrote: > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof Introducing a separate jdk.ClassFileDefine event seems gratuitous. Why is it not enabled by default? What problem is being addressed again? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3389043586 From mgronlun at openjdk.org Fri Oct 10 09:35:28 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 10 Oct 2025 09:35:28 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Fri, 10 Oct 2025 06:48:05 GMT, Alan Bateman wrote: > The evolution of JFR events isn't clear to me so I don't know if adding a field is compatible or not for programs that are processing recordings. (I'm just trying to understand why a new not-enabled-by-default event is added instead of adding a field to the existing ClassDefine event. > > The existing event is emitted in SystemDictionary::define_instance_class, the new event emits it from JVM_DefineClassXXX. Is this because it was awkward to get at cfs->source from the SD code? > > I assume that a test will be added as it would be easy to refactor code and not record the event if enabled. > > Using "jvm" as the URI scheme when there is no source is a bit strange. There will be custom class loaders that don't provide a code source, do you really want these to use this source in the event? Adding a field to an existing event is non-detrimental, equivalent to extending a table with a new column in a database. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3389076928 From duke at openjdk.org Fri Oct 10 10:55:02 2025 From: duke at openjdk.org (Larry Cable) Date: Fri, 10 Oct 2025 10:55:02 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: <5wmcrcVHnwuibED77Ud3fdgXIK_pcEQijGZ34GOavp0=.406ec398-87f9-47ff-9aa1-47b0b4fd4117@github.com> On Thu, 9 Oct 2025 21:04:41 GMT, Larry Cable wrote: > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof in previous discussions regarding adding fields to existing JFR (jdk) events I concluded (based on feedback from the JFR team) that this was undesirable hence the new event. I will investigate the feasibility of adding this metadata to the existing event(s) knowing where a class originated from, in addition to the knowledge that it has been loaded etc is of particular value in pre-existing auditing and debugging scenarios. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3389346359 From sgehwolf at openjdk.org Fri Oct 10 13:38:56 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 10 Oct 2025 13:38:56 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong Message-ID: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. Testing (looking good): - [x] GHA - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. Thoughts? Opinions? ------------- Commit messages: - Fix print_container_info output - whitespace clean-ups and other small fixes - Fix log format in container macro and scanf format - Fix duplicate include in osContainer_linux - 8365606: Container code should not be using jlong/julong Changes: https://git.openjdk.org/jdk/pull/27743/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27743&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365606 Stats: 1247 lines in 16 files changed: 477 ins; 111 del; 659 mod Patch: https://git.openjdk.org/jdk/pull/27743.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27743/head:pull/27743 PR: https://git.openjdk.org/jdk/pull/27743 From sgehwolf at openjdk.org Fri Oct 10 13:38:57 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 10 Oct 2025 13:38:57 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: <23599yVgDZSAOeHbVlxG2edQxSRdmtr42J60EfWlAQ0=.a25ab0c1-8f01-4d96-8182-30e073a8a03b@github.com> On Fri, 10 Oct 2025 13:09:48 GMT, Severin Gehwolf wrote: > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? ## Testing details: **cgroup v2 F42 (docker):** Passed: containers/cgroup/CgroupSubsystemFactory.java Passed: containers/cgroup/TestContainerized.java Passed: containers/docker/DockerBasicTest.java Passed: containers/docker/ShareTmpDir.java Passed: containers/docker/TestContainerInfo.java Passed: containers/docker/TestCPUAwareness.java Passed: containers/docker/TestCPUSets.java Passed: containers/docker/TestJcmd.java Passed: containers/docker/TestJcmdWithSideCar.java Passed: containers/docker/TestJFREvents.java Passed: containers/docker/TestJFRNetworkEvents.java Passed: containers/docker/TestJFRWithJMX.java Passed: containers/docker/TestLimitsUpdating.java Passed: containers/docker/TestMemoryAwareness.java Passed: containers/docker/TestMemoryWithCgroupV1.java Passed: containers/docker/TestMemoryWithSubgroups.java Passed: containers/docker/TestMisc.java Passed: containers/docker/TestPids.java Passed: containers/systemd/SystemdMemoryAwarenessTest.java Passed: jdk/internal/platform/cgroup/CgroupV1SubsystemControllerTest.java Passed: jdk/internal/platform/cgroup/CgroupV2SubsystemControllerTest.java Passed: jdk/internal/platform/cgroup/TestCgroupMetrics.java Passed: jdk/internal/platform/cgroup/TestCgroupSubsystemController.java Passed: jdk/internal/platform/cgroup/TestCgroupSubsystemFactory.java Passed: jdk/internal/platform/cgroup/TestSystemSettings.java Passed: jdk/internal/platform/docker/TestDockerBasic.java Passed: jdk/internal/platform/docker/TestDockerCpuMetrics.java Passed: jdk/internal/platform/docker/TestDockerMemoryMetrics.java Passed: jdk/internal/platform/docker/TestDockerMemoryMetricsSubgroup.java Passed: jdk/internal/platform/docker/TestGetFreeSwapSpaceSize.java Passed: jdk/internal/platform/docker/TestLimitsUpdating.java Passed: jdk/internal/platform/docker/TestPidsLimit.java Passed: jdk/internal/platform/docker/TestSystemMetrics.java Passed: jdk/internal/platform/docker/TestUseContainerSupport.java Test results: passed: 34 **cgroup v2 F39 (docker):** Passed: containers/cgroup/CgroupSubsystemFactory.java Passed: containers/cgroup/TestContainerized.java Passed: containers/docker/DockerBasicTest.java Passed: containers/docker/ShareTmpDir.java Passed: containers/docker/TestContainerInfo.java Passed: containers/docker/TestCPUAwareness.java Passed: containers/docker/TestCPUSets.java Passed: containers/docker/TestJcmd.java Passed: containers/docker/TestJcmdWithSideCar.java Passed: containers/docker/TestJFREvents.java Passed: containers/docker/TestJFRNetworkEvents.java Passed: containers/docker/TestJFRWithJMX.java Passed: containers/docker/TestLimitsUpdating.java Passed: containers/docker/TestMemoryAwareness.java Passed: containers/docker/TestMemoryWithCgroupV1.java Passed: containers/docker/TestMemoryWithSubgroups.java Passed: containers/docker/TestMisc.java Passed: containers/docker/TestPids.java Passed: containers/systemd/SystemdMemoryAwarenessTest.java Test results: passed: 19 **cgroup v1 RHEL 8 (podman):** Passed: containers/cgroup/CgroupSubsystemFactory.java Passed: containers/cgroup/TestContainerized.java Passed: containers/docker/DockerBasicTest.java Passed: containers/docker/ShareTmpDir.java Passed: containers/docker/TestContainerInfo.java Passed: containers/docker/TestCPUAwareness.java Passed: containers/docker/TestCPUSets.java Passed: containers/docker/TestJcmd.java Passed: containers/docker/TestJcmdWithSideCar.java Passed: containers/docker/TestJFREvents.java Passed: containers/docker/TestJFRNetworkEvents.java Passed: containers/docker/TestJFRWithJMX.java Passed: containers/docker/TestLimitsUpdating.java Passed: containers/docker/TestMemoryAwareness.java Passed: containers/docker/TestMemoryWithCgroupV1.java Passed: containers/docker/TestMemoryWithSubgroups.java Passed: containers/docker/TestMisc.java Passed: containers/docker/TestPids.java Passed: containers/systemd/SystemdMemoryAwarenessTest.java Test results: passed: 19; skipped: 1 Note: The skipped test on RHEL 8 is `TestContainerInfo` which checks `cgv2` functionality only. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3390060127 From mgronlun at openjdk.org Fri Oct 10 14:47:08 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 10 Oct 2025 14:47:08 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: <2EF1whYIVC4qpXKNQJIYsxK6eLqfI89YWn0HjCxNjH4=.053b510f-fbd0-4ccd-a835-c235a35716c9@github.com> On Thu, 9 Oct 2025 21:04:41 GMT, Larry Cable wrote: > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof Can you please give an example URL for a class definition? I am concerned about whether this is high cardinality strings (for path/name.class) or a lot of reuse (for paths). We should only represent a URL once, which makes me think that the field type should be symbol instead of string. For that, we would need a concurrent symbol table, which I have already planned in other changes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3390552142 From alanb at openjdk.org Fri Oct 10 15:16:03 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 10 Oct 2025 15:16:03 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: <2EF1whYIVC4qpXKNQJIYsxK6eLqfI89YWn0HjCxNjH4=.053b510f-fbd0-4ccd-a835-c235a35716c9@github.com> References: <2EF1whYIVC4qpXKNQJIYsxK6eLqfI89YWn0HjCxNjH4=.053b510f-fbd0-4ccd-a835-c235a35716c9@github.com> Message-ID: On Fri, 10 Oct 2025 14:44:04 GMT, Markus Gr?nlund wrote: > Can you please give an example URL for a class definition? I am concerned about whether this is high cardinality strings (for path/name.class) or a lot of reuse (for paths). We should only represent a URL once, which makes me think that the field type should be symbol instead of string. Run with`-Xlog:class+load` to see examples of the code source. For classes loaded from modules in the run-time image then you'll see values of the form `jrt:/$MODULE`, e.g. `jrt:/java.base` or `jrt:/java.destop` (classes loaded from the AOT have something like "shared objects file"). The code source for classes loaded from JAR files is the path to the JAR file, e.g. `file:/lib/foo.jar`. When classes loaded from the file system then it will be the directory specified to the class path, e.g. `file:/d/classes/`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3390702449 From sgehwolf at openjdk.org Fri Oct 10 15:59:26 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 10 Oct 2025 15:59:26 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: <7ZsK1yJQzaJ09WEageZzfvEYHugE9CX4aX0OOLbgqxo=.698bca0a-81e1-4e08-9442-28cd0fda5873@github.com> On Fri, 10 Oct 2025 13:09:48 GMT, Severin Gehwolf wrote: > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? GHA test failure on Windows x64 is unrelated (this is a Linux only patch): [gc/shenandoah/oom/TestThreadFailure](https://github.com/jerboaa/jdk/actions/runs/18406968978#user-content-gc_shenandoah_oom_testthreadfailure) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3390913305 From dholmes at openjdk.org Mon Oct 13 01:49:02 2025 From: dholmes at openjdk.org (David Holmes) Date: Mon, 13 Oct 2025 01:49:02 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: On Fri, 10 Oct 2025 13:09:48 GMT, Severin Gehwolf wrote: > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? There seems to be some collision here with JDK-[8367319](https://github.com/openjdk/jdk/pull/27646/) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3395619340 From sgehwolf at openjdk.org Mon Oct 13 08:18:10 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 13 Oct 2025 08:18:10 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: On Mon, 13 Oct 2025 01:46:43 GMT, David Holmes wrote: > There seems to be some collision here with JDK-[8367319](https://github.com/openjdk/jdk/pull/27646/) Thanks, yes, I'm aware. We'll resolve conflicts once we know which one goes in first. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3396358387 From mgronlun at openjdk.org Mon Oct 13 11:37:16 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Mon, 13 Oct 2025 11:37:16 GMT Subject: Integrated: 8369255: Assess and remedy any unsafe usage of the Semaphores used by JFR In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 10:07:35 GMT, Markus Gr?nlund wrote: > Greetings, > > Please help review this change set that prevents a race in the shutdown of the VM, where the CRT is destroyed while threads might still be running JFR code. Please see the JIRA issue for an explanation. > > Testing: jdk_jfr, tier 1 - 3 > > Thanks > Markus This pull request has now been integrated. Changeset: 62fa971f Author: Markus Gr?nlund URL: https://git.openjdk.org/jdk/commit/62fa971f3116828398294c9d57650c4e0aca7379 Stats: 51 lines in 2 files changed: 33 ins; 13 del; 5 mod 8369255: Assess and remedy any unsafe usage of the Semaphores used by JFR Reviewed-by: egahlin ------------- PR: https://git.openjdk.org/jdk/pull/27722 From mgronlun at openjdk.org Mon Oct 13 12:21:07 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Mon, 13 Oct 2025 12:21:07 GMT Subject: RFR: 8369510: JFR: Remove flush handler from Dispatcher lookup In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 15:39:52 GMT, Erik Gahlin wrote: > Could I get a review of a PR that removes dead code? > > Testing: test/jdk/jdk/jfr > > To ensure the code is not used, I added Thread.sleep(10000000) to the lambda, but no tests timed out. > > Thanks > Erik Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27733#pullrequestreview-3331392630 From egahlin at openjdk.org Mon Oct 13 15:20:53 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Mon, 13 Oct 2025 15:20:53 GMT Subject: Integrated: 8369510: JFR: Remove flush handler from Dispatcher lookup In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 15:39:52 GMT, Erik Gahlin wrote: > Could I get a review of a PR that removes dead code? > > Testing: test/jdk/jdk/jfr > > To ensure the code is not used, I added Thread.sleep(10000000) to the lambda, but no tests timed out. > > Thanks > Erik This pull request has now been integrated. Changeset: 16681623 Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/166816231988dd94f644a7b892cdddf0fea94570 Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod 8369510: JFR: Remove flush handler from Dispatcher lookup Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27733 From egahlin at openjdk.org Tue Oct 14 00:31:18 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 14 Oct 2025 00:31:18 GMT Subject: RFR: 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" Message-ID: Could I get a review for a PR that relaxes an assert? When removing the last parent in a frontier, the queue can fill while processing its children, causing _dfs_fallback_idx to equal _next_frontier_idx. Testing: 5000 * test/jdk/jdk/jfr/jvm/TestWaste.java Thanks Erik ------------- Commit messages: - Initial Changes: https://git.openjdk.org/jdk/pull/27779/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27779&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8282427 Stats: 2 lines in 2 files changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27779.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27779/head:pull/27779 PR: https://git.openjdk.org/jdk/pull/27779 From syan at openjdk.org Tue Oct 14 03:38:07 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 14 Oct 2025 03:38:07 GMT Subject: RFR: 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 00:07:44 GMT, Erik Gahlin wrote: > Could I get a review for a PR that relaxes an assert? When removing the last parent in a frontier, the queue can fill while processing its children, causing _dfs_fallback_idx to equal _next_frontier_idx. > > Testing: 5000 * test/jdk/jdk/jfr/jvm/TestWaste.java > > Thanks > Erik src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp line 192: > 190: // fallback onto DFS as part of processing the frontier > 191: assert(_dfs_fallback_idx >= _prev_frontier_idx, "invariant"); > 192: assert(_dfs_fallback_idx =< _next_frontier_idx, "invariant"); Does `=<` should be `<=` ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27779#discussion_r2427822343 From egahlin at openjdk.org Tue Oct 14 04:37:45 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 14 Oct 2025 04:37:45 GMT Subject: RFR: 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" [v2] In-Reply-To: References: Message-ID: <3314UuvTOih9gdOm-OdMZoYwjgDmP1ZvPYWVJbagE6A=.526b4eb7-acc5-486b-bb68-293eb905d673@github.com> > Could I get a review for a PR that relaxes an assert? When removing the last parent in a frontier, the queue can fill while processing its children, causing _dfs_fallback_idx to equal _next_frontier_idx. > > Testing: 5000 * test/jdk/jdk/jfr/jvm/TestWaste.java > > Thanks > Erik Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision: Fix operator ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27779/files - new: https://git.openjdk.org/jdk/pull/27779/files/5afe8efc..c5ff9f44 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27779&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27779&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27779.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27779/head:pull/27779 PR: https://git.openjdk.org/jdk/pull/27779 From jbechberger at openjdk.org Tue Oct 14 07:29:41 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Tue, 14 Oct 2025 07:29:41 GMT Subject: RFR: 8366240: Improve memory ordering in new CPU Time Profiler [v4] In-Reply-To: References: Message-ID: > Remove acq-rel semantics where it isn't needed. Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: - Merge branch 'master' of https://git.openjdk.org/jdk into parttimenerd_reduce_synchronization - Merge branch 'master' into parttimenerd_reduce_synchronization - Extend comment - Remove unnecessary line - Remove redundant synchronization ------------- Changes: https://git.openjdk.org/jdk/pull/26960/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26960&range=03 Stats: 41 lines in 2 files changed: 12 ins; 12 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/26960.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26960/head:pull/26960 PR: https://git.openjdk.org/jdk/pull/26960 From krk at openjdk.org Tue Oct 14 09:33:01 2025 From: krk at openjdk.org (Kerem Kat) Date: Tue, 14 Oct 2025 09:33:01 GMT Subject: RFR: 8366240: Improve memory ordering in new CPU Time Profiler [v4] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 07:29:41 GMT, Johannes Bechberger wrote: >> Remove acq-rel semantics where it isn't needed. > > Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: > > - Merge branch 'master' of https://git.openjdk.org/jdk into parttimenerd_reduce_synchronization > - Merge branch 'master' into parttimenerd_reduce_synchronization > - Extend comment > - Remove unnecessary line > - Remove redundant synchronization Marked as reviewed by krk (no project role). ------------- PR Review: https://git.openjdk.org/jdk/pull/26960#pullrequestreview-3334709951 From mgronlun at openjdk.org Tue Oct 14 09:59:25 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Tue, 14 Oct 2025 09:59:25 GMT Subject: RFR: 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" [v2] In-Reply-To: <3314UuvTOih9gdOm-OdMZoYwjgDmP1ZvPYWVJbagE6A=.526b4eb7-acc5-486b-bb68-293eb905d673@github.com> References: <3314UuvTOih9gdOm-OdMZoYwjgDmP1ZvPYWVJbagE6A=.526b4eb7-acc5-486b-bb68-293eb905d673@github.com> Message-ID: On Tue, 14 Oct 2025 04:37:45 GMT, Erik Gahlin wrote: >> Could I get a review for a PR that relaxes an assert? When removing the last parent in a frontier, the queue can fill while processing its children, causing _dfs_fallback_idx to equal _next_frontier_idx. >> >> Testing: 5000 * test/jdk/jdk/jfr/jvm/TestWaste.java >> >> Thanks >> Erik > > Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision: > > Fix operator Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27779#pullrequestreview-3334803639 From mgronlun at openjdk.org Tue Oct 14 11:05:39 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Tue, 14 Oct 2025 11:05:39 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: <2EF1whYIVC4qpXKNQJIYsxK6eLqfI89YWn0HjCxNjH4=.053b510f-fbd0-4ccd-a835-c235a35716c9@github.com> Message-ID: On Fri, 10 Oct 2025 15:13:43 GMT, Alan Bateman wrote: > > Can you please give an example URL for a class definition? I am concerned about whether this is high cardinality strings (for path/name.class) or a lot of reuse (for paths). We should only represent a URL once, which makes me think that the field type should be symbol instead of string. > > Run with `-Xlog:class+load` to see examples of the code source. For classes loaded from modules in the run-time image then you'll see values of the form `jrt:/$MODULE`, e.g. `jrt:/java.base` or `jrt:/java.destop` (classes loaded from the AOT have something like "shared objects file"). The code source for classes loaded from JAR files is the path to the JAR file, e.g. `file:/lib/foo.jar`. When classes loaded from the file system then it will be the directory specified to the class path, e.g. `file:/d/classes/`. Thanks. Looks like the source is a low cardinality property. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3401254061 From zgu at openjdk.org Tue Oct 14 14:40:18 2025 From: zgu at openjdk.org (Zhengyu Gu) Date: Tue, 14 Oct 2025 14:40:18 GMT Subject: RFR: 8366240: Improve memory ordering in new CPU Time Profiler [v4] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 07:29:41 GMT, Johannes Bechberger wrote: >> Remove acq-rel semantics where it isn't needed. > > Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: > > - Merge branch 'master' of https://git.openjdk.org/jdk into parttimenerd_reduce_synchronization > - Merge branch 'master' into parttimenerd_reduce_synchronization > - Extend comment > - Remove unnecessary line > - Remove redundant synchronization The queue is per-thread private. LGTM ------------- Marked as reviewed by zgu (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26960#pullrequestreview-3336045379 From egahlin at openjdk.org Wed Oct 15 01:01:22 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 15 Oct 2025 01:01:22 GMT Subject: Integrated: 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" In-Reply-To: References: Message-ID: <7y3Ei78WY8AmIZkLCFsIQQwsC3x1Hp0_TfkPdcteq8I=.0f5c84af-0f51-4e56-bced-7c44b954bb09@github.com> On Tue, 14 Oct 2025 00:07:44 GMT, Erik Gahlin wrote: > Could I get a review for a PR that relaxes an assert? When removing the last parent in a frontier, the queue can fill while processing its children, causing _dfs_fallback_idx to equal _next_frontier_idx. > > Testing: 5000 * test/jdk/jdk/jfr/jvm/TestWaste.java > > Thanks > Erik This pull request has now been integrated. Changeset: c82c8920 Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/c82c892063ebb91ffeb853db2f325154465cfdff Stats: 2 lines in 2 files changed: 0 ins; 1 del; 1 mod 8282427: jdk/jfr/jvm/TestWaste.java is failing with "exit code 139" Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27779 From egahlin at openjdk.org Thu Oct 16 09:12:20 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 16 Oct 2025 09:12:20 GMT Subject: RFR: 8369982: ProblemList jdk/jfr/jvm/TestWaste.java Message-ID: Could I have a review of PR that problem lists jdk/jfr/jvm/TestWaste.java Thanks Erik ------------- Commit messages: - Correct bug number - Initial Changes: https://git.openjdk.org/jdk/pull/27837/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27837&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369982 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27837.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27837/head:pull/27837 PR: https://git.openjdk.org/jdk/pull/27837 From tschatzl at openjdk.org Thu Oct 16 09:30:00 2025 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Thu, 16 Oct 2025 09:30:00 GMT Subject: RFR: 8369982: ProblemList jdk/jfr/jvm/TestWaste.java In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 08:36:11 GMT, Erik Gahlin wrote: > Could I have a review of PR that problem lists jdk/jfr/jvm/TestWaste.java > > Thanks > Erik Thanks! Trivial too. ------------- Marked as reviewed by tschatzl (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27837#pullrequestreview-3343879578 From dholmes at openjdk.org Thu Oct 16 09:30:01 2025 From: dholmes at openjdk.org (David Holmes) Date: Thu, 16 Oct 2025 09:30:01 GMT Subject: RFR: 8369982: ProblemList jdk/jfr/jvm/TestWaste.java In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 08:36:11 GMT, Erik Gahlin wrote: > Could I have a review of PR that problem lists jdk/jfr/jvm/TestWaste.java > > Thanks > Erik LGTM Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27837#pullrequestreview-3343880102 From egahlin at openjdk.org Thu Oct 16 09:59:55 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 16 Oct 2025 09:59:55 GMT Subject: Integrated: 8369982: ProblemList jdk/jfr/jvm/TestWaste.java In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 08:36:11 GMT, Erik Gahlin wrote: > Could I have a review of PR that problem lists jdk/jfr/jvm/TestWaste.java > > Thanks > Erik This pull request has now been integrated. Changeset: d6c122b3 Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/d6c122b3ff1ccd559ba9c310976a77eefaf09ece Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8369982: ProblemList jdk/jfr/jvm/TestWaste.java Reviewed-by: tschatzl, dholmes ------------- PR: https://git.openjdk.org/jdk/pull/27837 From duke at openjdk.org Thu Oct 16 19:41:15 2025 From: duke at openjdk.org (Larry Cable) Date: Thu, 16 Oct 2025 19:41:15 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading [v2] In-Reply-To: References: Message-ID: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof Larry Cable has updated the pull request incrementally with one additional commit since the last revision: added package and module entries ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27738/files - new: https://git.openjdk.org/jdk/pull/27738/files/09ce2472..67141ee8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27738&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27738&range=00-01 Stats: 10 lines in 2 files changed: 9 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27738.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27738/head:pull/27738 PR: https://git.openjdk.org/jdk/pull/27738 From duke at openjdk.org Thu Oct 16 21:25:01 2025 From: duke at openjdk.org (Larry Cable) Date: Thu, 16 Oct 2025 21:25:01 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading [v2] In-Reply-To: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> References: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> Message-ID: On Thu, 16 Oct 2025 19:41:15 GMT, Larry Cable wrote: >> the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. >> >> The location of the class file for a class defined can be of utility in both debugging and auditing. >> >> this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > added package and module entries looking at the current implementation for both jdk.ClassDefine and jdk.ClassLoad events, the "source" metadata recorded by the new event is not available in the (current) calling context for either of the pre-existing events. In my opinion adding a new event to capture this information is less intrusive than adding fields(s) to the existing event(s) and contriving to provide the necessary state to those at their current call sites (or by relocating those to a calling context where the "source" is available) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3412911045 From mgronlun at openjdk.org Fri Oct 17 09:14:58 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 17 Oct 2025 09:14:58 GMT Subject: RFR: 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state Message-ID: Greetings, A tiny adjustment to the fix in https://bugs.openjdk.org/browse/JDK-8369255. A JavaThread must be in a safe safepoint state before taking an infinite nap; for convenience, it goes to _thread_in_native. Testing: jdk_jfr Thanks Markus ------------- Commit messages: - 8369991 Changes: https://git.openjdk.org/jdk/pull/27862/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27862&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369991 Stats: 10 lines in 1 file changed: 6 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27862.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27862/head:pull/27862 PR: https://git.openjdk.org/jdk/pull/27862 From mgronlun at openjdk.org Fri Oct 17 09:20:30 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Fri, 17 Oct 2025 09:20:30 GMT Subject: RFR: 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state [v2] In-Reply-To: References: Message-ID: > Greetings, > > A tiny adjustment to the fix in https://bugs.openjdk.org/browse/JDK-8369255. > > A JavaThread must be in a safe safepoint state before taking an infinite nap; for convenience, it goes to _thread_in_native. > > Testing: jdk_jfr > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27862/files - new: https://git.openjdk.org/jdk/pull/27862/files/1058e7b5..c4295b8b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27862&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27862&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27862.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27862/head:pull/27862 PR: https://git.openjdk.org/jdk/pull/27862 From alanb at openjdk.org Fri Oct 17 10:43:03 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 17 Oct 2025 10:43:03 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading [v2] In-Reply-To: References: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> Message-ID: On Thu, 16 Oct 2025 21:22:39 GMT, Larry Cable wrote: >> Larry Cable has updated the pull request incrementally with one additional commit since the last revision: >> >> added package and module entries > > looking at the current implementation for both jdk.ClassDefine and jdk.ClassLoad events, the "source" metadata recorded by the new event is not available in the (current) calling context for either of the pre-existing events. > > In my opinion adding a new event to capture this information is less intrusive than adding fields(s) to the existing event(s) and contriving to provide the necessary state to those at their current call sites (or by relocating those to a calling context where the "source" is available) @larry-cable Are you sure adding a new event is the right thing to do? Is it just the implementation challenge? If jdk.ClassDefine were being added today then it seems useful to add the module and the code source (no need for the package as the definedClass gives the fully qualified class name). ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3414916266 From fandreuzzi at openjdk.org Fri Oct 17 13:49:04 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 17 Oct 2025 13:49:04 GMT Subject: RFR: 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state [v2] In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 09:20:30 GMT, Markus Gr?nlund wrote: >> Greetings, >> >> A tiny adjustment to the fix in https://bugs.openjdk.org/browse/JDK-8369255. >> >> A JavaThread must be in a safe safepoint state before taking an infinite nap; for convenience, it goes to _thread_in_native. >> >> Testing: jdk_jfr >> >> Thanks >> Markus > > Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: > > comment Marked as reviewed by fandreuzzi (Author). ------------- PR Review: https://git.openjdk.org/jdk/pull/27862#pullrequestreview-3350449250 From mgronlun at openjdk.org Sun Oct 19 12:23:05 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 19 Oct 2025 12:23:05 GMT Subject: RFR: 8365400: enhance JFR to emit file and module metadata for class loading [v2] In-Reply-To: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> References: <2TCYpXA-OLJHgdSydEwnAyr4_dgJjrJHBAJQ-gKcmO0=.e6599df6-e9fe-4d43-ac6c-5cf2836c2cdb@github.com> Message-ID: On Thu, 16 Oct 2025 19:41:15 GMT, Larry Cable wrote: >> the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. >> >> The location of the class file for a class defined can be of utility in both debugging and auditing. >> >> this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > added package and module entries Package and Module information is implicitly included in the JFR model for a class (its transitive dependencies), so you do not need to include them explicitly. I prefer that the design address how the source information is to be included for the existing events (ClassLoad and ClassDefine). I am working on a symbol table implementation to help you out. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27738#issuecomment-3419623850 From duke at openjdk.org Mon Oct 20 17:25:14 2025 From: duke at openjdk.org (Larry Cable) Date: Mon, 20 Oct 2025 17:25:14 GMT Subject: Withdrawn: 8365400: enhance JFR to emit file and module metadata for class loading In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 21:04:41 GMT, Larry Cable wrote: > the existing` jdk.classDefine` and `jdk.ClassLoad` events do not include metadata regarding the location/source of the ClassFile. > > The location of the class file for a class defined can be of utility in both debugging and auditing. > > this addition introduces a new `jdk.ClassFileDefine` event which records the class defined and the location (path/url) of the class file that contained the implementation thereof This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/27738 From egahlin at openjdk.org Tue Oct 21 13:10:36 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 21 Oct 2025 13:10:36 GMT Subject: RFR: 8370242: JFR: Clear event reference eagerly when using EventStream Message-ID: Could I have review of a change that reduce the live set when using event streaming? Testing: jdk/jdk/jfr Thanks Erik ------------- Commit messages: - Remove patch.txt - Initial Changes: https://git.openjdk.org/jdk/pull/27906/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27906&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370242 Stats: 11 lines in 2 files changed: 10 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27906.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27906/head:pull/27906 PR: https://git.openjdk.org/jdk/pull/27906 From mgronlun at openjdk.org Tue Oct 21 16:28:59 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Tue, 21 Oct 2025 16:28:59 GMT Subject: RFR: 8370242: JFR: Clear event reference eagerly when using EventStream In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 20:50:41 GMT, Erik Gahlin wrote: > Could I have review of a change that reduce the live set when using event streaming? > > The EventDirectoryStream and EventFileStream classes may hold on to events longer than needed. If a burst of events occurs, the sorted cache is filled, but if fewer events are emitted later, old events still remain in the cache array. They should be cleared after they have been dispatched. > > This is effectively a memory leak, although it does not grow over time. > > Testing: jdk/jdk/jfr > > Thanks > Erik Looks good. ------------- Marked as reviewed by mgronlun (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27906#pullrequestreview-3361647146 From egahlin at openjdk.org Wed Oct 22 11:30:27 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 22 Oct 2025 11:30:27 GMT Subject: Integrated: 8370242: JFR: Clear event reference eagerly when using EventStream In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 20:50:41 GMT, Erik Gahlin wrote: > Could I have review of a change that reduce the live set when using event streaming? > > The EventDirectoryStream and EventFileStream classes may hold on to events longer than needed. If a burst of events occurs, the sorted cache is filled, but if fewer events are emitted later, old events still remain in the cache array. They should be cleared after they have been dispatched. > > This is effectively a memory leak, although it does not grow over time. > > Testing: jdk/jdk/jfr > > Thanks > Erik This pull request has now been integrated. Changeset: 65b32394 Author: Erik Gahlin URL: https://git.openjdk.org/jdk/commit/65b32394187988abab99a8017eda39b1bd4a1782 Stats: 11 lines in 2 files changed: 10 ins; 1 del; 0 mod 8370242: JFR: Clear event reference eagerly when using EventStream Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27906 From egahlin at openjdk.org Wed Oct 22 12:58:09 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 22 Oct 2025 12:58:09 GMT Subject: RFR: 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state [v2] In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 09:20:30 GMT, Markus Gr?nlund wrote: >> Greetings, >> >> A tiny adjustment to the fix in https://bugs.openjdk.org/browse/JDK-8369255. >> >> A JavaThread must be in a safe safepoint state before taking an infinite nap; for convenience, it goes to _thread_in_native. >> >> Testing: jdk_jfr >> >> Thanks >> Markus > > Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: > > comment Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27862#pullrequestreview-3365665374 From duke at openjdk.org Wed Oct 22 16:48:04 2025 From: duke at openjdk.org (duke) Date: Wed, 22 Oct 2025 16:48:04 GMT Subject: Withdrawn: 8356968: JFR: Compilation event should be enabled for all compilations by default In-Reply-To: References: Message-ID: On Thu, 15 May 2025 08:49:47 GMT, Aleksey Shipilev wrote: > In the field, we are using -XX:+PrintCompilation to track compiler performance. Alternatively, -Xlog:jit* prints the same. JFR has a the related jdk.Compilation event that gives us even richer diagnostics. Yet, that event is set at a very high threshold (1000ms), which skips almost all compilations! This threshold is set to such a high value from the beginning. > > It is fairly normal to have lots of compilations in 100+ ms range individually, and their sum impact is what we are after. Also, the compilations are normally quite rare, and there are a couple of thousands of compiles in most workloads, and they only happen sporadically. This means, the event count without any threshold is not high. > > Therefore, it would be convenient to make sure that basic Compilation event is enabled unconditionally, e.g. by dropping the default threshold to 0. > > See more logs in the bug itself. > > Additional testing: > - [x] Ad-hoc tests with printing compilation events > - [x] Linux x86_64 server fastdebug, `jdk_jfr` This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25247 From mgronlun at openjdk.org Wed Oct 22 17:42:45 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Wed, 22 Oct 2025 17:42:45 GMT Subject: Integrated: 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 09:06:09 GMT, Markus Gr?nlund wrote: > Greetings, > > A tiny adjustment to the fix in https://bugs.openjdk.org/browse/JDK-8369255. > > A JavaThread must be in a safe safepoint state before taking an infinite nap; for convenience, it goes to _thread_in_native. > > Testing: jdk_jfr > > Thanks > Markus This pull request has now been integrated. Changeset: afba6368 Author: Markus Gr?nlund URL: https://git.openjdk.org/jdk/commit/afba636869bc297d0c9c29fbe7f2a1eb5929218b Stats: 10 lines in 1 file changed: 6 ins; 1 del; 3 mod 8369991: Thread blocking during JFR emergency dump must be in safepoint safe state Reviewed-by: fandreuzzi, egahlin ------------- PR: https://git.openjdk.org/jdk/pull/27862 From sgehwolf at openjdk.org Fri Oct 24 08:23:04 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 24 Oct 2025 08:23:04 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: <8RgpPnr9F8ltCUSxU81hfH-u7KgK7FQRIiKufU_Lg5o=.3aeb406d-c9c2-44fa-a707-8e59d7ce6652@github.com> On Fri, 10 Oct 2025 13:09:48 GMT, Severin Gehwolf wrote: > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? Could anybody please help review this! Thank you. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3441752392 From jbachorik at openjdk.org Fri Oct 24 08:39:05 2025 From: jbachorik at openjdk.org (Jaroslav Bachorik) Date: Fri, 24 Oct 2025 08:39:05 GMT Subject: RFR: 8366240: Improve memory ordering in new CPU Time Profiler [v4] In-Reply-To: References: Message-ID: <8TRs1C7c58rgQICbL_-ArygqQIZm6D5WnXKSbZU3kN8=.28cae14d-ded9-4def-bb54-efae076f0b1c@github.com> On Tue, 14 Oct 2025 07:29:41 GMT, Johannes Bechberger wrote: >> Remove acq-rel semantics where it isn't needed. > > Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: > > - Merge branch 'master' of https://git.openjdk.org/jdk into parttimenerd_reduce_synchronization > - Merge branch 'master' into parttimenerd_reduce_synchronization > - Extend comment > - Remove unnecessary line > - Remove redundant synchronization Marked as reviewed by jbachorik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26960#pullrequestreview-3375130649 From jbechberger at openjdk.org Fri Oct 24 08:58:22 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Fri, 24 Oct 2025 08:58:22 GMT Subject: Integrated: 8366240: Improve memory ordering in new CPU Time Profiler In-Reply-To: References: Message-ID: <3FBp8jUWmSes6DBh-sb1jfUBv6jAICRXl6vigE7KXqM=.779396fe-62fe-48ec-b05f-0ecbc9d444e1@github.com> On Wed, 27 Aug 2025 12:50:13 GMT, Johannes Bechberger wrote: > Remove acq-rel semantics where it isn't needed. This pull request has now been integrated. Changeset: b7a4c9ce Author: Johannes Bechberger URL: https://git.openjdk.org/jdk/commit/b7a4c9ced82717434e43b3f3a0a57083f4005f32 Stats: 41 lines in 2 files changed: 12 ins; 12 del; 17 mod 8366240: Improve memory ordering in new CPU Time Profiler Reviewed-by: jbachorik, krk, zgu ------------- PR: https://git.openjdk.org/jdk/pull/26960 From aph at openjdk.org Fri Oct 24 09:39:02 2025 From: aph at openjdk.org (Andrew Haley) Date: Fri, 24 Oct 2025 09:39:02 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: On Fri, 10 Oct 2025 13:09:48 GMT, Severin Gehwolf wrote: > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? I'm not surprised about the lack of reviews because it's long and the result is rather ugly. (Sorry, but I had to say it.) This is less jarring to read: struct Result { const int _value; const bool _ok; Result(int value, bool ok) : _value(value), _ok(ok) {} }; ... Result CgroupSubsystem::active_processor_count() { ... cpu_count = os::Linux::active_processor_count(); if (!CgroupUtil::processor_count(contrl->controller(), cpu_count, value)) { return Result(value, false); } assert(value > 0 && value <= cpu_count, "must be"); // Update cached metric to avoid re-reading container settings too often cpu_limit->set_value(value, OSCONTAINER_CACHE_TIMEOUT); return Result(value, true); } called as: auto [result, ok] = cgroup_subsystem->active_processor_count(); if (ok) ... ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3442136772 From sgehwolf at openjdk.org Fri Oct 24 09:45:25 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 24 Oct 2025 09:45:25 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> Message-ID: <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> > Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. > > It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. > > All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. > > All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. > > While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. > > Testing (looking good): > - [x] GHA > - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. > - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. > > Thoughts? Opinions? Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Merge branch 'master' into jdk-8365606-jlong-julong-refactor - Fix print_container_info output - whitespace clean-ups and other small fixes - Fix log format in container macro and scanf format - Fix duplicate include in osContainer_linux - 8365606: Container code should not be using jlong/julong ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27743/files - new: https://git.openjdk.org/jdk/pull/27743/files/e906490e..917a51c6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27743&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27743&range=00-01 Stats: 39117 lines in 885 files changed: 23412 ins; 10970 del; 4735 mod Patch: https://git.openjdk.org/jdk/pull/27743.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27743/head:pull/27743 PR: https://git.openjdk.org/jdk/pull/27743 From cnorrbin at openjdk.org Fri Oct 24 10:50:03 2025 From: cnorrbin at openjdk.org (Casper Norrbin) Date: Fri, 24 Oct 2025 10:50:03 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 09:45:25 GMT, Severin Gehwolf wrote: >> Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. >> >> It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. >> >> All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. >> >> All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. >> >> While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. >> >> Testing (looking good): >> - [x] GHA >> - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. >> - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. >> >> Thoughts? Opinions? > > Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jdk-8365606-jlong-julong-refactor > - Fix print_container_info output > - whitespace clean-ups and other small fixes > - Fix log format in container macro and scanf format > - Fix duplicate include in osContainer_linux > - 8365606: Container code should not be using jlong/julong I'm currently looking at this, just as a quick FYI. I'm fine with the proposed interface as it is (boolean return + passed reference). Since the adjacent `os` functions recently changed to use this interface, and the disproportionate (to me) amount of bikeshedding it took to reach a consensus on that, introducing yet another interface here, for what's essentially a subcomponent, doesn't make much sense. It's clearer if the whole `os` stack sticks to the same interface. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3442470839 From stuefe at openjdk.org Fri Oct 24 11:27:04 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Fri, 24 Oct 2025 11:27:04 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 10:46:52 GMT, Casper Norrbin wrote: > I'm currently looking at this, just as a quick FYI. > > I'm fine with the proposed interface as it is (boolean return + passed reference). Since the adjacent `os` functions recently changed to use this interface, and the disproportionate (to me) amount of bikeshedding it took to reach a consensus on that, introducing yet another interface here, for what's essentially a subcomponent, doesn't make much sense. It's clearer if the whole `os` stack sticks to the same interface. I agree. Its not pretty, but consistent with what we did elsewhere. Nobody wants to do that discussion again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3442620964 From stuefe at openjdk.org Fri Oct 24 11:31:07 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Fri, 24 Oct 2025 11:31:07 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 09:45:25 GMT, Severin Gehwolf wrote: >> Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. >> >> It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. >> >> All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. >> >> All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. >> >> While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. >> >> Testing (looking good): >> - [x] GHA >> - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. >> - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. >> >> Thoughts? Opinions? > > Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jdk-8365606-jlong-julong-refactor > - Fix print_container_info output > - whitespace clean-ups and other small fixes > - Fix log format in container macro and scanf format > - Fix duplicate include in osContainer_linux > - 8365606: Container code should not be using jlong/julong Mostly looks good to me. Some remnants of raw UINT64_FORMAT are left. I did not see any type clashes. I hold off the final review until it is clear that the interfaces are agreed upon. src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 638: > 636: bool CgroupSubsystem::active_processor_count(int& value) { > 637: int cpu_count; > 638: int result = -1; Why not get rid of result and use `value` throughout like you did in the cached case? src/hotspot/os/linux/cgroupSubsystem_linux.hpp line 80: > 78: return false; \ > 79: } \ > 80: log_trace(os, container)(log_string " is: " UINT64_FORMAT, retval); \ Here and in other places: don't use raw UINT64_FORMAT; use `PHYS_MEM_TYPE_FORMAT` instead. src/hotspot/os/linux/cgroupSubsystem_linux.hpp line 105: > 103: is_ok = controller->read_string(filename, retval, buf_size); \ > 104: if (!is_ok) { \ > 105: log_trace(os, container)(log_string " failed: -2"); \ Why this change? Did the constant value change? ------------- PR Review: https://git.openjdk.org/jdk/pull/27743#pullrequestreview-3375466876 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2459590069 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2459894453 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2459898806 From aph at openjdk.org Fri Oct 24 12:28:16 2025 From: aph at openjdk.org (Andrew Haley) Date: Fri, 24 Oct 2025 12:28:16 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 11:24:48 GMT, Thomas Stuefe wrote: > > I agree. Its not pretty, but consistent with what we did elsewhere. Nobody wants to do that discussion again. Sorry, I was unaware of any previous discussion. I was suggesting a less impactful way to make the change, taking advantage of the recent adoption of C++17, which allows for cleaner code. But I won't stand in the way of consensus. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3442865789 From syan at openjdk.org Sat Oct 25 01:11:24 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 25 Oct 2025 01:11:24 GMT Subject: RFR: 8366240: Improve memory ordering in new CPU Time Profiler [v4] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 07:29:41 GMT, Johannes Bechberger wrote: >> Remove acq-rel semantics where it isn't needed. > > Johannes Bechberger has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: > > - Merge branch 'master' of https://git.openjdk.org/jdk into parttimenerd_reduce_synchronization > - Merge branch 'master' into parttimenerd_reduce_synchronization > - Extend comment > - Remove unnecessary line > - Remove redundant synchronization This PR seems cause a new test failure [JDK-8370647](https://bugs.openjdk.org/browse/JDK-8370647) ------------- PR Comment: https://git.openjdk.org/jdk/pull/26960#issuecomment-3445413790 From ysuenaga at openjdk.org Mon Oct 27 01:18:33 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Mon, 27 Oct 2025 01:18:33 GMT Subject: RFR: 8370260: Test jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java timed out Message-ID: The test failure was reported at jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java due to minidump timeout. `TestEmergencyDumpAtOOM` does not need minidump, so we can add `-XX:-CreateCoredumpOnCrash` to the test process. This change works on Windows 11 Pro 25H2 and Fedora 42. ------------- Commit messages: - 8370260: jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java timed out Changes: https://git.openjdk.org/jdk/pull/27993/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27993&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370260 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27993.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27993/head:pull/27993 PR: https://git.openjdk.org/jdk/pull/27993 From aseoane at openjdk.org Mon Oct 27 06:35:27 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 06:35:27 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Merge branch 'openjdk:master' into JDK-8347463 - Merge branch 'JDK-8347463' of github.com:anton-seoane/jdk into JDK-8347463 - Merge branch 'openjdk:master' into JDK-8347463 - Documentation for future similar cases - Test for JDK-8347463 - Change to a more specific type - Runtime call had void type but actually returned an object ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/a6225ebd..c85142ef Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=00-01 Stats: 11497 lines in 242 files changed: 7821 ins; 2031 del; 1645 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From aseoane at openjdk.org Mon Oct 27 06:35:27 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 06:35:27 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) In-Reply-To: References: Message-ID: On Tue, 21 Oct 2025 09:19:22 GMT, Anton Seoane Ampudia wrote: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Switching back to draft after conversation with @robcasloz, to perform further investigation ------------- PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3426511124 From stefank at openjdk.org Mon Oct 27 08:36:12 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 27 Oct 2025 08:36:12 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: <9uVKpiWCXvxcxhyg6V1seeSxyLm14lHEdOL_I07uVQs=.de1b0ed8-d006-49d5-a982-27556759415e@github.com> On Fri, 24 Oct 2025 12:25:36 GMT, Andrew Haley wrote: > > I agree. Its not pretty, but consistent with what we did elsewhere. Nobody wants to do that discussion again. > > Sorry, I was unaware of any previous discussion. I was suggesting a less impactful way to make the change, taking advantage of the recent adoption of C++17, which allows for cleaner code. But I won't stand in the way of consensus. FWIW, I'd be interested in seeing a small example of what that would look like with C++17. There were a lot of discussion about the style, but it wasn't because we wanted to figure out the color of the bike shed but rather how to write safer code that makes it less likely to accidentally introduce bugs because of type conflation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3450057392 From aph at openjdk.org Mon Oct 27 09:20:10 2025 From: aph at openjdk.org (Andrew Haley) Date: Mon, 27 Oct 2025 09:20:10 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <9uVKpiWCXvxcxhyg6V1seeSxyLm14lHEdOL_I07uVQs=.de1b0ed8-d006-49d5-a982-27556759415e@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> <9uVKpiWCXvxcxhyg6V1seeSxyLm14lHEdOL_I07uVQs=.de1b0ed8-d006-49d5-a982-27556759415e@github.com> Message-ID: On Mon, 27 Oct 2025 08:33:22 GMT, Stefan Karlsson wrote: > it wasn't because we wanted to figure out the color of the bike shed but rather how to write safer code that makes it less likely to accidentally introduce bugs because of type conflation. This. A function that returns its value as a side effect on a reference parameter is (at best) a code smell. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27743#issuecomment-3450229373 From rcastanedalo at openjdk.org Mon Oct 27 09:20:18 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Mon, 27 Oct 2025 09:20:18 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 06:35:27 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8347463 > - Merge branch 'JDK-8347463' of github.com:anton-seoane/jdk into JDK-8347463 > - Merge branch 'openjdk:master' into JDK-8347463 > - Documentation for future similar cases > - Test for JDK-8347463 > - Change to a more specific type > - Runtime call had void type but actually returned an object Thanks for getting to the bottom of this, Ant?n! The changeset looks good to me, modulo a few documentation and test comments. It would be good if someone from the JFR team (@mgronlun or @egahlin?) could have a look at this change as well. src/hotspot/share/opto/runtime.hpp line 55: > 53: // signature. Even if you don't plan on consuming the output of the call, C2 > 54: // needs this information to correctly track returned oops and avoid strange > 55: // deoptimization crashes (JDK-8347463). I agree with the intent of this comment, but the "strange deoptimization crashes" part could be made a bit more precise. Also, the first sentence is grammatically incorrect. Here is my suggestion: Suggestion: // // Please ensure the return type of the runtime call matches its signature, // even if the return value is unused. This is crucial for correct handling // of runtime calls that return an oop and may trigger deoptimization // on return. See rematerialize_objects() in deoptimization.cpp. test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 29: > 27: > 28: import jdk.jfr.Event; > 29: import jdk.jfr.Name; Unused, please remove. test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 34: > 32: /** > 33: * @test > 34: * @summary Tests that the getEventWriter call to write_checkpoint correctly Suggestion: * @summary Tests that the getEventWriter call to write_checkpoint correctly * @bug 8347463 test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 36: > 34: * @summary Tests that the getEventWriter call to write_checkpoint correctly > 35: * reports returning an oop > 36: * @requires vm.hasJFR & vm.continuations Do we need `vm.continuations`? test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 38: > 36: * @requires vm.hasJFR & vm.continuations > 37: * @library /test/lib / > 38: * @modules jdk.jfr/jdk.jfr.internal Do we need this? test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 53: > 51: // for the write_checkpoint call. Instead of explicitly checking for > 52: // it, we look for a non-void return type (which comes hand-in-hand > 53: // with the returns_oop information) No need to mention the bug number here, better to declare at the top using `@bug`: Suggestion: // Crash was due to the returns_oop field not being set // for the write_checkpoint call. Instead of explicitly checking for // it, we look for a non-void return type (which comes hand-in-hand // with the returns_oop information). test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 55: > 53: // with the returns_oop information) > 54: @Test > 55: @IR(failOn = { IRNode.STATIC_CALL_OF_METHOD, "write_checkpoint.*void"}) You could replace this check with a more precise, positive one: Suggestion: @IR(counts = { IRNode.STATIC_CALL_OF_METHOD, "write_checkpoint\s+java/lang/Object\s+\*", "1" }) test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 63: > 61: } > 62: > 63: } Please remove unnecessary whitespace. ------------- Changes requested by rcastanedalo (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3382397915 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464866520 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464871994 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464870520 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464894276 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464903315 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464906522 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464909980 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464907436 From aseoane at openjdk.org Mon Oct 27 09:27:58 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:27:58 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v3] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Update src/hotspot/share/opto/runtime.hpp Co-authored-by: Roberto Casta?eda Lozano ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/c85142ef..51fb388b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=01-02 Stats: 5 lines in 1 file changed: 1 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From aseoane at openjdk.org Mon Oct 27 09:35:07 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:35:07 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 09:01:08 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Merge branch 'JDK-8347463' of github.com:anton-seoane/jdk into JDK-8347463 >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Documentation for future similar cases >> - Test for JDK-8347463 >> - Change to a more specific type >> - Runtime call had void type but actually returned an object > > test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 29: > >> 27: >> 28: import jdk.jfr.Event; >> 29: import jdk.jfr.Name; > > Unused, please remove. I think you mean just line 29? AFAIK we need the header and importing the basics for testing (line 29 is unused, yes) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464973697 From aseoane at openjdk.org Mon Oct 27 09:41:24 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:41:24 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v4] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Update test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java Co-authored-by: Roberto Casta?eda Lozano ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/51fb388b..e91cd483 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=02-03 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From rcastanedalo at openjdk.org Mon Oct 27 09:41:27 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Mon, 27 Oct 2025 09:41:27 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 09:32:31 GMT, Anton Seoane Ampudia wrote: >> test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 29: >> >>> 27: >>> 28: import jdk.jfr.Event; >>> 29: import jdk.jfr.Name; >> >> Unused, please remove. > > I think you mean just line 29? AFAIK we need the header and importing the basics for testing (line 29 is unused, yes) Right, just line 29. >> test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 38: >> >>> 36: * @requires vm.hasJFR & vm.continuations >>> 37: * @library /test/lib / >>> 38: * @modules jdk.jfr/jdk.jfr.internal >> >> Do we need this? > > We don't. Removed as well! (Referring to line 38 only). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464990761 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464991906 From aseoane at openjdk.org Mon Oct 27 09:41:30 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:41:30 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 09:07:49 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Merge branch 'JDK-8347463' of github.com:anton-seoane/jdk into JDK-8347463 >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Documentation for future similar cases >> - Test for JDK-8347463 >> - Change to a more specific type >> - Runtime call had void type but actually returned an object > > test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 36: > >> 34: * @summary Tests that the getEventWriter call to write_checkpoint correctly >> 35: * reports returning an oop >> 36: * @requires vm.hasJFR & vm.continuations > > Do we need `vm.continuations`? We don't. Removed the requirement > test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 38: > >> 36: * @requires vm.hasJFR & vm.continuations >> 37: * @library /test/lib / >> 38: * @modules jdk.jfr/jdk.jfr.internal > > Do we need this? We don't. Removed as well! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464983164 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2464989996 From aseoane at openjdk.org Mon Oct 27 09:53:16 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:53:16 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v5] In-Reply-To: References: Message-ID: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Apply review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/e91cd483..9191c3b3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=03-04 Stats: 8 lines in 1 file changed: 1 ins; 5 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From aseoane at openjdk.org Mon Oct 27 09:53:19 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 09:53:19 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v2] In-Reply-To: References: Message-ID: <_P2PY-zh8RX87bQtxQuZ-54vzcwK4uvdm15dauAwo7w=.7c17f75d-b8ae-463b-95b2-58e3ba8c8444@github.com> On Mon, 27 Oct 2025 09:17:29 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Merge branch 'JDK-8347463' of github.com:anton-seoane/jdk into JDK-8347463 >> - Merge branch 'openjdk:master' into JDK-8347463 >> - Documentation for future similar cases >> - Test for JDK-8347463 >> - Change to a more specific type >> - Runtime call had void type but actually returned an object > > Thanks for getting to the bottom of this, Ant?n! The changeset looks good to me, modulo a few documentation and test comments. > It would be good if someone from the JFR team (@mgronlun or @egahlin?) could have a look at this change as well. Thanks for your review @robcasloz! I have updated the changeset according to your comments ------------- PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3450399965 From mgronlun at openjdk.org Mon Oct 27 10:25:26 2025 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Mon, 27 Oct 2025 10:25:26 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v5] In-Reply-To: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> References: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> Message-ID: On Mon, 27 Oct 2025 09:53:16 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments Marked as reviewed by mgronlun (Reviewer). Thanks for getting to the cause and fixing this. ------------- PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3382775048 PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3450540758 From aseoane at openjdk.org Mon Oct 27 10:40:32 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 10:40:32 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v6] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Update test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java Co-authored-by: Roberto Casta?eda Lozano ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/9191c3b3..280141be Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=04-05 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From rcastanedalo at openjdk.org Mon Oct 27 10:40:35 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Mon, 27 Oct 2025 10:40:35 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v5] In-Reply-To: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> References: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> Message-ID: On Mon, 27 Oct 2025 09:53:16 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments Thanks for addressing my comments, just have two last suggestions, looks good otherwise! test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 51: > 49: // Crash was due to the returns_oop field not being set > 50: // for the write_checkpoint call. Instead of explicitly checking for > 51: // it, we look for a non-void return type (which comes hand-in-hand Suggestion: // it, we look for an oop return type (which comes hand-in-hand test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 55: > 53: @Test > 54: @IR(counts = { IRNode.STATIC_CALL_OF_METHOD, "write_checkpoint\s+java/lang/Object\s+\\*", "1" }) > 55: public void myTest() { Maybe use a more descriptive name than `myTest`, for example summarizing the effect of the test (`testStartRecordingAndEmitEvent`) or its intent (`testWriteCheckpointReturnType`). ------------- Changes requested by rcastanedalo (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3382802589 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2465156043 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2465162595 From aseoane at openjdk.org Mon Oct 27 10:49:50 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 10:49:50 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v7] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Change test method name ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/280141be..922d03f1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=05-06 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From rcastanedalo at openjdk.org Mon Oct 27 10:49:51 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Mon, 27 Oct 2025 10:49:51 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v7] In-Reply-To: References: Message-ID: <_Atow0xqKu5DW3kdJms5ZzPuCpQnUquCQwq9A2CWe5I=.7e2af709-d864-4b19-a16b-59b373ab9954@github.com> On Mon, 27 Oct 2025 10:46:46 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Change test method name Thanks! Please test the latest changes, at least through some low tiers, before integration. ------------- Marked as reviewed by rcastanedalo (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3382860198 From aseoane at openjdk.org Mon Oct 27 10:49:53 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 10:49:53 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v5] In-Reply-To: References: <3Dnm4je4PJq-qCbRaaxg7slgI7i3Iz5Tn19_jnYk7I0=.18015b63-6ad6-46e5-ae52-808f94140839@github.com> Message-ID: On Mon, 27 Oct 2025 10:32:34 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: >> >> Apply review comments > > test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 55: > >> 53: @Test >> 54: @IR(counts = { IRNode.STATIC_CALL_OF_METHOD, "write_checkpoint\s+java/lang/Object\s+\\*", "1" }) >> 55: public void myTest() { > > Maybe use a more descriptive name than `myTest`, for example summarizing the effect of the test (`testStartRecordingAndEmitEvent`) or its intent (`testWriteCheckpointReturnType`). For sure. I don't know how I forgot to change such a placeholder name... I have gone for the latter suggestion ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2465189899 From jbechberger at openjdk.org Mon Oct 27 11:16:47 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Mon, 27 Oct 2025 11:16:47 GMT Subject: RFR: 8370681: [BACKOUT] Improve memory ordering in new CPU Time Profiler Message-ID: Clean backout. ------------- Commit messages: - Backout change Changes: https://git.openjdk.org/jdk/pull/27998/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27998&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370681 Stats: 41 lines in 2 files changed: 12 ins; 12 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/27998.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27998/head:pull/27998 PR: https://git.openjdk.org/jdk/pull/27998 From mdoerr at openjdk.org Mon Oct 27 11:16:48 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 27 Oct 2025 11:16:48 GMT Subject: RFR: 8370681: [BACKOUT] Improve memory ordering in new CPU Time Profiler In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 10:59:59 GMT, Johannes Bechberger wrote: > Clean backout. Backout looks correct. ------------- Marked as reviewed by mdoerr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27998#pullrequestreview-3382958699 From jbechberger at openjdk.org Mon Oct 27 12:32:40 2025 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Mon, 27 Oct 2025 12:32:40 GMT Subject: Integrated: 8370681: [BACKOUT] Improve memory ordering in new CPU Time Profiler In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 10:59:59 GMT, Johannes Bechberger wrote: > Clean backout. This pull request has now been integrated. Changeset: 5ed6c201 Author: Johannes Bechberger URL: https://git.openjdk.org/jdk/commit/5ed6c201ba0a9dc78960f2f3a5afce268e84a82d Stats: 41 lines in 2 files changed: 12 ins; 12 del; 17 mod 8370681: [BACKOUT] Improve memory ordering in new CPU Time Profiler Reviewed-by: mdoerr ------------- PR: https://git.openjdk.org/jdk/pull/27998 From aseoane at openjdk.org Mon Oct 27 12:42:30 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 12:42:30 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v8] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Revert to failOn check as getEventWriter is not always inlined ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/922d03f1..9ff84e73 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=06-07 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From aseoane at openjdk.org Mon Oct 27 13:03:54 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 13:03:54 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v9] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Adjust comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/9ff84e73..aa09c1bb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From rcastanedalo at openjdk.org Mon Oct 27 14:32:52 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Mon, 27 Oct 2025 14:32:52 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v9] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 13:03:54 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Adjust comment Marked as reviewed by rcastanedalo (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3383819530 From aseoane at openjdk.org Mon Oct 27 15:36:22 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 15:36:22 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v9] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 14:29:43 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: >> >> Adjust comment > > Marked as reviewed by rcastanedalo (Reviewer). Reverted the more precise IR Framework check that @robcasloz suggested as the method where the actual call to `write_checkpoint` happened was not always being inlined, resulting in a failure. I am back to the original check for a non-void return type. Quick check shows no issues (ran tiers 1-3) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3451927579 From fitzsim at openjdk.org Mon Oct 27 19:58:09 2025 From: fitzsim at openjdk.org (Thomas Fitzsimmons) Date: Mon, 27 Oct 2025 19:58:09 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 09:45:25 GMT, Severin Gehwolf wrote: >> Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. >> >> It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. >> >> All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. >> >> All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. >> >> While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. >> >> Testing (looking good): >> - [x] GHA >> - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. >> - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. >> >> Thoughts? Opinions? > > Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jdk-8365606-jlong-julong-refactor > - Fix print_container_info output > - whitespace clean-ups and other small fixes > - Fix log format in container macro and scanf format > - Fix duplicate include in osContainer_linux > - 8365606: Container code should not be using jlong/julong _I am not a reviewer._ This looks good to me, overall. I commented with some items to consider. src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 627: > 625: * > 626: * If quotas have not been specified, return the > 627: * number of active processors in the system. This paragraph uses the "return" language that you adjusted in the next paragraph. It should probably also refer to the reference argument instead. src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 629: > 627: * number of active processors in the system. > 628: * > 629: * If quotas have been specified, the resulting number Tiny nit, but "the resulting number" => "the number", since you say "the result reference" on the next line. src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 653: > 651: cpu_count = os::Linux::active_processor_count(); > 652: if (!CgroupUtil::processor_count(contrl->controller(), cpu_count, result)) { > 653: return false; `value` will be returned unchanged from its passed-in value here. I wonder if it would be safer to explicitly set it to `0` when returning `false`. Also, could `value` be given an unsigned type, like `uint64_t`? src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 667: > 665: * Return the limit of available memory for this process in the provided > 666: * physical_memory_size_type reference. If there was no limit value set in the underlying > 667: * interface files value_unlimited is returned. I think quote `value_unlimited` here to hint that it is a constant defined elsewhere. Can the limit ever be `0`, and if not, should there be a new assert for `> 0` like for `cpu_count`? src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 167: > 165: /* memory_and_swap_limit_in_bytes > 166: * > 167: * Determine the memory and swap limit metric. Returns a positive limit value or "Returns" language should probably be updated here too. src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 470: > 468: // cast to int since the read value might be negative > 469: // and we want to avoid logging -1 as a large unsigned value. > 470: int quota_int = static_cast(quota); It seems like quota is either a positive number or disabled. I wonder if `result` can be treated as a `uint64_t`, and this log message special-cased to detect `-1` read from `/cpu.cfs_quota_us` as disabled. I guess the calling code would need another way to differentiate "disabled" from other values... maybe with `0`? Just a thought to maybe simplify the type logic here. Likewise for `period` and `shares`. ------------- Marked as reviewed by fitzsim (Author). PR Review: https://git.openjdk.org/jdk/pull/27743#pullrequestreview-3383739312 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465851974 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465858316 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465872342 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465907552 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2466836781 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2466892281 From dlong at openjdk.org Mon Oct 27 20:54:08 2025 From: dlong at openjdk.org (Dean Long) Date: Mon, 27 Oct 2025 20:54:08 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v9] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 13:03:54 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Adjust comment src/hotspot/share/opto/runtime.hpp line 55: > 53: // even if the return value is unused. This is crucial for correct handling > 54: // of runtime calls that return an oop and may trigger deoptimization > 55: // on return. See rematerialize_objects() in deoptimization.cpp. I was wondering why this is only a problem for deoptimization, and not regular safepoints that trigger a GC. But the comment in rematerialize_objects() explains that the return value is not part of the GC oopmap. test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 49: > 47: } > 48: > 49: // Crash was due to the returns_oop field not being set I was confused when I could not find "returns_oop". It turns out the names are CallNode::returns_pointer() and ScopeDesc::return_oop(). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2467041649 PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2467037934 From duke at openjdk.org Mon Oct 27 21:05:37 2025 From: duke at openjdk.org (duke) Date: Mon, 27 Oct 2025 21:05:37 GMT Subject: Withdrawn: 8365066: RecordingStream and RemoteRecordingStream do not terminate when the associated Recording is stopped or closed externally In-Reply-To: References: Message-ID: On Sat, 9 Aug 2025 01:33:29 GMT, Chihiro Ito wrote: > Fix an issue where RecordingStream and RemoteRecordingStream do not stop when their underlying the local/remote recording stop. > > Introduce an internal EventSource abstraction to unify control across local (PlatformRecording) and remote (FlightRecorderMXBean) recordings, ensuring consistent propagation of stop/close and stop time to the consumer streams. > > Tests updated to validate lifecycle consistency: > Verifies that stopping/closing the underlying recording (local and remote) properly stops/closes the corresponding stream. > > Test: jdk/jdk/jfr This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/26710 From syan at openjdk.org Tue Oct 28 03:01:02 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 28 Oct 2025 03:01:02 GMT Subject: RFR: 8370260: Test jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java timed out In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 00:51:06 GMT, Yasumasa Suenaga wrote: > The test failure was reported at jdk/jfr/event/oldobject/TestEmergencyDumpAtOOM.java due to minidump timeout. > `TestEmergencyDumpAtOOM` does not need minidump, so we can add `-XX:-CreateCoredumpOnCrash` to the test process. > > This change works on Windows 11 Pro 25H2 and Fedora 42. Marked as reviewed by syan (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27993#pullrequestreview-3386374399 From aseoane at openjdk.org Tue Oct 28 08:51:06 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 08:51:06 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v9] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 20:49:40 GMT, Dean Long wrote: >> Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: >> >> Adjust comment > > test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java line 49: > >> 47: } >> 48: >> 49: // Crash was due to the returns_oop field not being set > > I was confused when I could not find "returns_oop". It turns out the names are CallNode::returns_pointer() and ScopeDesc::return_oop(). Oh, I got them mixed up. I will update things accordingly, thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2468526424 From aseoane at openjdk.org Tue Oct 28 09:19:53 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 09:19:53 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v10] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Rename test and update comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/aa09c1bb..1f922569 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=08-09 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From aseoane at openjdk.org Tue Oct 28 09:39:05 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 09:39:05 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v11] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Rename class ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/1f922569..80f572a2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=09-10 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From cnorrbin at openjdk.org Tue Oct 28 09:41:46 2025 From: cnorrbin at openjdk.org (Casper Norrbin) Date: Tue, 28 Oct 2025 09:41:46 GMT Subject: RFR: 8365606: Container code should not be using jlong/julong [v2] In-Reply-To: <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> References: <-8aFRr9Hv0gxOufHCTreBgrkFSatpHjQytEVDQ-v8mY=.7ab7d7b7-09a0-4ae4-b084-e8bf285491bb@github.com> <0IQ106BTnoNfWulWJ30t9uWy5OH2EF4Y0kC_jZlgU6g=.84583e9b-1d06-440c-8c34-670ebfc7940f@github.com> Message-ID: On Fri, 24 Oct 2025 09:45:25 GMT, Severin Gehwolf wrote: >> Please review this revised version of getting rid of `jlong` and `julong` in internal HotSpot code. The single remaining usage is using `os::elapsed_counter()` which I think is still ok. This refactoring is for the container detection code to (mostly) do away with negative return values. >> >> It gets rid of the trifold-use of return value: 1.) error, 2) unlimited values 3) actual numbers/values/limits. Instead, all container related values are now being read from the interface files as `uint64_t` and afterwards interpreted in the way that make sense for the API implementations. For example, `cpu` values will essentially be treated as `int`s as before, potentially returning a negative value `-1` for unlimited. For memory sizes the type `physical_memory_size_type` has been chosen. When there is no limit for a specific memory size a value `value_unlimited` is being returned. >> >> All error cases have been changed to returning `false` in the API functions (and no value is being set in the passed in reference for the value). The effect of this is that all container related functions now return a `bool` and require a reference to be passed in for the `value` that is being asked for. >> >> All usages of the API have been changed to use the revised API. There is no more usages for `OSCONTAINER_ERROR` (`-2) in HotSpot code. >> >> While working on this, I've noticed that there are still some calls deep in the cgroup subsystem code to query "machine" info (e.g. `os::Linux::active_processor_count()`). I've filed [JDK-8369503](https://bugs.openjdk.org/browse/JDK-8369503) to get this cleaned-up as this patch was already getting large. >> >> Testing (looking good): >> - [x] GHA >> - [x] All container tests (including problem listed ones) on Linux x86_64 with cg v1 and cg v2. See [this comment](https://github.com/openjdk/jdk/pull/27743#issuecomment-3390060127) below. >> - [x] Some ad-hoc manual testing in containers using JFR (`jdk.SwapSpace` event) and `VM.info` diagnostic command. >> >> Thoughts? Opinions? > > Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'master' into jdk-8365606-jlong-julong-refactor > - Fix print_container_info output > - whitespace clean-ups and other small fixes > - Fix log format in container macro and scanf format > - Fix duplicate include in osContainer_linux > - 8365606: Container code should not be using jlong/julong Thanks for taking this on! I think this is a solid improvement, and it's great to finally see the Java types phased out. I had a few thoughts/comments, mostly around the os-level code and the logging of constants, since those constants don't really have much meaning anymore. Otherwise great work! src/hotspot/os/linux/cgroupSubsystem_linux.hpp line 90: > 88: if (!is_ok) { \ > 89: log_trace(os, container)(log_string " failed: -2"); \ > 90: return false; \ Do we need to keep the `-2` here? Or could we perhaps change to a better message? src/hotspot/os/linux/cgroupSubsystem_linux.hpp line 93: > 91: } \ > 92: if (retval == value_unlimited) { \ > 93: log_trace(os, container)(log_string " is: -1"); \ Same here, could perhaps do `log_trace(os, container)(log_string " is: unlimited")`instead. src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 465: > 463: // negative value as a large unsiged int > 464: if (!reader()->read_number("/cpu.cfs_quota_us", quota)) { > 465: log_trace(os, container)("CPU Quota failed: -2"); Do we need to keep the `-2` here? Or could we perhaps change to a better message? src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 61: > 59: * true if the result reference got updated > 60: * false if there was an error > 61: */ We set result to `-1` and return true on a no share setup here, but return `false` and don't on cgroup v1. The comment is contradicting. src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 115: > 113: * true if the result reference has been set > 114: * false on error > 115: */ The beginning part of the comment isn't updated to mention the `result` reference, unlike the other comments. src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 178: > 176: bool is_ok = reader()->read_numerical_key_value("/cpu.stat", "usage_usec", value); > 177: if (!is_ok) { > 178: log_trace(os, container)("CPU Usage failed: -2"); Do we need to keep the `-2` here? Or could we perhaps change to a better message? src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 237: > 235: if (!reader()->read_number_handle_max("/memory.swap.max", swap_limit_val)) { > 236: // Some container tests rely on this trace logging to happen. > 237: log_trace(os, container)("Swap Limit failed: -2"); Do we need to keep the `-2` here? Or could we perhaps change to a better message? src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 379: > 377: * Calculate the maximum number of tasks available to the process. Set the > 378: * value in the passed in 'value' reference. The value might be -1 when > 379: * there is no limit. How can we get `-1`? Or do you mean `(uint64_t)-1`? src/hotspot/os/linux/os_linux.cpp line 220: > 218: if (OSContainer::is_containerized() && OSContainer::available_memory_in_bytes(avail_mem)) { > 219: log_trace(os)("available container memory: " PHYS_MEM_TYPE_FORMAT, avail_mem); > 220: value = avail_mem; Should be able to pass in `value` directly instead of using `avail_mem`. src/hotspot/os/linux/os_linux.cpp line 261: > 259: if (OSContainer::is_containerized() && OSContainer::available_memory_in_bytes(free_mem)) { > 260: log_trace(os)("free container memory: " PHYS_MEM_TYPE_FORMAT, free_mem); > 261: value = free_mem; Should be able to pass in `value` directly instead of using `free_mem`. src/hotspot/os/linux/os_linux.cpp line 348: > 346: return true; > 347: } > 348: } This whole function is getting a bit too long in my opinion. Maybe everything inside the `if OSContainer::is_containerized() {}` could be moved into a new function `OSContainer::available_swap_in_bytes`, similar to the already existing `OSContainer::available_memory_in_bytes`. That way, we could abstract away all the `OSContainer` calls. The only consequence would be that the `log_trace` wouldn't work any more. I couldn't find any test that depends on the exact output, so it could perhaps be split up instead. src/hotspot/os/linux/os_linux.cpp line 4863: > 4861: if (OSContainer::is_containerized() && OSContainer::active_processor_count(active_cpus)) { > 4862: log_trace(os)("active_processor_count: determined by OSContainer: %d", > 4863: active_cpus); When running containerized, we would now always fetch the os cpu count at least once. `CgroupSubsystem::active_processor_count`, which this calls down to has the cache to actively avoid getting the cpu count too frequently, and only gets the number of cpus with `os::Linux::active_processor_count` when the cache expires. I don't know if this is still an issue today, but since it's there I still think we should avoid getting the cpus if unnecessary. src/hotspot/share/runtime/os.cpp line 2215: > 2213: } > 2214: value = mem_usage; > 2215: return true; Can we collapse this and just set the `value` reference directly instead in the container functions? Something like: ```c++ if (OSContainer::is_containerized()) { return OSContainer::memory_usage_in_bytes(mem_usage); } ------------- PR Review: https://git.openjdk.org/jdk/pull/27743#pullrequestreview-3365531156 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2460075401 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2460081327 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2468689176 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465321137 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465329926 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465347559 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465361453 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2465754752 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2452045546 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2452052597 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2452159278 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2452239511 PR Review Comment: https://git.openjdk.org/jdk/pull/27743#discussion_r2451900698 From aseoane at openjdk.org Tue Oct 28 09:50:51 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 09:50:51 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v11] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 09:43:30 GMT, Roberto Casta?eda Lozano wrote: >> Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: >> >> Rename class > > test/hotspot/jtreg/compiler/intrinsics/TestReturnOopSetForJFRWriteCheckpoint.java line 38: > >> 36: * @requires vm.hasJFR >> 37: * @library /test/lib / >> 38: * @run driver compiler.intrinsics.TestReturnsOopSetForJFRWriteCheckpoint > > You will have to update this line as well after the class name change. Oh, right. My bad. Fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2468774982 From aseoane at openjdk.org Tue Oct 28 09:50:47 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 09:50:47 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v12] In-Reply-To: References: Message-ID: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Final renaming touches ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27913/files - new: https://git.openjdk.org/jdk/pull/27913/files/80f572a2..72202ad6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27913&range=10-11 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27913.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913 PR: https://git.openjdk.org/jdk/pull/27913 From rcastanedalo at openjdk.org Tue Oct 28 09:50:50 2025 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Tue, 28 Oct 2025 09:50:50 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v11] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 09:39:05 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Rename class test/hotspot/jtreg/compiler/intrinsics/TestReturnOopSetForJFRWriteCheckpoint.java line 38: > 36: * @requires vm.hasJFR > 37: * @library /test/lib / > 38: * @run driver compiler.intrinsics.TestReturnsOopSetForJFRWriteCheckpoint You will have to update this line as well after the class name change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27913#discussion_r2468766731 From egahlin at openjdk.org Tue Oct 28 22:39:43 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 28 Oct 2025 22:39:43 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 10:09:58 GMT, Francesco Andreuzzi wrote: > In this PR I introduce two new JFR events: > - `jdk.StringDeduplicationStatistics` > - `jdk.StringDeduplicationTimes` > > The events are emitted every time a deduplication cycle happens, and they contain information about that cycle only. > > Passes tier1 and tier2 (fastdebug). Why do you need two events instead of one? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3458838597 From fandreuzzi at openjdk.org Tue Oct 28 22:48:31 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Tue, 28 Oct 2025 22:48:31 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 22:37:31 GMT, Erik Gahlin wrote: > Why do you need two events instead of one? I don't, I created two events just to separate information in two uniform containers. Potentially, users may want to enable just one of them. But that's the only motivation, the two events are emitted at the same time so there's no technical problem in merging them. Would that be more appropriate? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3458857564 From egahlin at openjdk.org Tue Oct 28 23:39:02 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 28 Oct 2025 23:39:02 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 22:45:42 GMT, Francesco Andreuzzi wrote: > I don't, I created two events just to separate information in two uniform containers. Potentially, users may want to enable just one of them. Roughly how many events can we expect per second? One, one hundred or ten thousand? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3458985960 From fandreuzzi at openjdk.org Tue Oct 28 23:57:02 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Tue, 28 Oct 2025 23:57:02 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 23:36:23 GMT, Erik Gahlin wrote: > > I don't, I created two events just to separate information in two uniform containers. Potentially, users may want to enable just one of them. > > Roughly how many events can we expect per second? One, one hundred or ten thousand? It depends on the allocation pattern, but in principle string deduplication is triggered at the end of a young GC. So the number of events per second should be roughly the same order of magnitude. There's a ticket about repeated consecutive deduplication rounds which are not related to a completed GC cycle: [JDK-8315238](https://bugs.openjdk.org/browse/JDK-8315238) I guess the event in this PR will suffer from the same potential behavior, but the numbers do not seem particularly concerning to me. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3459044169 From dlong at openjdk.org Wed Oct 29 01:22:05 2025 From: dlong at openjdk.org (Dean Long) Date: Wed, 29 Oct 2025 01:22:05 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v12] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 09:50:47 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Final renaming touches Marked as reviewed by dlong (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27913#pullrequestreview-3391390772 From aseoane at openjdk.org Wed Oct 29 09:13:42 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Wed, 29 Oct 2025 09:13:42 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v12] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 09:50:47 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Final renaming touches Thanks to all for the reviews and suggestions! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3460487776 From duke at openjdk.org Wed Oct 29 09:13:43 2025 From: duke at openjdk.org (duke) Date: Wed, 29 Oct 2025 09:13:43 GMT Subject: RFR: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) [v12] In-Reply-To: References: Message-ID: <5qPYze8djM2BRQeWv29Wq1n9T5CRs-fCQvpuI0lZUBI=.04fe36fd-0ecd-4bd6-af64-04992a23053b@github.com> On Tue, 28 Oct 2025 09:50:47 GMT, Anton Seoane Ampudia wrote: >> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. >> >> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. >> >> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. >> >> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. >> >> **Testing:** passes tiers 1-5 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Final renaming touches @anton-seoane Your change (at version 72202ad633c0e8b54b6df6f688f92b39bd7f780f) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27913#issuecomment-3460497759 From aseoane at openjdk.org Wed Oct 29 09:40:20 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Wed, 29 Oct 2025 09:40:20 GMT Subject: Integrated: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) In-Reply-To: References: Message-ID: <5ST5jacnFXvYNEnb-LpeXBsjEO0-DGF8JiXFYFBHlnk=.c32a7ef3-4d25-4e98-af83-8c67c72f87d7@github.com> On Tue, 21 Oct 2025 09:19:22 GMT, Anton Seoane Ampudia wrote: > This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing. > > The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop. > > However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash. > > An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future. > > **Testing:** passes tiers 1-5 This pull request has now been integrated. Changeset: 8457f38f Author: Anton Seoane Ampudia Committer: Roberto Casta?eda Lozano URL: https://git.openjdk.org/jdk/commit/8457f38f14182e2a55ff5d243cdacb06c9003c49 Stats: 76 lines in 3 files changed: 74 ins; 0 del; 2 mod 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) Reviewed-by: dlong, rcastanedalo, mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27913 From egahlin at openjdk.org Wed Oct 29 13:00:34 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 29 Oct 2025 13:00:34 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 23:54:20 GMT, Francesco Andreuzzi wrote: > It depends on the allocation pattern, but in principle string deduplication is triggered at the end of a young GC. So the number of events per second should be roughly the same order of magnitude. > > There's a ticket about repeated consecutive deduplication rounds which are not related to a completed GC cycle: [JDK-8315238](https://bugs.openjdk.org/browse/JDK-8315238) I guess the events in this PR may suffer from the same potential behavior, but the numbers do not seem particularly concerning to me. I think one event is sufficient. It?s easier to configure, easier to program against and will have less overhead. We want events to be enabled by default, and they must work even in pathological cases, such as an application calling String::intern() in a loop. If you believe we can get 10 000 events per minute in such cases, it might be better to fix JDK-8315238 first, or disable the event and enable it only in profile.jfc, then re-enable it in default.jfc once JDK-8315238 has been fixed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3461389248 From fandreuzzi at openjdk.org Wed Oct 29 23:24:01 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 29 Oct 2025 23:24:01 GMT Subject: RFR: 8037914: Add JFR event for string deduplication [v2] In-Reply-To: References: Message-ID: > In this PR I introduce two new JFR events: > - `jdk.StringDeduplicationStatistics` > - `jdk.StringDeduplicationTimes` > > The events are emitted every time a deduplication cycle happens, and they contain information about that cycle only. > > Passes tier1 and tier2 (fastdebug). Francesco Andreuzzi has updated the pull request incrementally with one additional commit since the last revision: one event ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28015/files - new: https://git.openjdk.org/jdk/pull/28015/files/1cb7d996..bff0fd30 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28015&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28015&range=00-01 Stats: 61 lines in 8 files changed: 8 ins; 52 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28015.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28015/head:pull/28015 PR: https://git.openjdk.org/jdk/pull/28015 From fandreuzzi at openjdk.org Wed Oct 29 23:31:25 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 29 Oct 2025 23:31:25 GMT Subject: RFR: 8037914: Add JFR event for string deduplication [v3] In-Reply-To: References: Message-ID: > In this PR I introduce two new JFR events: > - `jdk.StringDeduplicationStatistics` > - `jdk.StringDeduplicationTimes` > > The events are emitted every time a deduplication cycle happens, and they contain information about that cycle only. > > Passes tier1 and tier2 (fastdebug). Francesco Andreuzzi has updated the pull request incrementally with two additional commits since the last revision: - disable - revert ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28015/files - new: https://git.openjdk.org/jdk/pull/28015/files/bff0fd30..c3c9a8db Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28015&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28015&range=01-02 Stats: 3 lines in 2 files changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28015.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28015/head:pull/28015 PR: https://git.openjdk.org/jdk/pull/28015 From fandreuzzi at openjdk.org Wed Oct 29 23:37:02 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 29 Oct 2025 23:37:02 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 12:57:43 GMT, Erik Gahlin wrote: > I think one event is sufficient. It?s easier to configure, easier to program against and will have less overhead. Sounds good, I made the change in the latest commits. > We want events to be enabled by default, and they must work even in pathological cases, such as an application calling String::intern() in a loop. If you believe we can get 10 000 events per minute in such cases, it might be better to fix JDK-8315238 first, or disable the event and enable it only in profile.jfc, then re-enable it in default.jfc once JDK-8315238 has been fixed. Sure, I disabled the new event in `default.jfc`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3465092462 From egahlin at openjdk.org Thu Oct 30 06:06:03 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Thu, 30 Oct 2025 06:06:03 GMT Subject: RFR: 8037914: Add JFR event for string deduplication In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 23:34:40 GMT, Francesco Andreuzzi wrote: > Sure, I disabled the new event in `default.jfc`. Best would be to have it enabled, but if you believe we could get a very high number of events, it must be disabled or emitted at a lower frequency. Typically, statistical events are emitted as periodic events, so users can set the period, e.g. 10 s, but that would require synchronization, which could also create issues. > `false` The control parameter must be in sync with the element value. **gc-enabled-normal** is the default mode, which means it will be true. **gc-enabled-high**, **gc-enabled-detailed** and **gc-enabled-all** are false by default. It would be good if you could provide some ballpark figures on the number of events in a worst-case scenario, so we can determine what GC level is appropriate. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3466243974