From syan at openjdk.org Sat Nov 1 02:08:19 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 1 Nov 2025 02:08:19 GMT Subject: RFR: 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests [v9] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 03:04:48 GMT, SendaoYan wrote: >> Hi all, >> >> This PR use `WhiteBox.getWhiteBox().fullGC()` instead of 'ClassUnloader.eatMemory()' to provoking gc for several test/hotspot/jtreg/vmTestbase/nsk/jvmti tests, It is the fast and robust way to trigger Full GC without risks hitting OOME, and will make test run finish more quicker on machine with huge physical memory. >> >> Change has been verified locally, test-fix only, no risk. >> >> >> grep VmRSS /proc/`ps -ef | grep -w java | grep vmsqe.aod.AppId | awk '{print $2}'`/status > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > Add log.display("Provoking GC"); Thanks for the suggestions and reviews @https://github.com/lmesnik @https://github.com/plummercj @https://github.com/sspitsyn ------------- PR Comment: https://git.openjdk.org/jdk/pull/28011#issuecomment-3475438561 From syan at openjdk.org Sat Nov 1 02:08:20 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 1 Nov 2025 02:08:20 GMT Subject: Integrated: 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 06:22:14 GMT, SendaoYan wrote: > Hi all, > > This PR use `WhiteBox.getWhiteBox().fullGC()` instead of 'ClassUnloader.eatMemory()' to provoking gc for several test/hotspot/jtreg/vmTestbase/nsk/jvmti tests, It is the fast and robust way to trigger Full GC without risks hitting OOME, and will make test run finish more quicker on machine with huge physical memory. > > Change has been verified locally, test-fix only, no risk. > > > grep VmRSS /proc/`ps -ef | grep -w java | grep vmsqe.aod.AppId | awk '{print $2}'`/status This pull request has now been integrated. Changeset: 54fe5021 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/54fe50210efe9ae6fad225b815cfdeb16c868115 Stats: 299 lines in 27 files changed: 33 ins; 234 del; 32 mod 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests Reviewed-by: cjplummer, lmesnik, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28011 From ysuenaga at openjdk.org Sat Nov 1 02:36:22 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:36:22 GMT Subject: RFR: 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call [v3] In-Reply-To: References: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> Message-ID: On Thu, 30 Oct 2025 13:32:46 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` with coredump cannot resolve function symbol which has `.cold` attribute. >> >> >> ----------------- 120485 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f50e4710735 __GI_abort + 0x8b >> 0x00007f50e1e01f33 ???????? >> >> >> 0x7f50e1e01f33 was `os::abort(bool, void const*, void const*) [clone .cold]` and I could see it in GDB. However it has `.cold` suffix, it means the code has been relocated as ["cold" function](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-cold-function-attribute). In GDB, we can see the code in another area from function body as following: >> >> >> (gdb) disas 0x7f50e1e01f2e, 0x7f50e1e01f34 >> Dump of assembler code from 0x7f50e1e01f2e to 0x7f50e1e01f34: >> 0x00007f50e1e01f2e <_ZN2os5abortEbPKvS1_.cold+0>: call 0x7f50e1e01010 >> => 0x00007f50e1e01f33: nop >> End of assembler dump. >> >> >> libsaproc.so checks address range to resolve symbol whether the address is in between `start` and `start + size - 1`. As you can see in assembler dump, the code in `.cold` section is `call` instruction, thus IP points next `nop`, thus we should allow address range between `start` and `start + size`. >> >> After this PR, you can see the right symbol as following: >> >> >> ----------------- 120485 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f50e4710735 __GI_abort + 0x8b >> 0x00007f50e1e01f33 os::abort(bool, void const*, void const*) [clone .cold] + 0x5 > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Clarify comment about RIP-1 fallback handling Thank you both for reviewing! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27846#issuecomment-3475467698 From ysuenaga at openjdk.org Sat Nov 1 02:36:23 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:36:23 GMT Subject: Integrated: 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call In-Reply-To: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> References: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> Message-ID: <75W6AM4vr_GlY8SLlZ_f85u_lWbkpf2d5ZkB2zWHpgM=.cceb0531-a01f-4eca-b2b0-3a5a6513457b@github.com> On Thu, 16 Oct 2025 13:32:28 GMT, Yasumasa Suenaga wrote: > `jhsdb jstack --mixed` with coredump cannot resolve function symbol which has `.cold` attribute. > > > ----------------- 120485 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f50e4710735 __GI_abort + 0x8b > 0x00007f50e1e01f33 ???????? > > > 0x7f50e1e01f33 was `os::abort(bool, void const*, void const*) [clone .cold]` and I could see it in GDB. However it has `.cold` suffix, it means the code has been relocated as ["cold" function](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-cold-function-attribute). In GDB, we can see the code in another area from function body as following: > > > (gdb) disas 0x7f50e1e01f2e, 0x7f50e1e01f34 > Dump of assembler code from 0x7f50e1e01f2e to 0x7f50e1e01f34: > 0x00007f50e1e01f2e <_ZN2os5abortEbPKvS1_.cold+0>: call 0x7f50e1e01010 > => 0x00007f50e1e01f33: nop > End of assembler dump. > > > libsaproc.so checks address range to resolve symbol whether the address is in between `start` and `start + size - 1`. As you can see in assembler dump, the code in `.cold` section is `call` instruction, thus IP points next `nop`, thus we should allow address range between `start` and `start + size`. > > After this PR, you can see the right symbol as following: > > > ----------------- 120485 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f50e4710735 __GI_abort + 0x8b > 0x00007f50e1e01f33 os::abort(bool, void const*, void const*) [clone .cold] + 0x5 This pull request has now been integrated. Changeset: d2260236 Author: Yasumasa Suenaga URL: https://git.openjdk.org/jdk/commit/d226023643f90027a8980d161ec6d423887ae3ce Stats: 40 lines in 1 file changed: 26 ins; 4 del; 10 mod 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call Reviewed-by: kevinw, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/27846 From ysuenaga at openjdk.org Sat Nov 1 02:39:52 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:39:52 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v11] In-Reply-To: References: Message-ID: > `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. > > It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. > > > ----------------- 646689 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 > 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c > 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 > 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f1cf218789f JVM_SleepNanos + 0x28f > 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > > > `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. > > > ----------------- 646841 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 > 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c > 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 > 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f4a0918789f JVM_SleepNanos + 0x28f > 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) > 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) > 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) > 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) > * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) > 0x00007f49ef3385fd > 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce > 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 > 0x00007f4a08fc31bb JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 0xab > 0x00007f4a091... Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Improve comments in isValidFrame method ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27885/files - new: https://git.openjdk.org/jdk/pull/27885/files/3e0bfd09..ec5d0e2c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=09-10 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27885/head:pull/27885 PR: https://git.openjdk.org/jdk/pull/27885 From ysuenaga at openjdk.org Sat Nov 1 02:39:56 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:39:56 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v10] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 17:33:33 GMT, Kevin Walls wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Use stderrShouldBeEmptyIgnoreVMWarnings > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java line 97: > >> 95: >> 96: private boolean isValidFrame(Address nextCFA, boolean isNative) { >> 97: // CFA should not be null even if it is Java frame. > > This comment means a Java interpreter frame need not have a different CFA/frame pointer? > > "native" means we found DWARF. Non-native means Java interpreted or Java compiled. > Java frames just need a non-null CFA. > > // CFA should never be null. > // nextCFA must be greater than current CFA, if frame is native. > // Java interpreter frames can share the CFA (frame pointer). Exactly. I updated the comment. Thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27885#discussion_r2483054834 From ysuenaga at openjdk.org Sat Nov 1 03:20:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 03:20:49 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v11] In-Reply-To: References: Message-ID: On Sat, 1 Nov 2025 02:39:52 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. >> >> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. >> >> >> ----------------- 646689 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 >> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c >> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f1cf218789f JVM_SleepNanos + 0x28f >> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> >> >> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. >> >> >> ----------------- 646841 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 >> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c >> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f4a0918789f JVM_SleepNanos + 0x28f >> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) >> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) >> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) >> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) >> * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) >> 0x00007f49ef3385fd >> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce >> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 >> 0x00007f4a08fc31bb JavaCalls::call_virtu... > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Improve comments in isValidFrame method I resolved merge confliction, and it passed all of serviceability/sa tests on Linux AMD64. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27885#issuecomment-3475560622 From ysuenaga at openjdk.org Sat Nov 1 03:20:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 03:20:49 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v12] In-Reply-To: References: Message-ID: > `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. > > It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. > > > ----------------- 646689 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 > 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c > 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 > 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f1cf218789f JVM_SleepNanos + 0x28f > 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > > > `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. > > > ----------------- 646841 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 > 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c > 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 > 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f4a0918789f JVM_SleepNanos + 0x28f > 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) > 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) > 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) > 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) > * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) > 0x00007f49ef3385fd > 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce > 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 > 0x00007f4a08fc31bb JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 0xab > 0x00007f4a091... Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: - Merge branch 'master' into jhsdb-jstack-bp - Improve comments in isValidFrame method - Use stderrShouldBeEmptyIgnoreVMWarnings - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only - Respect RSP to parse DWARF - Revert testcase changes - Fix imports - Update testcase - Update testcase - Add glibc version check to TestJhsdbJstackMixedWithXComp.java - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0 ------------- Changes: https://git.openjdk.org/jdk/pull/27885/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=11 Stats: 248 lines in 6 files changed: 182 ins; 10 del; 56 mod Patch: https://git.openjdk.org/jdk/pull/27885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27885/head:pull/27885 PR: https://git.openjdk.org/jdk/pull/27885 From kbarrett at openjdk.org Sat Nov 1 07:34:03 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sat, 1 Nov 2025 07:34:03 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: <4Yh4KeUItjdDYihe9d1u66tBROofb0pRLDKIdhw-XZo=.cf383363-c963-4871-941d-5e358f74c048@github.com> References: <6u0Ia6A2xQnv51Ti0Jchg6rnncfRRvtK5oGS963CeIA=.bc9c1481-60ad-443d-923b-dc86277dbb14@github.com> <4Yh4KeUItjdDYihe9d1u66tBROofb0pRLDKIdhw-XZo=.cf383363-c963-4871-941d-5e358f74c048@github.com> Message-ID: On Mon, 27 Oct 2025 08:24:41 GMT, Florian Weimer wrote: >> We (you and me, @fweimer-rh) discussed this a couple of years ago: >> https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/082324.html >> >> Quoting from here: >> https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/083142.html >> >> " >> Empirically, a recursive initialization attempt doesn't make any attempt to >> throw. Rather, it blocks forever waiting for a futex signal from a thread that >> succeeds in the initialization. Which of course will never come. >> >> And that makes sense, now that I've looked at the code. >> >> In __cxa_guard_acquire, with _GLIBCXX_USE_FUTEX, if the guard indicates >> initialization hasn't yet been completed, then it goes into a while loop. >> This while loop tries to claim initialization. Failing that, it checks >> whether initialization is complete. Failing that, it does a SYS_futex >> syscall, waiting for some other thread to perform the initialization. There's >> nothing there to check for recursion. >> >> throw_recursive_init_exception is only called if single-threaded (either by >> configuration or at runtime). >> " >> >> It doesn't look like there have been any relevant changes in that area since >> then. So I think there is still not a problem here. > > @kimbarrett Sorry, I forgot about the old thread. You can get the exception in a single-threaded scenario, something like this: > > > struct S { > S() { > static S s; > *this = s; > } > } global; > > > Maybe the actual rule is more like this? > >> Functions that may throw exceptions must not be used, unless individual calls ensure that these particular invocations cannot throw exceptions. Recursively entering a block-scoped static is undefined behavior. That some configurations of glibc might throw an exception in that situation (even despite the caller being compiled with exceptions disabled) seems like a mistake in glibc, and not really our concern. Our code should avoid such a situation because it's UB, regardless of whether the actual behavior involves exceptions or nasal demons. The exception only gets thrown when the application is single-threaded. But at least the common way to start java (via the launcher) is already multi-threaded on entry to Threads::create_vm(). So that case doesn't normally apply to us anyway. Also, I really don't think we want people trying to figure out whether a particular call might or might not throw (neither when writing nor when reading code). So no, I don't think the proposed rule should be changed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2483178071 From aph at openjdk.org Sat Nov 1 09:02:11 2025 From: aph at openjdk.org (Andrew Haley) Date: Sat, 1 Nov 2025 09:02:11 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v9] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 28 Oct 2025 23:18:48 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: > > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a Marked as reviewed by aph (Reviewer). But I'm not going to push `SafeFetch` any further. I've said my piece. ------------- PR Review: https://git.openjdk.org/jdk/pull/26678#pullrequestreview-3407023975 PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3476011689 From aph at openjdk.org Sat Nov 1 09:05:08 2025 From: aph at openjdk.org (Andrew Haley) Date: Sat, 1 Nov 2025 09:05:08 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v9] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Thu, 30 Oct 2025 21:10:18 GMT, Dean Long wrote: > Re: SafeFetch, it is probably OK to make NativePostCallNop_at slightly slower for uses like make_deoptimized(), but the oopmap optimizations like CodeCache::find_blob_and_oopmap() were highly optimized to make loom/VirtualThread performance reasonable. Adding a SafeFetch here might cause a regression. Sure, but 2 things: Loom doesn't meed post-call NOPs as much as it used to. We could fairly easily make SafeFetch much faster than it is, if needs be. But anyway, I approved this patch. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3476017720 From kevinw at openjdk.org Sat Nov 1 09:59:03 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Sat, 1 Nov 2025 09:59:03 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v12] In-Reply-To: References: Message-ID: On Sat, 1 Nov 2025 03:20:49 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. >> >> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. >> >> >> ----------------- 646689 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 >> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c >> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f1cf218789f JVM_SleepNanos + 0x28f >> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> >> >> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. >> >> >> ----------------- 646841 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 >> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c >> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f4a0918789f JVM_SleepNanos + 0x28f >> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) >> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) >> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) >> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) >> * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) >> 0x00007f49ef3385fd >> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce >> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 >> 0x00007f4a08fc31bb JavaCalls::call_virtu... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: > > - Merge branch 'master' into jhsdb-jstack-bp > - Improve comments in isValidFrame method > - Use stderrShouldBeEmptyIgnoreVMWarnings > - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only > - Respect RSP to parse DWARF > - Revert testcase changes > - Fix imports > - Update testcase > - Update testcase > - Add glibc version check to TestJhsdbJstackMixedWithXComp.java > - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0 Thanks, spent quite a while going over this yesterday and think it's good. Yes was waiting for the conflict with 8369994, that looks like it merged in OK. 8-) ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27885#pullrequestreview-3407206806 From kvn at openjdk.org Sat Nov 1 15:06:06 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Sat, 1 Nov 2025 15:06:06 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Approved ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3407565447 From duke at openjdk.org Sat Nov 1 16:00:22 2025 From: duke at openjdk.org (duke) Date: Sat, 1 Nov 2025 16:00:22 GMT Subject: Withdrawn: 8366122: Shenandoah: Implement efficient support for object count after gc events In-Reply-To: <7KUQJooZsasGtVU-HaCj7h8_rMFBX13d4yW3T4PfpBw=.07a12734-af51-45cc-9bbb-d6573806478a@github.com> References: <7KUQJooZsasGtVU-HaCj7h8_rMFBX13d4yW3T4PfpBw=.07a12734-af51-45cc-9bbb-d6573806478a@github.com> Message-ID: On Thu, 28 Aug 2025 01:30:39 GMT, pf0n wrote: > ### Summary > > The new implementation of ObjectCountAfterGC for Shenandoah piggybacks off of the existing marking phases and records strongly marked objects in a histogram. If the event is disabled, the original marking closures are used. When enabled new mark-and-count closures are used by the worker threads. Each worker thread updates its local histogram as it marks an object. These local histograms are merged at the conclusion of the marking phase under a mutex. The event is emitted outside a safepoint. Because (most) Shenandoah's marking is done concurrently, so is the object counting work. > > ### Performance > The performance test were ran using the Extremem benchmark on a default and stress workload. (will edit this section to include data after average time and test for GenShen) > > #### Default workload: > ObjectCountAfterGC disabled (master branch): > `[807.216s][info][gc,stats ] Pause Init Mark (G) = 0.003 s (a = 264 us)` > `[807.216s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 91 us)` > `[807.216s][info][gc,stats ] Concurrent Mark Roots = 0.041 s (a = 4099 us)` > `[807.216s][info][gc,stats ] Concurrent Marking = 1.660 s (a = 166035 us)` > `[807.216s][info][gc,stats ] Pause Final Mark (G) = 0.004 s (a = 446 us) ` > `[807.216s][info][gc,stats ] Pause Final Mark (G) = 0.004 s (a = 446 us) ` > `[807.216s][info][gc,stats ] Pause Final Mark (N) = 0.004 s (a = 357 us)` > > ObjectCountAfterGC disabled (feature branch): > `[807.104s][info][gc,stats ] Pause Init Mark (G) = 0.003 s (a = 302 us)` > `[807.104s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 92 us) ` > `[807.104s][info][gc,stats ] Concurrent Mark Roots = 0.048 s (a = 4827 us)` > `[807.104s][info][gc,stats ] Concurrent Marking = 1.666 s (a = 166638 us) ` > `[807.104s][info][gc,stats ] Pause Final Mark (G) = 0.006 s (a = 603 us)` > `[807.104s][info][gc,stats ] Pause Final Mark (N) = 0.005 s (a = 516 us)` > > ObjectCountAfterGC enabled (feature branch) > `[807.299s][info][gc,stats ] Pause Init Mark (G) = 0.002 s (a = 227 us)` > `[807.299s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 89 us) ` > `[807.299s][info][gc,stats ] Concurrent Mark Roots = 0.053 s (a = 5279 us)` > `[807.299s][info][gc,st... This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/26977 From ysuenaga at openjdk.org Sun Nov 2 06:32:02 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sun, 2 Nov 2025 06:32:02 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 21:00:22 GMT, Chris Plummer wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update testcase > > Changes look good. Thanks for fixing this. @plummercj Can you approve again this PR? Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27885#issuecomment-3477496462 From kbarrett at openjdk.org Sun Nov 2 07:05:24 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sun, 2 Nov 2025 07:05:24 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Thanks for reviews and comments. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3477511265 From kbarrett at openjdk.org Sun Nov 2 07:05:26 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sun, 2 Nov 2025 07:05:26 GMT Subject: Integrated: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 07:11:51 GMT, Kim Barrett wrote: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests This pull request has now been integrated. Changeset: e8a1a870 Author: Kim Barrett URL: https://git.openjdk.org/jdk/commit/e8a1a8707ee6192c85ac62a2a51c815e07613c38 Stats: 670 lines in 68 files changed: 430 ins; 134 del; 106 mod 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library Reviewed-by: jrose, lkorinth, iwalulya, kvn, stefank ------------- PR: https://git.openjdk.org/jdk/pull/27601 From stooke at openjdk.org Mon Nov 3 02:23:31 2025 From: stooke at openjdk.org (Simon Tooke) Date: Mon, 3 Nov 2025 02:23:31 GMT Subject: Integrated: 8370578: SystemMapTest.java#normal fails intermittendly on macOS aarch64 In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 20:28:10 GMT, Simon Tooke wrote: > This PR addresses [JDK-8370578](https://bugs.openjdk.org/browse/JDK-8370578) > > Under certain circumstances, OpenJDK on macOS maps the hsperf segment private instead of shared; one of those cases is hit during the tier1 tests, which test for that. > > This PR allows for shared or private mapping; the purpose of the intermittently failing test is to test System.map implementation, not JDK internals. This pull request has now been integrated. Changeset: 05efc1fa Author: Simon Tooke Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/05efc1fa991c3fd895bf2f7c7d9e7916692b98e6 Stats: 8 lines in 1 file changed: 4 ins; 0 del; 4 mod 8370578: SystemMapTest.java#normal fails intermittendly on macOS aarch64 Reviewed-by: cjplummer, sspitsyn, stuefe ------------- PR: https://git.openjdk.org/jdk/pull/28025 From duke at openjdk.org Mon Nov 3 02:25:17 2025 From: duke at openjdk.org (Saint Wesonga) Date: Mon, 3 Nov 2025 02:25:17 GMT Subject: Integrated: 8370974: Command-line Hotspot debugger tests fail on Windows AArch64 In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 01:03:09 GMT, Saint Wesonga wrote: > The registers are all shown to have the value 0. The addThreads method needs to fill the array of registers with values from the native OS CONTEXT. The clhsdb* tests now pass with this change. This pull request has now been integrated. Changeset: 4cfabd60 Author: Saint Wesonga Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/4cfabd605c42494db4ca4078344d32abc951a9ae Stats: 44 lines in 1 file changed: 44 ins; 0 del; 0 mod 8370974: Command-line Hotspot debugger tests fail on Windows AArch64 Reviewed-by: dholmes, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/28080 From cjplummer at openjdk.org Mon Nov 3 06:09:06 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 3 Nov 2025 06:09:06 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v12] In-Reply-To: References: Message-ID: On Sat, 1 Nov 2025 03:20:49 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. >> >> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. >> >> >> ----------------- 646689 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 >> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c >> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f1cf218789f JVM_SleepNanos + 0x28f >> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> >> >> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. >> >> >> ----------------- 646841 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 >> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c >> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f4a0918789f JVM_SleepNanos + 0x28f >> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) >> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) >> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) >> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) >> * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) >> 0x00007f49ef3385fd >> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce >> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 >> 0x00007f4a08fc31bb JavaCalls::call_virtu... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: > > - Merge branch 'master' into jhsdb-jstack-bp > - Improve comments in isValidFrame method > - Use stderrShouldBeEmptyIgnoreVMWarnings > - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only > - Respect RSP to parse DWARF > - Revert testcase changes > - Fix imports > - Update testcase > - Update testcase > - Add glibc version check to TestJhsdbJstackMixedWithXComp.java > - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0 Looks good. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27885#pullrequestreview-3409513824 From duke at openjdk.org Mon Nov 3 09:41:26 2025 From: duke at openjdk.org (Ruben) Date: Mon, 3 Nov 2025 09:41:26 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v9] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Sat, 1 Nov 2025 09:01:58 GMT, Andrew Haley wrote: >> Re: SafeFetch, it is probably OK to make NativePostCallNop_at slightly slower for uses like make_deoptimized(), but the oopmap optimizations like CodeCache::find_blob_and_oopmap() were highly optimized to make loom/VirtualThread performance reasonable. Adding a SafeFetch here might cause a regression. > >> Re: SafeFetch, it is probably OK to make NativePostCallNop_at slightly slower for uses like make_deoptimized(), but the oopmap optimizations like CodeCache::find_blob_and_oopmap() were highly optimized to make loom/VirtualThread performance reasonable. Adding a SafeFetch here might cause a regression. > > Sure, but 2 things: > Loom doesn't meed post-call NOPs as much as it used to. > We could fairly easily make SafeFetch much faster than it is, if needs be. > But anyway, I approved this patch. Thank you for the detailed advice, @theRealAph, I now see how `SafeFetch` can be valuable independently of whether false-positive matches with the post-call NOP pattern can happen during normal execution. I hadn't considered the stack corruption use case before. Reviewing the `SafeFetch` implementation, I believe in general case it relies on `sigsetjmp` on POSIX systems and exceptions on Windows. However, for AArch64, the `SafeFetch32` has an optimized implementation - avoiding `setjmp` or exceptions overhead. On the fast path, it performs just one load, so any extra performance cost would be due to that path cannot currently be inlined. There indeed seems to be a way to have it inlined, at least on Linux - via creating an extra ELF section containing addresses of all inlined `SafeFetch` loads and corresponding continuation points, which the signal handler can iterate through. I've not prototyped this, but if feasible, it could make the performance impact of using `SafeFetch` negligible. Since there isn't necessarily a consensus at this stage on whether `SafeFetch` should be added in this PR, I'd propose opening a separate JBS ticket for it to avoid blocking merge of the exception handler stub code cleanup. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3479653271 From fbredberg at openjdk.org Mon Nov 3 10:05:35 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Mon, 3 Nov 2025 10:05:35 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v4] In-Reply-To: References: Message-ID: > This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. > > The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. > There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. > Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. > To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. > This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. > > This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. > > Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. > All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer - Update two, after the review - Update after review - Small arm32 fix - Small include line fix - 8367982: Unify ObjectSynchronizer and LightweightSynchronizer ------------- Changes: https://git.openjdk.org/jdk/pull/27915/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27915&range=03 Stats: 2972 lines in 80 files changed: 1259 ins; 1425 del; 288 mod Patch: https://git.openjdk.org/jdk/pull/27915.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27915/head:pull/27915 PR: https://git.openjdk.org/jdk/pull/27915 From alanb at openjdk.org Mon Nov 3 11:05:05 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 3 Nov 2025 11:05:05 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v4] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 21:07:51 GMT, Mat Carter wrote: >> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. >> >> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE >> >> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: >> >> TRUE >> FALSE >> >> Passes tier1 on linux (x64) and windows (x64) > > Mat Carter has updated the pull request incrementally with one additional commit since the last revision: > > Updated test based on comments src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java line 104: > 102: * > 103: * > 104: * @return {@code true} if a recording was in progress and has been ended successfully; {@code false} otherwise. Someone is bound to ask what happens if the "endRecording" operation is performed concurrently and there is recording in progress. Does one or all return true? I don't think it matters, the bigger issue here is that returning false means the recording has already ended or it failed. If it failed, why did it fail? I realize the intention is to add some properties and further operations to this MXBean but I think it would be good to think through if starting with a boolean returning operation is going to be problematic in the future. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2486085650 From alanb at openjdk.org Mon Nov 3 11:05:07 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 3 Nov 2025 11:05:07 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v4] In-Reply-To: References: <3DZMFG5pUixBip4O18gylfQpcCOTFxcwwVTWahRMBYo=.c9cb089e-6031-4b77-bb4a-775ed6cac818@github.com> Message-ID: <8XzXNt3iOeijZtZWB_zdMoWLPadJkgEbmaoqZQjEH1A=.a9fca7c1-9e42-4209-b21f-08af5554d344@github.com> On Wed, 29 Oct 2025 18:47:13 GMT, Mat Carter wrote: >> I see that now - fixing .... > > I also removed the nested {@code ..} from within the as that also caused an issue Good. You can move the example to a snippet too and that will allow the `
` tags to go away.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2486086959

From egahlin at openjdk.org  Mon Nov  3 11:46:04 2025
From: egahlin at openjdk.org (Erik Gahlin)
Date: Mon, 3 Nov 2025 11:46:04 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v4]
In-Reply-To: 
References: 
 
Message-ID: <3w1fRC9HqhTnBzUPCsGGsw0q8H-wcY-km96h5W0S3To=.28f02299-e10b-4a20-a407-1a208e764a75@github.com>

On Wed, 29 Oct 2025 21:07:51 GMT, Mat Carter  wrote:

>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>> 
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>> 
>> TRUE
>> FALSE
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated test based on comments

Can this be done using a diagnostic command, e.g. AOT.stop? It would allow the recording to be stopped from jcmd and the DiagnosticCommandMBean, without the need for a separate MXBean.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28010#issuecomment-3480099956

From ysuenaga at openjdk.org  Mon Nov  3 14:29:32 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Mon, 3 Nov 2025 14:29:32 GMT
Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack
 with -Xcomp [v12]
In-Reply-To: 
References: 
 
Message-ID: 

On Sat, 1 Nov 2025 03:20:49 GMT, Yasumasa Suenaga  wrote:

>> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`.
>> 
>> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack.
>> 
>> 
>> ----------------- 646689 -----------------
>> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000]
>>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>>    JavaThread state: _thread_blocked
>> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32
>> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c
>> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178
>> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119
>> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc
>> 0x00007f1cf218789f JVM_SleepNanos + 0x28f
>> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method)
>> 
>> 
>> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`.
>> 
>> 
>> ----------------- 646841 -----------------
>> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000]
>>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>>    JavaThread state: _thread_blocked
>> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32
>> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c
>> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178
>> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119
>> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc
>> 0x00007f4a0918789f JVM_SleepNanos + 0x28f
>> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method)
>> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame)
>> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame)
>> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame)
>> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame)
>>                         * java.lang.Thread.run() bci:19 line:1474 (Compiled frame)
>> 0x00007f49ef3385fd 
>> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce
>> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3
>> 0x00007f4a08fc31bb JavaCalls::call_virtu...
>
> Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
> 
>  - Merge branch 'master' into jhsdb-jstack-bp
>  - Improve comments in isValidFrame method
>  - Use stderrShouldBeEmptyIgnoreVMWarnings
>  - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only
>  - Respect RSP to parse DWARF
>  - Revert testcase changes
>  - Fix imports
>  - Update testcase
>  - Update testcase
>  - Add glibc version check to TestJhsdbJstackMixedWithXComp.java
>  - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0

Thanks a lot everyone involved in this PR!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27885#issuecomment-3480834201

From ysuenaga at openjdk.org  Mon Nov  3 14:29:34 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Mon, 3 Nov 2025 14:29:34 GMT
Subject: Integrated: 8370176: Mixed mode jhsdb jstack cannot unwind call stack
 with -Xcomp
In-Reply-To: 
References: 
Message-ID: <15gRRGiyO6BZ8vd6txMvb1j9-ukBDYTv5NXY-zRmzAw=.976e347b-2ce6-4f31-9dfc-1a245d08dc3e@github.com>

On Sun, 19 Oct 2025 06:16:56 GMT, Yasumasa Suenaga  wrote:

> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`.
> 
> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack.
> 
> 
> ----------------- 646689 -----------------
> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>    JavaThread state: _thread_blocked
> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32
> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c
> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178
> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119
> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc
> 0x00007f1cf218789f JVM_SleepNanos + 0x28f
> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method)
> 
> 
> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`.
> 
> 
> ----------------- 646841 -----------------
> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>    JavaThread state: _thread_blocked
> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32
> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c
> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178
> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119
> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc
> 0x00007f4a0918789f JVM_SleepNanos + 0x28f
> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method)
> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame)
> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame)
> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame)
> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame)
>                         * java.lang.Thread.run() bci:19 line:1474 (Compiled frame)
> 0x00007f49ef3385fd 
> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce
> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3
> 0x00007f4a08fc31bb JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 0xab
> 0x00007f4a091...

This pull request has now been integrated.

Changeset: 045018d5
Author:    Yasumasa Suenaga 
URL:       https://git.openjdk.org/jdk/commit/045018d5f39751af9f673974ff876c47596cdbd0
Stats:     248 lines in 6 files changed: 182 ins; 10 del; 56 mod

8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp

Co-authored-by: Fei Yang 
Reviewed-by: cjplummer, kevinw

-------------

PR: https://git.openjdk.org/jdk/pull/27885

From macarte at openjdk.org  Mon Nov  3 20:08:22 2025
From: macarte at openjdk.org (Mat Carter)
Date: Mon, 3 Nov 2025 20:08:22 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v4]
In-Reply-To: <3w1fRC9HqhTnBzUPCsGGsw0q8H-wcY-km96h5W0S3To=.28f02299-e10b-4a20-a407-1a208e764a75@github.com>
References: 
 
 <3w1fRC9HqhTnBzUPCsGGsw0q8H-wcY-km96h5W0S3To=.28f02299-e10b-4a20-a407-1a208e764a75@github.com>
Message-ID: 

On Mon, 3 Nov 2025 11:42:16 GMT, Erik Gahlin  wrote:

> Can this be done using a diagnostic command, e.g. AOT.stop? It would allow the recording to be stopped from jcmd and the DiagnosticCommandMBean, without the need for a separate MXBean.

Thank you for the suggestion

To answer your first question, we do have a diagnostic command (AOT.end_recording) and it would precede the AOT MXBean into mainline and it's PR is here: https://github.com/openjdk/jdk/pull/27965

The longer goal for this MXBean is to provide additional methods that would aid in monitoring (isRecording, currentRecordingLength etc.), however we decided to reduce the scope of the MXBean for main line while we continue to test the monitoring functionality in leyden/premain

Historically the diagnostic command came after the MXBean in leyden/premain, however I decided to implement the diagnostic command with the necessary JVM hooks first to simplify review

So technically we could delay this PR and still have the required functionality in mainline, I'd like to hear from the other reviewers on this matter

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28010#issuecomment-3482353337

From lmesnik at openjdk.org  Mon Nov  3 20:09:33 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Mon, 3 Nov 2025 20:09:33 GMT
Subject: RFR: 8371114: Problemlist
 vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java
Message-ID: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com>

Problemlist failing test until main bug is fixed.

-------------

Commit messages:
 - 8371114: Problemlist vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java

Changes: https://git.openjdk.org/jdk/pull/28115/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28115&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371114
  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28115.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28115/head:pull/28115

PR: https://git.openjdk.org/jdk/pull/28115

From amenkov at openjdk.org  Mon Nov  3 20:25:04 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Mon, 3 Nov 2025 20:25:04 GMT
Subject: RFR: 8371114: Problemlist
 vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java
In-Reply-To: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com>
References: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com>
Message-ID: <3tb-vBUSZ6OAzo138zVGlXSZSb9yjXiW0rt24Y_JIg0=.35a3fc99-db2d-4c8f-9325-7d503c81b416@github.com>

On Mon, 3 Nov 2025 18:32:20 GMT, Leonid Mesnik  wrote:

> Problemlist failing test until main bug is fixed.

Marked as reviewed by amenkov (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28115#pullrequestreview-3412793863

From eosterlund at openjdk.org  Mon Nov  3 21:10:00 2025
From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=)
Date: Mon, 3 Nov 2025 21:10:00 GMT
Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object
 Caching with Any GC [v7]
In-Reply-To: 
References: 
 
 
 
 
Message-ID: 

On Thu, 23 Oct 2025 16:06:11 GMT, Ioi Lam  wrote:

>>> Given that we know have support for CDS from all GCs is it time to replace all `INCLUDE_CDS_JAVA_HEAP` with just `INCLUDE_CDS`?
>> 
>> I think we could do that indeed. However, I would like that to be a follow-up cleanup, to avoid cluttering more files in this PR.
>
>> > Given that we know have support for CDS from all GCs is it time to replace all `INCLUDE_CDS_JAVA_HEAP` with just `INCLUDE_CDS`?
>> 
>> I think we could do that indeed. However, I would like that to be a follow-up cleanup, to avoid cluttering more files in this PR.
> 
> We have 
> 
> 
> #if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64)
> #define INCLUDE_CDS_JAVA_HEAP 1
> 
> 
> So we need to make sure it works for 32 bit as well.

@iklam does this look okay now?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27732#issuecomment-3482604226

From heidinga at openjdk.org  Mon Nov  3 21:35:01 2025
From: heidinga at openjdk.org (Dan Heidinga)
Date: Mon, 3 Nov 2025 21:35:01 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v4]
In-Reply-To: 
References: 
 
 
Message-ID: <6LpN0Ae8kfDApFOPUYrbdqz2fRh8HVvvbCa8kiEEFS0=.31761484-c4c1-428c-9974-d2bdec3b587d@github.com>

On Mon, 3 Nov 2025 11:01:23 GMT, Alan Bateman  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated test based on comments
>
> src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java line 104:
> 
>> 102:        * 
>> 103: * >> 104: * @return {@code true} if a recording was in progress and has been ended successfully; {@code false} otherwise. > > Someone is bound to ask what happens if the "endRecording" operation is performed concurrently and there is recording in progress. Does one or all return true? I don't think it matters, the bigger issue here is that returning false means the recording has already ended or it failed. If it failed, why did it fail? I realize the intention is to add some properties and further operations to this MXBean but I think it would be good to think through if starting with a boolean returning operation is going to be problematic in the future. I see a couple of cases for when `endRecording` is called: 1) Within the same process to generate a cache - given the api will only return `true` to one caller, that caller is the only one who can be responsible for taking further action (copying the cache somewhere, etc). Already ended or failed makes no difference operationally. 2) From a monitoring process - again only the successful case matters. All failures (already ended or failed) are indistinguishable. No further action can be taken by the observer. It's only the success case that matters ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2487912197 From iklam at openjdk.org Tue Nov 4 00:09:15 2025 From: iklam at openjdk.org (Ioi Lam) Date: Tue, 4 Nov 2025 00:09:15 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v14] In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 08:43:45 GMT, Erik ?sterlund wrote: >> This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. >> >> The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. >> >> This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. >> >> The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. >> >> The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. >> >> Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. >> Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the or... > > Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: > > Comment update The updated version looks good to me. ------------- Marked as reviewed by iklam (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27732#pullrequestreview-3413414459 From syan at openjdk.org Tue Nov 4 02:28:01 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 4 Nov 2025 02:28:01 GMT Subject: RFR: 8371114: Problemlist vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java In-Reply-To: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> References: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> Message-ID: On Mon, 3 Nov 2025 18:32:20 GMT, Leonid Mesnik wrote: > Problemlist failing test until main bug is fixed. Marked as reviewed by syan (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28115#pullrequestreview-3413704789 From eosterlund at openjdk.org Tue Nov 4 05:14:05 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Tue, 4 Nov 2025 05:14:05 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v14] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 00:05:59 GMT, Ioi Lam wrote: > The updated version looks good to me. Thank you for the review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27732#issuecomment-3483893308 From sspitsyn at openjdk.org Tue Nov 4 07:06:30 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 07:06:30 GMT Subject: RFR: 8371114: Problemlist vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java In-Reply-To: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> References: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> Message-ID: On Mon, 3 Nov 2025 18:32:20 GMT, Leonid Mesnik wrote: > Problemlist failing test until main bug is fixed. Looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28115#pullrequestreview-3414218652 From duke at openjdk.org Tue Nov 4 09:47:39 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 4 Nov 2025 09:47:39 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v2] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed new lines. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Removed incorrect assert, - 8366659: Fixed merge conflict - 8366659: Fixed whitespace. - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - ... and 6 more: https://git.openjdk.org/jdk/compare/ef464d69...ba667e37 ------------- Changes: https://git.openjdk.org/jdk/pull/27040/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=01 Stats: 374 lines in 3 files changed: 310 ins; 44 del; 20 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From duke at openjdk.org Tue Nov 4 09:48:20 2025 From: duke at openjdk.org (Ruben) Date: Tue, 4 Nov 2025 09:48:20 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField - Merge from the main branch - Address review comments and fix a mistype - Check for NOP and MOVK separately in NativePostCallNop - Test for deoptimization in virtual threads Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a - Merge from the main branch - Address review comments - Address review comments - Address review comments - The patch is contributed by @TheRealMDoerr - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 ------------- Changes: https://git.openjdk.org/jdk/pull/26678/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26678&range=09 Stats: 569 lines in 41 files changed: 268 ins; 216 del; 85 mod Patch: https://git.openjdk.org/jdk/pull/26678.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26678/head:pull/26678 PR: https://git.openjdk.org/jdk/pull/26678 From duke at openjdk.org Tue Nov 4 09:50:35 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 4 Nov 2025 09:50:35 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v3] In-Reply-To: References: Message-ID: <2o8megr_K4HfeERT_OCCD4zQz0OLjtd9sQafi5btuSw=.2d1281cf-8965-41ba-97b6-e89466386664@github.com> > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Added a comment to a boolean arg for enter() ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/ba667e37..e84dca9d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From mdoerr at openjdk.org Tue Nov 4 09:58:54 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Tue, 4 Nov 2025 09:58:54 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 Marked as reviewed by mdoerr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26678#pullrequestreview-3415283652 From shade at openjdk.org Tue Nov 4 10:57:03 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 4 Nov 2025 10:57:03 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v8] In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 11:43:26 GMT, Kerem Kat wrote: >> Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. >> >> - Removed x86-specific implementations and ifdef blocks. >> - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. >> - Cleaned up platform detection logic in `PlatformInfo`. >> - Updated documentation references. > > Kerem Kat has updated the pull request incrementally with one additional commit since the last revision: > > Erase obsolete comments I believe all reviewers are in agreement, and you need just another (re-)review to pass the automated checks. I skimmed through the change, and it looks reasonable to me. Thanks! ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27844#pullrequestreview-3415701693 From jsjolen at openjdk.org Tue Nov 4 10:57:44 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Tue, 4 Nov 2025 10:57:44 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v14] In-Reply-To: References: Message-ID: > Hi, > > This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. > > We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. > > For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. > > On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. > > Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. Johan Sj?len has updated the pull request incrementally with two additional commits since the last revision: - Serguei comments - Revert change ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27198/files - new: https://git.openjdk.org/jdk/pull/27198/files/5e72da4e..e3419823 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=12-13 Stats: 6 lines in 4 files changed: 4 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27198.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27198/head:pull/27198 PR: https://git.openjdk.org/jdk/pull/27198 From jsjolen at openjdk.org Tue Nov 4 10:57:48 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Tue, 4 Nov 2025 10:57:48 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v12] In-Reply-To: References: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> Message-ID: On Wed, 15 Oct 2025 17:58:41 GMT, Serguei Spitsyn wrote: >> I believe that the style is to have an empty line between the code and the endif, so this is a style fix. > > The issue is this is the only fix in this file. Should we go and fix all style issues around? > In fact, I'm okay with this tweak. :) Ah, you're right. I responded to this in the 'Conversation' view and didn't see that this is the only change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2489892804 From jsjolen at openjdk.org Tue Nov 4 10:57:50 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Tue, 4 Nov 2025 10:57:50 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v7] In-Reply-To: References: Message-ID: On Tue, 23 Sep 2025 04:22:49 GMT, Serguei Spitsyn wrote: >> Johan Sj?len has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/operands-again' into operands-again >> - Fix BSM naming > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java line 482: > >> 480: int basePos = offs.at(bsmIndex); >> 481: int argv = basePos + INDY_ARGV_OFFSET; >> 482: int argc = getBootstrapMethodArgsCount(bsmIndex); > > Nit: Consider to make it shorter: > `getBootstrapMethods` => `getBSMs` > `getBootstrapMethodArgsCount` => `getBSMArgsCount` I'm keeping it verbose, as that's the general style of this file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2489941288 From jsjolen at openjdk.org Tue Nov 4 10:57:47 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Tue, 4 Nov 2025 10:57:47 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v12] In-Reply-To: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> References: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> Message-ID: On Wed, 8 Oct 2025 20:35:41 GMT, Serguei Spitsyn wrote: >> Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix copyright > > src/hotspot/share/classfile/classFileParser.cpp line 3342: > >> 3340: >> 3341: BSMAttributeEntry* entry = iter.reserve_new_entry(bootstrap_method_ref, num_bootstrap_arguments); >> 3342: guarantee_property(entry != nullptr, "Invalid BootstrapMethods num_bootstrap_methods. The total amount of space reserved for the BootstrapMethod attribute was not sufficient", CHECK); > > Nit: This line is too big. It is a good idea to split the message. Also, would it better to move this guaranty for `nullptr` into the `reserve_new_entry()`? I think it's best to keep this null check here so that we can have a specialized error message. In this case, we are reading a classfile, so we're parsing untrusted input. That's when we might get a null result when attempting to reserve a new entry. In the other cases, we're working from trusted data and a presumed-to-be-correct algorithm. I've added assertions in these cases, as it shouldn't break. > src/hotspot/share/oops/bsmAttribute.hpp line 97: > >> 95: int _cur_offset; >> 96: // Current unused offset into BSMAEs bsm-data array >> 97: int _cur_array; > > Nit: The declarations at lines 95, 97 will be more readable if comments above declarations trail declarations. The comment should not start with capital. Do you mean that you want this? ```c++ int _cur_offset; // current unused offset into BSMAEs offset array ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2489955815 PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2489948444 From krk at openjdk.org Tue Nov 4 11:04:43 2025 From: krk at openjdk.org (Kerem Kat) Date: Tue, 4 Nov 2025 11:04:43 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v8] In-Reply-To: References: Message-ID: <85W6i3Gd5Jv9yKHc-YZryoacJjhLLb4jUSSMx1FlTlU=.fd3acd85-20f0-40b7-81a6-30c2a3370b8c@github.com> On Thu, 30 Oct 2025 11:43:26 GMT, Kerem Kat wrote: >> Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. >> >> - Removed x86-specific implementations and ifdef blocks. >> - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. >> - Cleaned up platform detection logic in `PlatformInfo`. >> - Updated documentation references. > > Kerem Kat has updated the pull request incrementally with one additional commit since the last revision: > > Erase obsolete comments Thank you for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27844#issuecomment-3485335611 From duke at openjdk.org Tue Nov 4 11:04:43 2025 From: duke at openjdk.org (duke) Date: Tue, 4 Nov 2025 11:04:43 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v8] In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 11:43:26 GMT, Kerem Kat wrote: >> Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. >> >> - Removed x86-specific implementations and ifdef blocks. >> - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. >> - Cleaned up platform detection logic in `PlatformInfo`. >> - Updated documentation references. > > Kerem Kat has updated the pull request incrementally with one additional commit since the last revision: > > Erase obsolete comments @krk Your change (at version 898568d516739531de6bf3563090175e7e9d2cce) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27844#issuecomment-3485343726 From duke at openjdk.org Tue Nov 4 11:35:04 2025 From: duke at openjdk.org (Ruben) Date: Tue, 4 Nov 2025 11:35:04 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 Thank you all for reviewing the PR and helping with testing. A separate JBS issue has been opened for `SafeFetch`: https://bugs.openjdk.org/browse/JDK-8371204. I plan to wait until tomorrow before issuing the `/integrate` request. Please let me know if you think this should wait longer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3485520456 From egahlin at openjdk.org Tue Nov 4 13:29:59 2025 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 4 Nov 2025 13:29:59 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v4] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 21:07:51 GMT, Mat Carter wrote: >> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. >> >> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE >> >> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: >> >> TRUE >> FALSE >> >> Passes tier1 on linux (x64) and windows (x64) > > Mat Carter has updated the pull request incrementally with one additional commit since the last revision: > > Updated test based on comments > To answer your first question, we do have a diagnostic command (AOT.end_recording) and it would precede the AOT MXBean into mainline and its PR is here: #27965 Ah, I didn't know that. (I don?t have a strong opinion on this, but for consistency you might want the jcmd commands for AOT recording to use the same naming convention for starting, stopping, and checking the status of a recording as JFR: JFR.start, JFR.stop, JFR.check, JFR.dump and JFR.configure, where applicable. Initially, we had start_recording, but we later shortened it to start to avoid unnecessary typing) > The longer goal for this MXBean is to provide additional methods that would aid in monitoring (isRecording, currentRecordingLength etc.), however we decided to reduce the scope of the MXBean for main line while we continue to test the monitoring functionality in leyden/premain > > Historically the diagnostic command came after the MXBean in leyden/premain, however I decided to implement the diagnostic command with the necessary JVM hooks first to simplify review Ok. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28010#issuecomment-3486004039 From coleenp at openjdk.org Tue Nov 4 13:44:54 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 4 Nov 2025 13:44:54 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v7] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 10:49:31 GMT, Johan Sj?len wrote: >> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java line 482: >> >>> 480: int basePos = offs.at(bsmIndex); >>> 481: int argv = basePos + INDY_ARGV_OFFSET; >>> 482: int argc = getBootstrapMethodArgsCount(bsmIndex); >> >> Nit: Consider to make it shorter: >> `getBootstrapMethods` => `getBSMs` >> `getBootstrapMethodArgsCount` => `getBSMArgsCount` > > I'm keeping it verbose, as that's the general style of this file. Yes please I like the full names if possible rather than abbreviations. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2490567923 From fbredberg at openjdk.org Tue Nov 4 13:49:23 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Tue, 4 Nov 2025 13:49:23 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v2] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 00:04:11 GMT, David Holmes wrote: >> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision: >> >> Update after review > > src/hotspot/share/runtime/abstract_vm_version.hpp line 195: > >> 193: >> 194: // Is recursive fast locking implemented for this platform? >> 195: constexpr static bool supports_recursive_fast_locking() { return false; } > > Next cleanup: this is supported on all platforms now, so we can get rid of this migration aid. Not sure we can do that, since I don't find any implementation of recursive fast locking on ARM32. @bulasevich Any comment on this? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27915#discussion_r2490583182 From jsjolen at openjdk.org Tue Nov 4 14:27:57 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Tue, 4 Nov 2025 14:27:57 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v15] In-Reply-To: References: Message-ID: <-MyLNt-M1uWjNPTzmizfSNSHZjqO-MFkxJK_Dn22MQs=.68e3b8cf-10da-4c8d-a891-11a0ecf516be@github.com> > Hi, > > This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. > > We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. > > For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. > > On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. > > Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. Johan Sj?len has updated the pull request incrementally with two additional commits since the last revision: - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null - Fix naming ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27198/files - new: https://git.openjdk.org/jdk/pull/27198/files/e3419823..219ef346 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=13-14 Stats: 16 lines in 3 files changed: 3 ins; 3 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/27198.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27198/head:pull/27198 PR: https://git.openjdk.org/jdk/pull/27198 From cjplummer at openjdk.org Tue Nov 4 15:42:25 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 4 Nov 2025 15:42:25 GMT Subject: RFR: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. Ping! I'd like to get this pushed as it is causing CI failures. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28091#issuecomment-3486638761 From pchilanomate at openjdk.org Tue Nov 4 15:48:00 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 4 Nov 2025 15:48:00 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v13] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 19:03:07 GMT, Patricio Chilano Mateo wrote: >> If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. >> >> As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. >> >> This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. >> >> ### Summary of implementation >> >> The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. >> >> If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). >> >> ### Notes >> >> `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::mon... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Suggested fix in macroAssembler_ppc.cpp I pushed a small fix to `JvmtiHideSingleStepping` for an issue found during pre-integration testing where we hit this assert: https://github.com/openjdk/jdk/blob/50bb92a33b32778a96b1823ff995889892bef890/src/hotspot/share/prims/jvmtiThreadState.hpp#L337 The problem is that for a preempting vthread, the `JvmtiThreadState` of the current `JavaThread` has already been rebinded to the state of the carrier when executing `~JvmtiHideSingleStepping`. The fix is to remember the `JvmtiThreadState` used originally in the `JvmtiHideSingleStepping` constructor. The commit includes a new test that reproduces the issue. @sspitsyn maybe you could take a look at this please? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27802#issuecomment-3486666711 From kevinw at openjdk.org Tue Nov 4 16:03:23 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 4 Nov 2025 16:03:23 GMT Subject: RFR: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. Looks good. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28091#pullrequestreview-3417285143 From lmesnik at openjdk.org Tue Nov 4 16:01:09 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 4 Nov 2025 16:01:09 GMT Subject: Integrated: 8371114: Problemlist vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java In-Reply-To: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> References: <0YcGS9LzOn5nWJx7rDA861iuKAvrkDmLzV6DRPNisp0=.3e826cc6-662d-47c6-bdde-660f7b6529e2@github.com> Message-ID: <9Jx9v3mJaqf2pw4yZXKaSLe0Drx6WgwZRFS_iEfrWj0=.f9e800fa-7535-4851-a2d1-271b41ca61d1@github.com> On Mon, 3 Nov 2025 18:32:20 GMT, Leonid Mesnik wrote: > Problemlist failing test until main bug is fixed. This pull request has now been integrated. Changeset: 7d3c66f3 Author: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/7d3c66f379fcb24d4505c2c12e20b24dce313e56 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8371114: Problemlist vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java Reviewed-by: amenkov, syan, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28115 From amenkov at openjdk.org Tue Nov 4 19:22:59 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 4 Nov 2025 19:22:59 GMT Subject: RFR: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28091#pullrequestreview-3418309880 From sspitsyn at openjdk.org Tue Nov 4 20:45:37 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 20:45:37 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v13] In-Reply-To: References: Message-ID: <0Z0x2IAQ1TayXTP7kAm9U3Yyx6A4rw88m7Kjgen6bAY=.15663b42-96db-444f-9e2d-2efcbe4dd94d@github.com> On Tue, 4 Nov 2025 15:45:19 GMT, Patricio Chilano Mateo wrote: > @sspitsyn maybe you could take a look at this please? It looks good in general. I'm still looking at it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27802#issuecomment-3487943741 From sspitsyn at openjdk.org Tue Nov 4 20:49:19 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 20:49:19 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v14] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 15:47:31 GMT, Patricio Chilano Mateo wrote: >> If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. >> >> As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. >> >> This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. >> >> ### Summary of implementation >> >> The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. >> >> If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). >> >> ### Notes >> >> `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::mon... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > fix to JvmtiHideSingleStepping test/hotspot/jtreg/serviceability/jvmti/vthread/SingleStepKlassInit/libSingleStepKlassInit.cpp line 38: > 36: SingleStep(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread, > 37: jmethodID method, jlocation location) { > 38: } Q: Would it make sense to verify that `SingleStep` events are posted or not? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2491981248 From sspitsyn at openjdk.org Tue Nov 4 21:12:51 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 21:12:51 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v14] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 15:47:31 GMT, Patricio Chilano Mateo wrote: >> If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. >> >> As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. >> >> This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. >> >> ### Summary of implementation >> >> The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. >> >> If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). >> >> ### Notes >> >> `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::mon... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > fix to JvmtiHideSingleStepping I've reviewed the latest incremental SVC related update. It is good and nice to have in general. Thank you for adding the test! ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27802#pullrequestreview-3418644332 From sspitsyn at openjdk.org Tue Nov 4 21:16:15 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 21:16:15 GMT Subject: RFR: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: <-YvDCJxFuLX2qQ-ON1SuXdY3rTOetAIJx1Dr6RbEWZk=.1453d481-1849-4e73-a8f1-ffdaea2ac73c@github.com> On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. Good fix. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28091#pullrequestreview-3418654649 From pchilanomate at openjdk.org Tue Nov 4 21:28:15 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 4 Nov 2025 21:28:15 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v14] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 21:10:03 GMT, Serguei Spitsyn wrote: > I've reviewed the latest incremental SVC related update. It is good and nice to have in general. Thank you for adding the test! > Great, thanks for the review Serguei! > test/hotspot/jtreg/serviceability/jvmti/vthread/SingleStepKlassInit/libSingleStepKlassInit.cpp line 38: > >> 36: SingleStep(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread, >> 37: jmethodID method, jlocation location) { >> 38: } > > Q: Would it make sense to verify that `SingleStep` events are posted or not? Good idea, I added a check for it. Let me know if that works. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27802#issuecomment-3488063416 PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2492084640 From pchilanomate at openjdk.org Tue Nov 4 21:28:14 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 4 Nov 2025 21:28:14 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v15] In-Reply-To: References: Message-ID: > If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. > > As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. > > This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. > > ### Summary of implementation > > The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. > > If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). > > ### Notes > > `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::monitorenter`, was renamed to `In... Patricio Chilano Mateo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: - Add check for SingleStep events - Merge branch 'master' into JDK-8369238 - fix to JvmtiHideSingleStepping - Suggested fix in macroAssembler_ppc.cpp - Improve comment and assert msg - More fixes from David's comments - Merge branch 'master' into JDK-8369238 - add const to references - Improve comment in anchor_mark_set_pd - More comments from Coleen - ... and 12 more: https://git.openjdk.org/jdk/compare/2f455ed1...06f85198 ------------- Changes: https://git.openjdk.org/jdk/pull/27802/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27802&range=14 Stats: 2373 lines in 102 files changed: 1928 ins; 125 del; 320 mod Patch: https://git.openjdk.org/jdk/pull/27802.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27802/head:pull/27802 PR: https://git.openjdk.org/jdk/pull/27802 From sspitsyn at openjdk.org Tue Nov 4 21:54:54 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 21:54:54 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v7] In-Reply-To: References: Message-ID: <8Sx_Zy0yHDLxhRd-D9VdD4bsS2fnQmZd20RGlrCpsFg=.bf22f172-50de-4143-b6be-752ef899e4b8@github.com> On Tue, 4 Nov 2025 13:42:26 GMT, Coleen Phillimore wrote: >> I'm keeping it verbose, as that's the general style of this file. > > Yes please I like the full names if possible rather than abbreviations. > I'm keeping it verbose, as that's the general style of this file. Okay. Local naming consistency is important too. > Yes please I like the full names if possible rather than abbreviations. Here the problem is not about full names vs abbreviations. It is about naming inconsistency with all these `BSM` related code. There are already many places with the `BSM` abbreviation. But I agree it is better to maintain the local style here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2492144260 From sspitsyn at openjdk.org Tue Nov 4 22:02:52 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 22:02:52 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v15] In-Reply-To: <-MyLNt-M1uWjNPTzmizfSNSHZjqO-MFkxJK_Dn22MQs=.68e3b8cf-10da-4c8d-a891-11a0ecf516be@github.com> References: <-MyLNt-M1uWjNPTzmizfSNSHZjqO-MFkxJK_Dn22MQs=.68e3b8cf-10da-4c8d-a891-11a0ecf516be@github.com> Message-ID: On Tue, 4 Nov 2025 14:27:57 GMT, Johan Sj?len wrote: >> Hi, >> >> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. >> >> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. >> >> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. >> >> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. >> >> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. > > Johan Sj?len has updated the pull request incrementally with two additional commits since the last revision: > > - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null > - Fix naming Thank you for the updates. This review became too long. I'm okay with the current state. The refactoring itself is nice to have. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27198#pullrequestreview-3418770910 From sspitsyn at openjdk.org Tue Nov 4 22:36:41 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 22:36:41 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v15] In-Reply-To: <-MyLNt-M1uWjNPTzmizfSNSHZjqO-MFkxJK_Dn22MQs=.68e3b8cf-10da-4c8d-a891-11a0ecf516be@github.com> References: <-MyLNt-M1uWjNPTzmizfSNSHZjqO-MFkxJK_Dn22MQs=.68e3b8cf-10da-4c8d-a891-11a0ecf516be@github.com> Message-ID: On Tue, 4 Nov 2025 14:27:57 GMT, Johan Sj?len wrote: >> Hi, >> >> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. >> >> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. >> >> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. >> >> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. >> >> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. > > Johan Sj?len has updated the pull request incrementally with two additional commits since the last revision: > > - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null > - Fix naming I'd recommend to additionally run mach5 tier-6. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27198#issuecomment-3488242701 From sspitsyn at openjdk.org Tue Nov 4 22:41:18 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 22:41:18 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v15] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 21:28:14 GMT, Patricio Chilano Mateo wrote: >> If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. >> >> As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. >> >> This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. >> >> ### Summary of implementation >> >> The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. >> >> If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). >> >> ### Notes >> >> `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::mon... > > Patricio Chilano Mateo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: > > - Add check for SingleStep events > - Merge branch 'master' into JDK-8369238 > - fix to JvmtiHideSingleStepping > - Suggested fix in macroAssembler_ppc.cpp > - Improve comment and assert msg > - More fixes from David's comments > - Merge branch 'master' into JDK-8369238 > - add const to references > - Improve comment in anchor_mark_set_pd > - More comments from Coleen > - ... and 12 more: https://git.openjdk.org/jdk/compare/2f455ed1...06f85198 Marked as reviewed by sspitsyn (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27802#pullrequestreview-3418852425 From sspitsyn at openjdk.org Tue Nov 4 22:41:20 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 4 Nov 2025 22:41:20 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v14] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 21:23:06 GMT, Patricio Chilano Mateo wrote: >> test/hotspot/jtreg/serviceability/jvmti/vthread/SingleStepKlassInit/libSingleStepKlassInit.cpp line 38: >> >>> 36: SingleStep(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread, >>> 37: jmethodID method, jlocation location) { >>> 38: } >> >> Q: Would it make sense to verify that `SingleStep` events are posted or not? > > Good idea, I added a check for it. Let me know if that works. Thanks! It is good. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27802#discussion_r2492228658 From pchilanomate at openjdk.org Tue Nov 4 23:35:55 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 4 Nov 2025 23:35:55 GMT Subject: RFR: 8369238: Allow virtual thread preemption on some common class initialization paths [v15] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 21:28:14 GMT, Patricio Chilano Mateo wrote: >> If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. >> >> As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. >> >> This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. >> >> ### Summary of implementation >> >> The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. >> >> If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). >> >> ### Notes >> >> `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::mon... > > Patricio Chilano Mateo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: > > - Add check for SingleStep events > - Merge branch 'master' into JDK-8369238 > - fix to JvmtiHideSingleStepping > - Suggested fix in macroAssembler_ppc.cpp > - Improve comment and assert msg > - More fixes from David's comments > - Merge branch 'master' into JDK-8369238 > - add const to references > - Improve comment in anchor_mark_set_pd > - More comments from Coleen > - ... and 12 more: https://git.openjdk.org/jdk/compare/2f455ed1...06f85198 Thanks everyone for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27802#issuecomment-3488372018 From pchilanomate at openjdk.org Tue Nov 4 23:35:58 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 4 Nov 2025 23:35:58 GMT Subject: Integrated: 8369238: Allow virtual thread preemption on some common class initialization paths In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 13:42:18 GMT, Patricio Chilano Mateo wrote: > If a thread tries to initialize a class that is already being initialized by another thread, it will block until notified. Since at this blocking point there are native frames on the stack, a virtual thread cannot be unmounted and is pinned to its carrier. Besides harming scalability, this can, in some pathological cases, lead to a deadlock, for example, if the thread executing the class initialization method is blocked waiting for some unmounted virtual thread to run, but all carriers are blocked waiting for that class to be initialized. > > As of JDK-8338383, virtual threads blocked in the VM on `ObjectMonitor` operations can be unmounted. Since synchronization on class initialization is implemented using `ObjectLocker`, we can reuse the same mechanism to unmount virtual threads on these cases too. > > This patch adds support for unmounting virtual threads on some of the most common class initialization paths, specifically when calling `InterpreterRuntime::_new` (`new` bytecode), and `InterpreterRuntime::resolve_from_cache` for `invokestatic`, `getstatic` or `putstatic` bytecodes. In the future we might consider extending this mechanism to include initialization calls originating from native methods such as `Class.forName0`. > > ### Summary of implementation > > The ObjectLocker class was modified to not pin the continuation if we are coming from a preemptable path, which will be the case when calling `InstanceKlass::initialize_impl` from new method `InstanceKlass::initialize_preemptable`. This means that for these cases, a virtual thread can now be unmounted either when contending for the init_lock in the `ObjectLocker` constructor, or in the call to `wait_uninterruptibly`. Also, since the call to initialize a class includes a previous call to `link_class` which also uses `ObjectLocker` to protect concurrent calls from multiple threads, we will allow preemption there too. > > If preempted, we will throw a pre-allocated exception which will get propagated with the `TRAPS/CHECK` macros all the way back to the VM entry point. The exception will be cleared and on return back to Java the virtual thread will go through the preempt stub and unmount. When running again, at the end of the thaw call we will identify this preemption case and redo the original VM call (either `InterpreterRuntime::_new` or `InterpreterRuntime::resolve_from_cache`). > > ### Notes > > `InterpreterRuntime::call_VM_preemptable` used previously only for `InterpreterRuntime::monitorenter`, was renamed to `In... This pull request has now been integrated. Changeset: c6a88155 Author: Patricio Chilano Mateo URL: https://git.openjdk.org/jdk/commit/c6a88155b519a5d0b22f6009e75a0e6388601756 Stats: 2373 lines in 102 files changed: 1928 ins; 125 del; 320 mod 8369238: Allow virtual thread preemption on some common class initialization paths Co-authored-by: Alan Bateman Co-authored-by: Fei Yang Co-authored-by: Richard Reingruber Reviewed-by: sspitsyn, dholmes, coleenp, fbredberg ------------- PR: https://git.openjdk.org/jdk/pull/27802 From jsjolen at openjdk.org Wed Nov 5 08:37:22 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 5 Nov 2025 08:37:22 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v16] In-Reply-To: References: Message-ID: > Hi, > > This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. > > We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. > > For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. > > On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. > > Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. Johan Sj?len 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 31 additional commits since the last revision: - Merge remote-tracking branch 'openjdk/master' into operands-again - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null - Fix naming - Serguei comments - Revert change - Some nits - Fix copyright - Move BSMAttribute BSMAttributeEntries to own header file - Merge remote-tracking branch 'origin/operands-again' into operands-again - Apply suggestions from code review Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> - ... and 21 more: https://git.openjdk.org/jdk/compare/1e0cd337...57f0093e ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27198/files - new: https://git.openjdk.org/jdk/pull/27198/files/219ef346..57f0093e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=14-15 Stats: 278590 lines in 3431 files changed: 200223 ins; 55822 del; 22545 mod Patch: https://git.openjdk.org/jdk/pull/27198.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27198/head:pull/27198 PR: https://git.openjdk.org/jdk/pull/27198 From duke at openjdk.org Wed Nov 5 10:57:18 2025 From: duke at openjdk.org (duke) Date: Wed, 5 Nov 2025 10:57:18 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 @ruben-arm Your change (at version 359c2f185c7add1cac98523f4325a7896e8bd3e0) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3490519353 From duke at openjdk.org Wed Nov 5 11:58:32 2025 From: duke at openjdk.org (Ruben) Date: Wed, 5 Nov 2025 11:58:32 GMT Subject: Integrated: 8365047: Remove exception handler stub code in C2 In-Reply-To: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Thu, 7 Aug 2025 15:49:20 GMT, Ruben wrote: > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. This pull request has now been integrated. Changeset: 3e3822ad Author: Ruben Ayrapetyan Committer: Evgeny Astigeevich URL: https://git.openjdk.org/jdk/commit/3e3822ad7eadbb3d86a3b94a6bd858f8c8ef9364 Stats: 569 lines in 41 files changed: 268 ins; 216 del; 85 mod 8365047: Remove exception handler stub code in C2 Co-authored-by: Martin Doerr Reviewed-by: mdoerr, dlong, dfenacci, adinn, fyang, aph ------------- PR: https://git.openjdk.org/jdk/pull/26678 From coleenp at openjdk.org Wed Nov 5 12:50:26 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 5 Nov 2025 12:50:26 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v16] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 08:37:22 GMT, Johan Sj?len wrote: >> Hi, >> >> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. >> >> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. >> >> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. >> >> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. >> >> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. > > Johan Sj?len 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 31 additional commits since the last revision: > > - Merge remote-tracking branch 'openjdk/master' into operands-again > - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null > - Fix naming > - Serguei comments > - Revert change > - Some nits > - Fix copyright > - Move BSMAttribute BSMAttributeEntries to own header file > - Merge remote-tracking branch 'origin/operands-again' into operands-again > - Apply suggestions from code review > > Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> > - ... and 21 more: https://git.openjdk.org/jdk/compare/edfdae41...57f0093e This is excellent work! I had a couple of small suggested changes, but am happy to approve it. src/hotspot/share/oops/bsmAttribute.hpp line 28: > 26: #define SHARE_OOPS_BSMATTRIBUTE_HPP > 27: > 28: #include "classfile/classLoaderData.hpp" I think you can forward declare ClassLoaderData rather than include the whole file here. ------------- PR Review: https://git.openjdk.org/jdk/pull/27198#pullrequestreview-3421758555 PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2494308893 From coleenp at openjdk.org Wed Nov 5 12:50:30 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 5 Nov 2025 12:50:30 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v12] In-Reply-To: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> References: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> Message-ID: <8WVVrT5cKKUY1wGnTvxzj-8FFM-dZnYtuActIQRXZUQ=.0f11587c-e06f-47ee-93e4-bd7a5e7fc16f@github.com> On Wed, 8 Oct 2025 21:09:23 GMT, Serguei Spitsyn wrote: >> Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix copyright > > src/hotspot/share/oops/bsmAttribute.inline.hpp line 34: > >> 32: _cur_array + BSMAttributeEntry::u2s_required(argc) > insert_into->bootstrap_methods()->length()) { >> 33: return nullptr; >> 34: } > > Nit: This check needs a comment. Also, I'd suggest to add a guarantee here instead of returning `nullptr`. I agree with this comment - is returning null going to crash somewhere down the line? Is this an overflow? > src/hotspot/share/oops/constantPool.hpp line 94: > >> 92: InstanceKlass* _pool_holder; // the corresponding class >> 93: >> 94: BSMAttributeEntries _bsmaentries; > > Nit: Suggestion to rename: `_bsmaentries` => `_bsm_entries`. This is a good suggestion for a minor change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2494322202 PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2494323677 From coleenp at openjdk.org Wed Nov 5 12:50:31 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 5 Nov 2025 12:50:31 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v7] In-Reply-To: <8Sx_Zy0yHDLxhRd-D9VdD4bsS2fnQmZd20RGlrCpsFg=.bf22f172-50de-4143-b6be-752ef899e4b8@github.com> References: <8Sx_Zy0yHDLxhRd-D9VdD4bsS2fnQmZd20RGlrCpsFg=.bf22f172-50de-4143-b6be-752ef899e4b8@github.com> Message-ID: <9KAeG5WWY5hMK4Yjl0i3G9tCWreCYe-b8y-BeHnXSdY=.6c742a39-87f8-40e9-8725-be05bb5f36f4@github.com> On Tue, 4 Nov 2025 21:52:04 GMT, Serguei Spitsyn wrote: >> Yes please I like the full names if possible rather than abbreviations. > >> I'm keeping it verbose, as that's the general style of this file. > > Okay. Local naming consistency is important too. > >> Yes please I like the full names if possible rather than abbreviations. > > Here the problem is not about full names vs abbreviations. It is about naming inconsistency with all these `BSM` related code. There are already many places with the `BSM` abbreviation. But I agree it is better to maintain the local style here. The abbreviation in the middle of the word makes me find it hard to say in English in this case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2494315140 From coleenp at openjdk.org Wed Nov 5 14:32:01 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 5 Nov 2025 14:32:01 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v4] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 10:05:35 GMT, Fredrik Bredberg wrote: >> This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. >> >> The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. >> There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. >> Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. >> To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. >> This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. >> >> This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. >> >> Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. >> All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. > > Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: > > - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer > - Update two, after the review > - Update after review > - Small arm32 fix > - Small include line fix > - 8367982: Unify ObjectSynchronizer and LightweightSynchronizer I believe you've addressed all of David's comments and mine, and we can have a new PR for moving and additional work we're going to do with the ObjectMonitorTable. ------------- Marked as reviewed by coleenp (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27915#pullrequestreview-3422419032 From fbredberg at openjdk.org Wed Nov 5 14:39:22 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Wed, 5 Nov 2025 14:39:22 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v2] In-Reply-To: <_96H3JAsfT8uJ5oY7PEtsiX4tNZPy0VRgDRW6YjfBCo=.aa04fd8b-9520-463a-9677-a73a52244ef3@github.com> References: <_96H3JAsfT8uJ5oY7PEtsiX4tNZPy0VRgDRW6YjfBCo=.aa04fd8b-9520-463a-9677-a73a52244ef3@github.com> Message-ID: On Fri, 31 Oct 2025 13:52:53 GMT, Fredrik Bredberg wrote: >> src/hotspot/share/runtime/synchronizer.cpp line 287: >> >>> 285: _last_async_deflation_time_ns = os::javaTimeNanos(); >>> 286: >>> 287: ObjectSynchronizer::create_om_table(); >> >> The original code should effectively be inlined here: >> >> if (UseObjectMonitorTable) { >> ObjectMonitorTable::create(); >> } > > Tried to do a quick fix for this, but `ObjectMonitorTable` is not known at this point, and forward declaring it turned out to be a mess. So, since we agreed to move out `ObjectMonitorTable` to a separate file, I think this can be postponed until that file has been created. Created: [JDK-8371347](https://bugs.openjdk.org/browse/JDK-8371347) "Move the ObjectMonitorTable to a separate new file" >> src/hotspot/share/runtime/synchronizer.cpp line 1838: >> >>> 1836: if (!UseObjectMonitorTable) { >>> 1837: return; >>> 1838: } >> >> This should move to the caller and be replaced with an assertion at this level. Though you don't need to introduce this method at all as the caller can call `OMT::create` directly. > > Same as last answer, this is easily done once we have moved `ObjectMonitorTable` to a separate file, but not until then. Created: [JDK-8371347](https://bugs.openjdk.org/browse/JDK-8371347) "Move the ObjectMonitorTable to a separate new file" ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27915#discussion_r2494806413 PR Review Comment: https://git.openjdk.org/jdk/pull/27915#discussion_r2494808134 From fbredberg at openjdk.org Wed Nov 5 14:39:24 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Wed, 5 Nov 2025 14:39:24 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v4] In-Reply-To: References: <8Rwv4Cs35RINL9l1YVBYNZmbc6YZNE3C5lO21ACBR3c=.004cf158-a586-4bb2-b22b-81df349b1bdd@github.com> <00xzxB3fxjSbmCZCQCu_ZEClnyxq2yfPfF-9SKJXoIc=.b45bec0f-164d-4604-87e2-d69ce072533b@github.com> Message-ID: <7ZEE720IklvXdhfxVI_Bxz2IwcY_CoOwPJHtk9PZ1bw=.deca3dd9-c7d6-4fbc-865d-470cd2cf96b9@github.com> On Mon, 27 Oct 2025 12:47:56 GMT, Coleen Phillimore wrote: >> I agree on both counts: move it to a new file in a new PR. > > Follow-on cleanup would be fine for moving this. Created: [JDK-8371347](https://bugs.openjdk.org/browse/JDK-8371347) "Move the ObjectMonitorTable to a separate new file" ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27915#discussion_r2494797881 From cjplummer at openjdk.org Wed Nov 5 15:56:23 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 5 Nov 2025 15:56:23 GMT Subject: RFR: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. Thank you for the reviews Alex, Kevin, and Serguei! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28091#issuecomment-3492016792 From cjplummer at openjdk.org Wed Nov 5 15:59:33 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 5 Nov 2025 15:59:33 GMT Subject: Integrated: 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings In-Reply-To: References: Message-ID: <15zG3f-LkjwuxrUDQhIPE3DuBVY46Ejvi3NM807QPdw=.49919643-6d83-484b-b1b7-2d1bb31559f7@github.com> On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer wrote: > There are a number of tests that check that stderr has no output other than deprecation warnings. This is bit overdone and unnecessary. There are command line options such as -XX:+UseLargePages that can result in a warning that has nothing to do with the test. The test should not fail for this reason. > > For the SA tests, the main reason for the stderr check is to catch exceptions, warnings, or errors generated by SA tools on stderr. There is no need to fail if there is a VM warning, so switching to stderrShouldBeEmptyIgnoreVMWarnings() should be fine. > > For the attach test, the test is trying to instigate a failure by deleting the .java_pid files. Before the bug fix that this test was added for, the jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and print it on stderr, and also result in an exit value of 1. The test already checks the exit value, so this should be sufficient, but there is no harm in also checking stderr assuming we allow VM warnings, so this test is also switching to stderrShouldBeEmptyIgnoreVMWarnings(). > > Tested by running all affected tests with -XX:+UseLargePages on hosts that produce a warning message when you do this. This pull request has now been integrated. Changeset: b0536f9c Author: Chris Plummer URL: https://git.openjdk.org/jdk/commit/b0536f9c2a6ddfa27be8fad8f53783c6b28d22c9 Stats: 8 lines in 5 files changed: 0 ins; 0 del; 8 mod 8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due to VM warnings Reviewed-by: kevinw, amenkov, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28091 From bulasevich at openjdk.org Wed Nov 5 16:03:41 2025 From: bulasevich at openjdk.org (Boris Ulasevich) Date: Wed, 5 Nov 2025 16:03:41 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v2] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 13:46:22 GMT, Fredrik Bredberg wrote: >> src/hotspot/share/runtime/abstract_vm_version.hpp line 195: >> >>> 193: >>> 194: // Is recursive fast locking implemented for this platform? >>> 195: constexpr static bool supports_recursive_fast_locking() { return false; } >> >> Next cleanup: this is supported on all platforms now, so we can get rid of this migration aid. > > Not sure we can do that, since I don't find any implementation of recursive fast locking on ARM32. > @bulasevich Any comment on this? Recursive lightweight locking (JDK-8319796) was implemented for x86, AArch64, PPC64LE, RISC-V64, and S390, but not for ARM32. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27915#discussion_r2495179254 From cjplummer at openjdk.org Wed Nov 5 16:20:16 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 5 Nov 2025 16:20:16 GMT Subject: RFR: 8371354: Problem list serviceability/sa/TestJhsdbJstackMixedWithXComp.java due to JDK-8371194 Message-ID: This test failure is noisy so we need to problem list it. Testing in progress to make sure it really is excluded. I'd like to push this as trivial. ------------- Commit messages: - problem list sa test Changes: https://git.openjdk.org/jdk/pull/28152/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28152&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371354 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28152.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28152/head:pull/28152 PR: https://git.openjdk.org/jdk/pull/28152 From kevinw at openjdk.org Wed Nov 5 16:45:32 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 5 Nov 2025 16:45:32 GMT Subject: RFR: 8371354: Problem list serviceability/sa/TestJhsdbJstackMixedWithXComp.java due to JDK-8371194 In-Reply-To: References: Message-ID: <9RPzU0_7dtVOWS3SoDf1tBbtuwLKAHwD8RGXz8KpNpQ=.91913a50-a15e-4391-a4ab-22bb592229b1@github.com> On Wed, 5 Nov 2025 16:13:59 GMT, Chris Plummer wrote: > This test failure is noisy so we need to problem list it. Testing in progress to make sure it really is excluded. I'd like to push this as trivial. Agreed 8-) ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28152#pullrequestreview-3423209909 From fbredberg at openjdk.org Wed Nov 5 17:35:16 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Wed, 5 Nov 2025 17:35:16 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v5] In-Reply-To: References: Message-ID: > This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. > > The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. > There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. > Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. > To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. > This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. > > This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. > > Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. > All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer - Update two, after the review - Update after review - Small arm32 fix - Small include line fix - 8367982: Unify ObjectSynchronizer and LightweightSynchronizer ------------- Changes: https://git.openjdk.org/jdk/pull/27915/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27915&range=04 Stats: 2981 lines in 80 files changed: 1263 ins; 1429 del; 289 mod Patch: https://git.openjdk.org/jdk/pull/27915.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27915/head:pull/27915 PR: https://git.openjdk.org/jdk/pull/27915 From cjplummer at openjdk.org Wed Nov 5 18:06:18 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 5 Nov 2025 18:06:18 GMT Subject: RFR: 8371354: Problem list serviceability/sa/TestJhsdbJstackMixedWithXComp.java due to JDK-8371194 In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 16:13:59 GMT, Chris Plummer wrote: > This test failure is noisy so we need to problem list it. Testing in progress to make sure it really is excluded. I'd like to push this as trivial. Thanks Kevin! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28152#issuecomment-3492625188 From cjplummer at openjdk.org Wed Nov 5 18:06:19 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 5 Nov 2025 18:06:19 GMT Subject: Integrated: 8371354: Problem list serviceability/sa/TestJhsdbJstackMixedWithXComp.java due to JDK-8371194 In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 16:13:59 GMT, Chris Plummer wrote: > This test failure is noisy so we need to problem list it. Testing in progress to make sure it really is excluded. I'd like to push this as trivial. This pull request has now been integrated. Changeset: cf45e09c Author: Chris Plummer URL: https://git.openjdk.org/jdk/commit/cf45e09c388e95b5f11ad08ebdf7f277e968f90b Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8371354: Problem list serviceability/sa/TestJhsdbJstackMixedWithXComp.java due to JDK-8371194 Reviewed-by: kevinw ------------- PR: https://git.openjdk.org/jdk/pull/28152 From sgehwolf at openjdk.org Wed Nov 5 18:30:06 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 5 Nov 2025 18:30:06 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function Message-ID: Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `y=` and `x=`): f(x) = {(x - 2) \times 9999 + 1 \over 262142} This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. Thoughts? **Testing:** - [x] GHA - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. ------------- Commit messages: - Fix include - Add asserts/checks for input domain - Add regression test for jdk-8370492 - 8370492: [Linux] Update cpu shares to cpu.weight mapping function Changes: https://git.openjdk.org/jdk/pull/28157/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370492 Stats: 96 lines in 4 files changed: 79 ins; 0 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/28157.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28157/head:pull/28157 PR: https://git.openjdk.org/jdk/pull/28157 From lmesnik at openjdk.org Wed Nov 5 20:56:13 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Wed, 5 Nov 2025 20:56:13 GMT Subject: RFR: 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK Message-ID: The one JvmtiJavaThreadEventTransition mark should be replaced with macro. Grepped that there are not JvmtiJavaThreadEventTransition and JvmtiThreadEventTransition mark are used except vm_death. ------------- Commit messages: - 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK Changes: https://git.openjdk.org/jdk/pull/28165/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28165&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371367 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28165.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28165/head:pull/28165 PR: https://git.openjdk.org/jdk/pull/28165 From pchilanomate at openjdk.org Wed Nov 5 21:05:11 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 5 Nov 2025 21:05:11 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v5] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 17:35:16 GMT, Fredrik Bredberg wrote: >> This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. >> >> The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. >> There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. >> Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. >> To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. >> This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. >> >> This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. >> >> Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. >> All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. > > Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: > > - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer > - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer > - Update two, after the review > - Update after review > - Small arm32 fix > - Small include line fix > - 8367982: Unify ObjectSynchronizer and LightweightSynchronizer Looks good to me, thanks. ------------- Marked as reviewed by pchilanomate (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27915#pullrequestreview-3424388594 From mr at openjdk.org Wed Nov 5 21:55:02 2025 From: mr at openjdk.org (Mark Reinhold) Date: Wed, 5 Nov 2025 21:55:02 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v4] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 21:07:51 GMT, Mat Carter wrote: >> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. >> >> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE >> >> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: >> >> TRUE >> FALSE >> >> Passes tier1 on linux (x64) and windows (x64) > > Mat Carter has updated the pull request incrementally with one additional commit since the last revision: > > Updated test based on comments Changes requested by mr (Lead). src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java line 78: > 76: * specification of the corresponding JVM command-line options, please refer > 77: * to https://openjdk.org/jeps/483 and https://openjdk.org/jeps/514. > 78: * Please don't use bare URLs. Change these to ... please refer to JEPs 483 and 514. ------------- PR Review: https://git.openjdk.org/jdk/pull/28010#pullrequestreview-3424599728 PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2496294936 From krk at openjdk.org Thu Nov 6 11:16:58 2025 From: krk at openjdk.org (Kerem Kat) Date: Thu, 6 Nov 2025 11:16:58 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v9] In-Reply-To: References: Message-ID: <91tUP7nn2ciUAGhkUxvWB_RcLOTrdti4uPa2AqUPzIU=.cc51aa81-590f-4dc0-9c42-a4b12bf8f37a@github.com> > Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. > > - Removed x86-specific implementations and ifdef blocks. > - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. > - Cleaned up platform detection logic in `PlatformInfo`. > - Updated documentation references. Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - Merge branch 'master' into clean-x86-sa-JDK-8351194 - Erase obsolete comments - Update src/jdk.hotspot.agent/doc/hsdb.html Co-authored-by: Chris Plummer - Merge branch 'master' into clean-x86-sa-JDK-8351194 - fix comments - Revert "run RotateLeftNode*IdealizationTests on amd64 too" This reverts commit 1011b304f7cb4d195efc9239acd7784053c67cc1. - requires hsdis - run RotateLeftNode*IdealizationTests on amd64 too - Merge branch 'master' into clean-x86-sa-JDK-8351194 - Merge branch 'master' into clean-x86-sa-JDK-8351194 - ... and 1 more: https://git.openjdk.org/jdk/compare/093e1287...7b67d1e8 ------------- Changes: https://git.openjdk.org/jdk/pull/27844/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27844&range=08 Stats: 2784 lines in 45 files changed: 623 ins; 2117 del; 44 mod Patch: https://git.openjdk.org/jdk/pull/27844.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27844/head:pull/27844 PR: https://git.openjdk.org/jdk/pull/27844 From eosterlund at openjdk.org Thu Nov 6 11:38:35 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Thu, 6 Nov 2025 11:38:35 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v15] In-Reply-To: References: Message-ID: > This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. > > The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. > > This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. > > The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. > > The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. > > Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. > Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the order they are laid out in... Erik ?sterlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits: - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Comment update - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - remove include - Interned string value word accounting - Dont load all objects when JVMTI CFLH is on - Remove duplicate string dedup disabling when dumping - Accept interned strings sharing value with another string - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - ... and 21 more: https://git.openjdk.org/jdk/compare/b0536f9c...afdb11ee ------------- Changes: https://git.openjdk.org/jdk/pull/27732/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27732&range=14 Stats: 8721 lines in 106 files changed: 5943 ins; 2318 del; 460 mod Patch: https://git.openjdk.org/jdk/pull/27732.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27732/head:pull/27732 PR: https://git.openjdk.org/jdk/pull/27732 From fbredberg at openjdk.org Thu Nov 6 12:19:20 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Thu, 6 Nov 2025 12:19:20 GMT Subject: RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v5] In-Reply-To: References: Message-ID: <0Bp5MHdJNB3D3XZhG85m_clr-urKBKJ4StjZifsDTRg=.1ecc9574-3493-4a3e-8d7f-4aba5b9495ef@github.com> On Wed, 5 Nov 2025 17:35:16 GMT, Fredrik Bredberg wrote: >> This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. >> >> The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. >> There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. >> Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. >> To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. >> This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. >> >> This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. >> >> Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. >> All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. > > Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: > > - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer > - Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer > - Update two, after the review > - Update after review > - Small arm32 fix > - Small include line fix > - 8367982: Unify ObjectSynchronizer and LightweightSynchronizer Thank you for the reviews. Now let's... ------------- PR Comment: https://git.openjdk.org/jdk/pull/27915#issuecomment-3496959325 From fbredberg at openjdk.org Thu Nov 6 12:19:21 2025 From: fbredberg at openjdk.org (Fredrik Bredberg) Date: Thu, 6 Nov 2025 12:19:21 GMT Subject: Integrated: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer In-Reply-To: References: Message-ID: On Tue, 21 Oct 2025 13:11:45 GMT, Fredrik Bredberg wrote: > This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code. > > The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`. > There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag. > Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them. > To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly. > This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name. > > This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`. > > Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change. > All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU. This pull request has now been integrated. Changeset: 3930b1d4 Author: Fredrik Bredberg URL: https://git.openjdk.org/jdk/commit/3930b1d4ddda9d56d0fb3626421283c72f4ad7f9 Stats: 2981 lines in 80 files changed: 1263 ins; 1429 del; 289 mod 8367982: Unify ObjectSynchronizer and LightweightSynchronizer Reviewed-by: pchilanomate, coleenp ------------- PR: https://git.openjdk.org/jdk/pull/27915 From duke at openjdk.org Thu Nov 6 14:05:15 2025 From: duke at openjdk.org (duke) Date: Thu, 6 Nov 2025 14:05:15 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v9] In-Reply-To: <91tUP7nn2ciUAGhkUxvWB_RcLOTrdti4uPa2AqUPzIU=.cc51aa81-590f-4dc0-9c42-a4b12bf8f37a@github.com> References: <91tUP7nn2ciUAGhkUxvWB_RcLOTrdti4uPa2AqUPzIU=.cc51aa81-590f-4dc0-9c42-a4b12bf8f37a@github.com> Message-ID: On Thu, 6 Nov 2025 11:16:58 GMT, Kerem Kat wrote: >> Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. >> >> - Removed x86-specific implementations and ifdef blocks. >> - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. >> - Cleaned up platform detection logic in `PlatformInfo`. >> - Updated documentation references. > > Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - Erase obsolete comments > - Update src/jdk.hotspot.agent/doc/hsdb.html > > Co-authored-by: Chris Plummer > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - fix comments > - Revert "run RotateLeftNode*IdealizationTests on amd64 too" > > This reverts commit 1011b304f7cb4d195efc9239acd7784053c67cc1. > - requires hsdis > - run RotateLeftNode*IdealizationTests on amd64 too > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - ... and 1 more: https://git.openjdk.org/jdk/compare/093e1287...7b67d1e8 @krk Your change (at version 7b67d1e8a04de7183c9b780cae26b1f2489e2e17) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27844#issuecomment-3497408352 From sspitsyn at openjdk.org Thu Nov 6 14:43:13 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 6 Nov 2025 14:43:13 GMT Subject: RFR: 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK In-Reply-To: References: Message-ID: <9Y8SOyUYCzAy-WycjlfcGzBjCnrJ3_yxY2FGxrnaAjk=.e15d5280-14f5-4801-b57f-72039c4a097d@github.com> On Wed, 5 Nov 2025 20:50:40 GMT, Leonid Mesnik wrote: > The one JvmtiJavaThreadEventTransition mark should be replaced with macro. > > Grepped that there are not JvmtiJavaThreadEventTransition and JvmtiThreadEventTransition mark are used except vm_death. Looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28165#pullrequestreview-3428520092 From shade at openjdk.org Thu Nov 6 15:03:43 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 6 Nov 2025 15:03:43 GMT Subject: RFR: 8351194: Clean up Hotspot SA after 32-bit x86 removal [v9] In-Reply-To: <91tUP7nn2ciUAGhkUxvWB_RcLOTrdti4uPa2AqUPzIU=.cc51aa81-590f-4dc0-9c42-a4b12bf8f37a@github.com> References: <91tUP7nn2ciUAGhkUxvWB_RcLOTrdti4uPa2AqUPzIU=.cc51aa81-590f-4dc0-9c42-a4b12bf8f37a@github.com> Message-ID: <1cbkkn5KQJ2cnZYyH53ejSkev_Sw_4ykAnvYdfcl_Mw=.19c06250-7d59-44fa-9865-3809abd53b8b@github.com> On Thu, 6 Nov 2025 11:16:58 GMT, Kerem Kat wrote: >> Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. >> >> - Removed x86-specific implementations and ifdef blocks. >> - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. >> - Cleaned up platform detection logic in `PlatformInfo`. >> - Updated documentation references. > > Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - Erase obsolete comments > - Update src/jdk.hotspot.agent/doc/hsdb.html > > Co-authored-by: Chris Plummer > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - fix comments > - Revert "run RotateLeftNode*IdealizationTests on amd64 too" > > This reverts commit 1011b304f7cb4d195efc9239acd7784053c67cc1. > - requires hsdis > - run RotateLeftNode*IdealizationTests on amd64 too > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - Merge branch 'master' into clean-x86-sa-JDK-8351194 > - ... and 1 more: https://git.openjdk.org/jdk/compare/093e1287...7b67d1e8 Thanks! Let's go. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27844#issuecomment-3497660843 From krk at openjdk.org Thu Nov 6 15:03:44 2025 From: krk at openjdk.org (Kerem Kat) Date: Thu, 6 Nov 2025 15:03:44 GMT Subject: Integrated: 8351194: Clean up Hotspot SA after 32-bit x86 removal In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 10:05:08 GMT, Kerem Kat wrote: > Remove 32-bit x86 specific code from the HotSpot Serviceability Agent following the removal of 32-bit x86 support. > > - Removed x86-specific implementations and ifdef blocks. > - Renamed files with X86 in the name when they are also used from AMD64, e.g. `X86Frame` ? `AMD64Frame`. > - Cleaned up platform detection logic in `PlatformInfo`. > - Updated documentation references. This pull request has now been integrated. Changeset: 2d924ad3 Author: Kerem Kat Committer: Aleksey Shipilev URL: https://git.openjdk.org/jdk/commit/2d924ad3584a0ea8682f47c742dcdfd3be14937d Stats: 2784 lines in 45 files changed: 623 ins; 2117 del; 44 mod 8351194: Clean up Hotspot SA after 32-bit x86 removal Reviewed-by: cjplummer, shade, ayang, dholmes ------------- PR: https://git.openjdk.org/jdk/pull/27844 From cjplummer at openjdk.org Thu Nov 6 16:37:24 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 6 Nov 2025 16:37:24 GMT Subject: RFR: 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 20:50:40 GMT, Leonid Mesnik wrote: > The one JvmtiJavaThreadEventTransition mark should be replaced with macro. > > Grepped that there are not JvmtiJavaThreadEventTransition and JvmtiThreadEventTransition mark are used except vm_death. Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28165#pullrequestreview-3429252368 From lmesnik at openjdk.org Thu Nov 6 20:23:15 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 6 Nov 2025 20:23:15 GMT Subject: Integrated: 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 20:50:40 GMT, Leonid Mesnik wrote: > The one JvmtiJavaThreadEventTransition mark should be replaced with macro. > > Grepped that there are not JvmtiJavaThreadEventTransition and JvmtiThreadEventTransition mark are used except vm_death. This pull request has now been integrated. Changeset: 90ccdf29 Author: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/90ccdf2986b0e3705997fe31a23fd53c88a1bfaf Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK Reviewed-by: sspitsyn, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/28165 From lmesnik at openjdk.org Thu Nov 6 20:23:13 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 6 Nov 2025 20:23:13 GMT Subject: RFR: 8371367: Replace remaining JvmtiJavaThreadEventTransition with JVMTI_JAVA_THREAD_EVENT_CALLBACK_BLOCK In-Reply-To: <9Y8SOyUYCzAy-WycjlfcGzBjCnrJ3_yxY2FGxrnaAjk=.e15d5280-14f5-4801-b57f-72039c4a097d@github.com> References: <9Y8SOyUYCzAy-WycjlfcGzBjCnrJ3_yxY2FGxrnaAjk=.e15d5280-14f5-4801-b57f-72039c4a097d@github.com> Message-ID: On Thu, 6 Nov 2025 14:40:48 GMT, Serguei Spitsyn wrote: >> The one JvmtiJavaThreadEventTransition mark should be replaced with macro. >> >> Grepped that there are not JvmtiJavaThreadEventTransition and JvmtiThreadEventTransition mark are used except vm_death. > > Looks good. @sspitsyn, @plummercj Thank you for review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28165#issuecomment-3499238887 From lmesnik at openjdk.org Thu Nov 6 21:33:38 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 6 Nov 2025 21:33:38 GMT Subject: RFR: 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing Message-ID: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> The problem happens because jvmti events are posted while handling JvmtiThreadState_lock. The fix just to move flushing out of lock like it is already done in `JvmtiEventController::set_user_enabled(..)` method. The problem start reproducing after fix for https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from slow and unreliable `ClassUnloader.eatMemory();` to fast and robust`WhiteBox.fullGC()`. The jvmti events posting is not synchronized with enabling/disabling events and setting callbacks. So even if there are new events appear in the jvmti tagmap after flushing it is not a bug to don't post them or use new callback handler. Also, it might be makes sense to flush object events before vm_death and post all deferred events from SerrviceThread queue. I am going to file separate RFE for this. Also, I am going to file RFE to replace all GC provoking the `eatMemory()` calls with `WB.fullGC()` to improve test stability and reduce test execution time. ------------- Commit messages: - 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing Changes: https://git.openjdk.org/jdk/pull/28184/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28184&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371103 Stats: 8 lines in 2 files changed: 4 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28184/head:pull/28184 PR: https://git.openjdk.org/jdk/pull/28184 From amenkov at openjdk.org Thu Nov 6 21:50:04 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 6 Nov 2025 21:50:04 GMT Subject: RFR: 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing In-Reply-To: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> References: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> Message-ID: On Thu, 6 Nov 2025 21:26:24 GMT, Leonid Mesnik wrote: > The problem happens because jvmti events are posted while handling JvmtiThreadState_lock. The fix just to move > flushing out of lock like it is already done in `JvmtiEventController::set_user_enabled(..)` method. > > The problem start reproducing after fix for https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from slow and unreliable `ClassUnloader.eatMemory();` to fast and robust`WhiteBox.fullGC()`. > > The jvmti events posting is not synchronized with enabling/disabling events and setting callbacks. So even if there are new events appear in the jvmti tagmap after flushing it is not a bug to don't post them or use new callback handler. > > Also, it might be makes sense to flush object events before vm_death and post all deferred events from SerrviceThread queue. > I am going to file separate RFE for this. > Also, I am going to file RFE to replace all GC provoking the `eatMemory()` calls with `WB.fullGC()` to improve test stability and reduce test execution time. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28184#pullrequestreview-3430693825 From sspitsyn at openjdk.org Thu Nov 6 22:31:02 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 6 Nov 2025 22:31:02 GMT Subject: RFR: 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing In-Reply-To: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> References: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> Message-ID: <_-7XKb0c-O5l0FmUztsbDj2NAAXeHhANS25nZFviFHg=.fd1ac36a-9450-4121-8a05-88a4e3593753@github.com> On Thu, 6 Nov 2025 21:26:24 GMT, Leonid Mesnik wrote: > The problem happens because jvmti events are posted while handling JvmtiThreadState_lock. The fix just to move > flushing out of lock like it is already done in `JvmtiEventController::set_user_enabled(..)` method. > > The problem start reproducing after fix for https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from slow and unreliable `ClassUnloader.eatMemory();` to fast and robust`WhiteBox.fullGC()`. > > The jvmti events posting is not synchronized with enabling/disabling events and setting callbacks. So even if there are new events appear in the jvmti tagmap after flushing it is not a bug to don't post them or use new callback handler. > > Also, it might be makes sense to flush object events before vm_death and post all deferred events from SerrviceThread queue. > I am going to file separate RFE for this. > Also, I am going to file RFE to replace all GC provoking the `eatMemory()` calls with `WB.fullGC()` to improve test stability and reduce test execution time. looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28184#pullrequestreview-3430797067 From dlong at openjdk.org Fri Nov 7 00:01:29 2025 From: dlong at openjdk.org (Dean Long) Date: Fri, 7 Nov 2025 00:01:29 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 We are seeing some new crashes ([JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388)) trying to access a PC that is just past the end of the nmethod and the page is unmapped because it also happens to be the last page of the CodeHeap. Could it be related to the changes in this PR? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3499890263 From duke at openjdk.org Fri Nov 7 00:20:19 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 00:20:19 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Thu, 6 Nov 2025 23:58:46 GMT, Dean Long wrote: > We are seeing some new crashes ([JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388)) trying to access a PC that is just past the end of the nmethod and the page is unmapped because it also happens to be the last page of the CodeHeap. Could it be related to the changes in this PR? Yes, I think it could be similar to the case fixed for AArch64 post-call NOP check earlier: https://github.com/openjdk/jdk/blob/e34a831814996be3e0a2df86b11b1718a76ea558/src/hotspot/cpu/x86/nativeInst_x86.hpp#L584 reads a 32-bit integer from the perceived call site. In case of the deoptimization handler, which is potentially located at the end of the code blob, the read would happen past the end of the code blob - which might cause the access to an unmapped page. It could be replaced with the two-step comparison: first the comparison matching size of the `jmp` instruction (I believe that's 2 bytes), and if that's successful then comparison of the third byte as the second step. Alternatively, the specific deoptimization stub code could be extended by a `nop` in the `emit_deopt_handler`. Would either of these options be suitable? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3499929974 From duke at openjdk.org Fri Nov 7 00:50:27 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 00:50:27 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 Indeed, the `jmp` size is `2` - I had incorrectly assumed it is `5` as specified here https://github.com/openjdk/jdk/blob/e34a831814996be3e0a2df86b11b1718a76ea558/src/hotspot/cpu/x86/nativeInst_x86.hpp#L412 however that's for a different case. The `10` as size of the deopt handler stub code at https://github.com/openjdk/jdk/blob/e34a831814996be3e0a2df86b11b1718a76ea558/src/hotspot/cpu/x86/x86.ad#L2774 is not correct either - it should be `7`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3499993366 From thartmann at openjdk.org Fri Nov 7 07:43:41 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 07:43:41 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 Message-ID: Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). Thanks, Tobias ------------- Commit messages: - Revert "8365047: Remove exception handler stub code in C2" Changes: https://git.openjdk.org/jdk/pull/28187/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28187&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371388 Stats: 569 lines in 41 files changed: 216 ins; 268 del; 85 mod Patch: https://git.openjdk.org/jdk/pull/28187.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28187/head:pull/28187 PR: https://git.openjdk.org/jdk/pull/28187 From thartmann at openjdk.org Fri Nov 7 07:45:28 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 07:45:28 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v10] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 4 Nov 2025 09:48:20 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField > - Merge from the main branch > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a > - Merge from the main branch > - Address review comments > - Address review comments > - Address review comments > - The patch is contributed by @TheRealMDoerr > - ... and 5 more: https://git.openjdk.org/jdk/compare/1922c4fd...359c2f18 Backing out with https://github.com/openjdk/jdk/pull/28187. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3501135218 From thartmann at openjdk.org Fri Nov 7 07:50:15 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 07:50:15 GMT Subject: RFR: 8369147: Various issues with new tests added by JDK-8316694 [v3] In-Reply-To: References: <8UVgF0vLaZhY7zvKWPBLXoU9p71SevknlPYC5LPsfCo=.8531cacc-ff26-42be-a517-88ff87628d29@github.com> <0ZFCDTQAFKjZ5XDtUXWsvC4v0lyot7Trdf3wlIxrb-M=.988407f3-6353-447a-98d6-f890b795fd1d@github.com> Message-ID: On Mon, 27 Oct 2025 18:08:40 GMT, Chad Rakoczy wrote: >>> @chadrako, is PR ready for testing now? >> >> Yes > >> @chadrako I think my suggestion was not correct. We should revert back to your first changes for `@requires`. Original code was correct and only `serviceability/jvmti/NMethodRelocation/NMethodRelocationTest.java` missed it. > > Since the tests get run with different GCs anyways I don't think we need to explicitly require the GC that they run with and just have one test config FTR, even with this fix, we still see failures: [JDK-8371121](https://bugs.openjdk.org/browse/JDK-8371121), [JDK-8371046](https://bugs.openjdk.org/browse/JDK-8371046), [JDK-8369150](https://bugs.openjdk.org/browse/JDK-8369150). @chadrako It would be great if you could prioritize fixing these remaining issues, as the failures cause quite some noise in our testing. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27659#issuecomment-3501148078 From chagedorn at openjdk.org Fri Nov 7 07:54:00 2025 From: chagedorn at openjdk.org (Christian Hagedorn) Date: Fri, 7 Nov 2025 07:54:00 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: <12t7qgPeVTYCh-u65W5b9CG7deELNKNQj_3jkcy9fbw=.3cb3afb1-4c99-4aea-9287-24dfb3ff5d2a@github.com> On Fri, 7 Nov 2025 07:36:16 GMT, Tobias Hartmann wrote: > Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). > > Thanks, > Tobias Looks good and trivial. ------------- Marked as reviewed by chagedorn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28187#pullrequestreview-3432114139 From epeter at openjdk.org Fri Nov 7 07:57:04 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Fri, 7 Nov 2025 07:57:04 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 07:36:16 GMT, Tobias Hartmann wrote: > Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). > > Thanks, > Tobias Looks good to me, thanks for taking care of this! ------------- Marked as reviewed by epeter (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28187#pullrequestreview-3432123803 From thartmann at openjdk.org Fri Nov 7 08:08:01 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 08:08:01 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 07:36:16 GMT, Tobias Hartmann wrote: > Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). > > Thanks, > Tobias Thanks for the quick reviews, Christian and Emanuel. Running sanity testing before integration. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28187#issuecomment-3501194557 From duke at openjdk.org Fri Nov 7 09:03:03 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 09:03:03 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 07:36:16 GMT, Tobias Hartmann wrote: > Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). > > Thanks, > Tobias I have a candidate patch that should address the reported failure from JDK-8371388. If preferred, I can open a PR with this fix as an alternative to reverting the original change. Please let me know. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28187#issuecomment-3501379345 From thartmann at openjdk.org Fri Nov 7 09:20:17 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 09:20:17 GMT Subject: RFR: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 09:00:48 GMT, Ruben wrote: >> Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). >> >> Thanks, >> Tobias > > I have a candidate patch that should address the reported failure from JDK-8371388. If preferred, I can open a PR with this fix as an alternative to reverting the original change. Please let me know. Thanks @ruben-arm. Let's go with this clean back out for now - testing just came back clean. Once you have the REDO ready, I can submit some more sophisticated testing to make sure it addresses the issues we're seeing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28187#issuecomment-3501435282 From thartmann at openjdk.org Fri Nov 7 09:20:18 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 09:20:18 GMT Subject: Integrated: 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: <1naK9sqlndcBD4rKhJm8zNEn1dMr-vwWOo4Qv4M2cxg=.17d0ade7-6c5f-4453-9fbf-cea4372ad1f8@github.com> On Fri, 7 Nov 2025 07:36:16 GMT, Tobias Hartmann wrote: > Clean backout of [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) due to massive failures with different tests in our CI (see JBS for details). > > Thanks, > Tobias This pull request has now been integrated. Changeset: 48bbc950 Author: Tobias Hartmann URL: https://git.openjdk.org/jdk/commit/48bbc950f11113a57ea03f877bc3e526982c0eef Stats: 569 lines in 41 files changed: 216 ins; 268 del; 85 mod 8371388: [BACKOUT] JDK-8365047: Remove exception handler stub code in C2 Reviewed-by: chagedorn, epeter ------------- PR: https://git.openjdk.org/jdk/pull/28187 From eosterlund at openjdk.org Fri Nov 7 10:11:08 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Fri, 7 Nov 2025 10:11:08 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v16] In-Reply-To: References: Message-ID: > This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. > > The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. > > This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. > > The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. > > The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. > > Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. > Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the order they are laid out in... Erik ?sterlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 32 commits: - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Comment update - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - remove include - Interned string value word accounting - Dont load all objects when JVMTI CFLH is on - Remove duplicate string dedup disabling when dumping - Accept interned strings sharing value with another string - ... and 22 more: https://git.openjdk.org/jdk/compare/e34a8318...7e3dee89 ------------- Changes: https://git.openjdk.org/jdk/pull/27732/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27732&range=15 Stats: 8722 lines in 106 files changed: 5941 ins; 2318 del; 463 mod Patch: https://git.openjdk.org/jdk/pull/27732.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27732/head:pull/27732 PR: https://git.openjdk.org/jdk/pull/27732 From aboldtch at openjdk.org Fri Nov 7 11:10:10 2025 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Fri, 7 Nov 2025 11:10:10 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v16] In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 10:11:08 GMT, Erik ?sterlund wrote: >> This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. >> >> The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. >> >> This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. >> >> The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. >> >> The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. >> >> Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. >> Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the or... > > Erik ?sterlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 32 commits: > > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Comment update > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - remove include > - Interned string value word accounting > - Dont load all objects when JVMTI CFLH is on > - Remove duplicate string dedup disabling when dumping > - Accept interned strings sharing value with another string > - ... and 22 more: https://git.openjdk.org/jdk/compare/e34a8318...7e3dee89 Final merges looks good. ------------- Marked as reviewed by aboldtch (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27732#pullrequestreview-3433114312 From duke at openjdk.org Fri Nov 7 11:14:58 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 11:14:58 GMT Subject: RFR: 8371458: [REDO] - Remove exception handler stub code in C2 Message-ID: The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. ------------- Commit messages: - x86: Fix post-call NOP check access outside code blob - Rename deoptHandlerOffsetField -> deoptHandlerEntryOffsetField - Merge from the main branch - Address review comments and fix a mistype - Check for NOP and MOVK separately in NativePostCallNop - Test for deoptimization in virtual threads - Merge from the main branch - Address review comments - Address review comments - Address review comments - ... and 6 more: https://git.openjdk.org/jdk/compare/1922c4fd...7bb43523 Changes: https://git.openjdk.org/jdk/pull/28192/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371458 Stats: 571 lines in 42 files changed: 269 ins; 216 del; 86 mod Patch: https://git.openjdk.org/jdk/pull/28192.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28192/head:pull/28192 PR: https://git.openjdk.org/jdk/pull/28192 From duke at openjdk.org Fri Nov 7 11:19:03 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 11:19:03 GMT Subject: RFR: 8371458: [REDO] - Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: <4Cyqe6dY27J8AnLfhLTyrliGYxnMdCJtAdGfJy2Ypxw=.cd37b689-667d-4e55-888b-fc4b7d440792@github.com> On Fri, 7 Nov 2025 11:07:40 GMT, Ruben wrote: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > Thanks @ruben-arm. Let's go with this clean back out for now - testing just came back clean. Once you have the REDO ready, I can submit some more sophisticated testing to make sure it addresses the issues we're seeing. @TobiHartmann, I would appreciate it if you could initiate the extended testing for this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3501950023 From thartmann at openjdk.org Fri Nov 7 12:03:01 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 7 Nov 2025 12:03:01 GMT Subject: RFR: 8371458: [REDO] - Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 11:07:40 GMT, Ruben wrote: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. Sure, I submitted testing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3502158718 From eosterlund at openjdk.org Fri Nov 7 12:57:49 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Fri, 7 Nov 2025 12:57:49 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v17] In-Reply-To: References: Message-ID: > This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. > > The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. > > This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. > > The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. > > The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. > > Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. > Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the order they are laid out in... Erik ?sterlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 34 commits: - Fix test group anomaly - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Comment update - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - Merge branch 'master' into 8326035_JEP_object_streaming_v6 - remove include - Interned string value word accounting - Dont load all objects when JVMTI CFLH is on - ... and 24 more: https://git.openjdk.org/jdk/compare/167c952b...754006b5 ------------- Changes: https://git.openjdk.org/jdk/pull/27732/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27732&range=16 Stats: 8724 lines in 107 files changed: 5942 ins; 2318 del; 464 mod Patch: https://git.openjdk.org/jdk/pull/27732.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27732/head:pull/27732 PR: https://git.openjdk.org/jdk/pull/27732 From aboldtch at openjdk.org Fri Nov 7 12:57:49 2025 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Fri, 7 Nov 2025 12:57:49 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v17] In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 12:54:27 GMT, Erik ?sterlund wrote: >> This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. >> >> The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. >> >> This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. >> >> The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. >> >> The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. >> >> Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. >> Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the or... > > Erik ?sterlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 34 commits: > > - Fix test group anomaly > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Comment update > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - Merge branch 'master' into 8326035_JEP_object_streaming_v6 > - remove include > - Interned string value word accounting > - Dont load all objects when JVMTI CFLH is on > - ... and 24 more: https://git.openjdk.org/jdk/compare/167c952b...754006b5 Marked as reviewed by aboldtch (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27732#pullrequestreview-3433727151 From eosterlund at openjdk.org Fri Nov 7 14:50:52 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Fri, 7 Nov 2025 14:50:52 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v18] In-Reply-To: References: Message-ID: > This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. > > The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. > > This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. > > The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. > > The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. > > Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. > Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the order they are laid out in... Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: Remove -server in test for static GHA build ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27732/files - new: https://git.openjdk.org/jdk/pull/27732/files/754006b5..84d79301 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27732&range=17 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27732&range=16-17 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27732.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27732/head:pull/27732 PR: https://git.openjdk.org/jdk/pull/27732 From aboldtch at openjdk.org Fri Nov 7 14:50:53 2025 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Fri, 7 Nov 2025 14:50:53 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v18] In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 14:47:07 GMT, Erik ?sterlund wrote: >> This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. >> >> The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. >> >> This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. >> >> The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. >> >> The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. >> >> Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. >> Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the or... > > Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: > > Remove -server in test for static GHA build Marked as reviewed by aboldtch (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27732#pullrequestreview-3434398193 From sgehwolf at openjdk.org Fri Nov 7 15:28:01 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 7 Nov 2025 15:28:01 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: References: Message-ID: > Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. > > For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `y=` and `x=`): > > > f(x) = {(x - 2) \times 9999 + 1 \over 262142} > > > This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: > > > f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} > > > Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. > > Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. > > Thoughts? > > **Testing:** > - [x] GHA > - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. 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 five additional commits since the last revision: - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping - Fix include - Add asserts/checks for input domain - Add regression test for jdk-8370492 - 8370492: [Linux] Update cpu shares to cpu.weight mapping function ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28157/files - new: https://git.openjdk.org/jdk/pull/28157/files/2866c0a7..464d162f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=00-01 Stats: 17030 lines in 439 files changed: 10578 ins; 4853 del; 1599 mod Patch: https://git.openjdk.org/jdk/pull/28157.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28157/head:pull/28157 PR: https://git.openjdk.org/jdk/pull/28157 From eosterlund at openjdk.org Fri Nov 7 15:28:46 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Fri, 7 Nov 2025 15:28:46 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v18] In-Reply-To: References: Message-ID: <4O9v08uY1viSeMh_w821RNfKj67p74y2PqDrB8GdZCs=.e21a3d53-4a00-4f4a-99dc-589b1044d7bd@github.com> On Fri, 7 Nov 2025 14:50:52 GMT, Erik ?sterlund wrote: >> This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. >> >> The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. >> >> This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. >> >> The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. >> >> The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. >> >> Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. >> Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the or... > > Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: > > Remove -server in test for static GHA build Thank you for the reviews everyone! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27732#issuecomment-3503184650 From eosterlund at openjdk.org Fri Nov 7 15:32:03 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Fri, 7 Nov 2025 15:32:03 GMT Subject: Integrated: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 15:18:16 GMT, Erik ?sterlund wrote: > This is the implementation of JEP 516: Ahead-of-Time Object Caching with Any GC. > > The current mechanism for the AOT cache to cache heap objects is by using mmap to place bytes from a file directly in the GC managed heap. This mechanism poses compatibility challenges that all GCs have to have bit by bit identical object and reference formats, as the layout decisions are offline. This has so far meant that AOT cache optimizations requiring heap objects are not available when using ZGC. This work ensures that all GCs, including ZGC, are able to use the more advanced AOT cache functionality going forward. > > This JEP introduces a new mechanism for archiving a primordial heap, without such compatibility problems. It embraces online layouts and allocates objects one by one, linking them using the Access API, like normal objects. This way, archived objects quack like any other object to the GC, and the GC implementations are decoupled from the archiving mechanism. > > The key to doing this GC agnostic object loading is to represent object references between objects as object indices (e.g. 1, 2, 3) instead of raw pointers that we hope all GCs will recognise the same. These object indices become the key way of identifying objects. One table maps object indices to archived objects, and another table maps object indices to heap objects that have been allocated at runtime. This allows online linking of the materialized heap objects. > > The main interface to the cached heap is roots. Different components can register object roots at dump time. Each root gets assigned a root index. At runtime, requests can be made to get a reference to an object at a root index. The new implementation uses lazy materialization and concurrency. When a thread asks for a root object, it must ensure that the given root object and its transitively reachable objects are reachable. A new background thread called the AOTThread, tries to perform the bulk of the work, so that the startup impact of processing the objects one by one is not impacting the bootstrapping thread. > > Since the background thread performs the bulk of the work, the archived is laid out to ensure it can run as fast as possible. > Objects are laid out inf DFS pre order over the roots in the archive, such that the object indices and the DFS traversal orders are the same. This way, the DFS traversal that the background thread is performing is the same order as linearly materializing the objects one by one in the order they are laid out in... This pull request has now been integrated. Changeset: c8656449 Author: Erik ?sterlund URL: https://git.openjdk.org/jdk/commit/c8656449c28581ae9c3d815105e338e42253bb43 Stats: 8726 lines in 108 files changed: 5942 ins; 2318 del; 466 mod 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC Co-authored-by: Axel Boldt-Christmas Co-authored-by: Joel Sikstr?m Co-authored-by: Stefan Karlsson Reviewed-by: aboldtch, iklam, kvn ------------- PR: https://git.openjdk.org/jdk/pull/27732 From kvn at openjdk.org Fri Nov 7 15:34:27 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Fri, 7 Nov 2025 15:34:27 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: <4Cyqe6dY27J8AnLfhLTyrliGYxnMdCJtAdGfJy2Ypxw=.cd37b689-667d-4e55-888b-fc4b7d440792@github.com> References: <4Cyqe6dY27J8AnLfhLTyrliGYxnMdCJtAdGfJy2Ypxw=.cd37b689-667d-4e55-888b-fc4b7d440792@github.com> Message-ID: On Fri, 7 Nov 2025 11:16:20 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > >> Thanks @ruben-arm. Let's go with this clean back out for now - testing just came back clean. Once you have the REDO ready, I can submit some more sophisticated testing to make sure it addresses the issues we're seeing. > > @TobiHartmann, I would appreciate it if you could initiate the extended testing for this PR. @ruben-arm what was the issue in the original changes? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3503214174 From duke at openjdk.org Fri Nov 7 15:50:04 2025 From: duke at openjdk.org (Ruben) Date: Fri, 7 Nov 2025 15:50:04 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: References: <4Cyqe6dY27J8AnLfhLTyrliGYxnMdCJtAdGfJy2Ypxw=.cd37b689-667d-4e55-888b-fc4b7d440792@github.com> Message-ID: On Fri, 7 Nov 2025 15:31:27 GMT, Vladimir Kozlov wrote: >>> Thanks @ruben-arm. Let's go with this clean back out for now - testing just came back clean. Once you have the REDO ready, I can submit some more sophisticated testing to make sure it addresses the issues we're seeing. >> >> @TobiHartmann, I would appreciate it if you could initiate the extended testing for this PR. > > @ruben-arm what was the issue in the original changes? @vnkozlov, the `NativePostCallNop::check` https://github.com/openjdk/jdk/blob/e34a831814996be3e0a2df86b11b1718a76ea558/src/hotspot/cpu/x86/nativeInst_x86.hpp#L584 was reading 4 bytes from the perceived call site. That works when the check happens for an actual call site, as the post-call NOP sequence is always longer than 4 bytes. However, it fails in case the return address in the stack frame, during deoptimization, is patched to point to the deoptimization stub code entry point. With the change, the distance between the entry point and end of code blob can now be just 2 bytes - consequently the 4-bytes read would read outside the code blob. The proposed fix is to split the read in the post-call NOP check into two 2-byte reads. If first read+comparison doesn't confirm it might be a post-call NOP sequence (it never will for the deoptimization stub code entry point) the second read wouldn't happen. I initially missed this issue - having incorrectly concluded that the `jmp` at the entry point will take 5 bytes in size instead of 2 bytes. https://github.com/openjdk/jdk/pull/28192/commits/7bb43523b3c9d1495d72a5bc75c3912c3f51e64c should address this issue by splitting the faulting read into two. It also adjusts the expected size of deoptimization handler stub code to 7 bytes in total instead of the incorrect estimate of 10 bytes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3503297153 From sgehwolf at openjdk.org Fri Nov 7 17:43:18 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 7 Nov 2025 17:43:18 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 Message-ID: Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. Testing (all on Linux x86_64): - [x] CG version 2, run as root. Engine: docker. Test is skipped. - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) - [X] CG version 1, run as non-root. Test skipped. - [x] GHA, though I don't think this is very useful for this change. Thoughts? ------------- Commit messages: - 8370966: Create regression test for hierarchical memory limit fix in JDK-8370572 Changes: https://git.openjdk.org/jdk/pull/28201/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28201&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370966 Stats: 191 lines in 8 files changed: 154 ins; 32 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/28201.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28201/head:pull/28201 PR: https://git.openjdk.org/jdk/pull/28201 From sspitsyn at openjdk.org Sat Nov 8 00:27:20 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Sat, 8 Nov 2025 00:27:20 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Message-ID: This is fix is to increase the `EXPECTED_ACCURACY` value in the test: `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. Testing: - TBD: Verify the test with mach5 test runs ------------- Commit messages: - 8349192: Test jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Changes: https://git.openjdk.org/jdk/pull/28206/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28206&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8349192 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28206.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28206/head:pull/28206 PR: https://git.openjdk.org/jdk/pull/28206 From duke at openjdk.org Sat Nov 8 00:38:16 2025 From: duke at openjdk.org (Chad Rakoczy) Date: Sat, 8 Nov 2025 00:38:16 GMT Subject: RFR: 8369147: Various issues with new tests added by JDK-8316694 [v3] In-Reply-To: References: <8UVgF0vLaZhY7zvKWPBLXoU9p71SevknlPYC5LPsfCo=.8531cacc-ff26-42be-a517-88ff87628d29@github.com> <0ZFCDTQAFKjZ5XDtUXWsvC4v0lyot7Trdf3wlIxrb-M=.988407f3-6353-447a-98d6-f890b795fd1d@github.com> Message-ID: On Mon, 27 Oct 2025 18:08:40 GMT, Chad Rakoczy wrote: >>> @chadrako, is PR ready for testing now? >> >> Yes > >> @chadrako I think my suggestion was not correct. We should revert back to your first changes for `@requires`. Original code was correct and only `serviceability/jvmti/NMethodRelocation/NMethodRelocationTest.java` missed it. > > Since the tests get run with different GCs anyways I don't think we need to explicitly require the GC that they run with and just have one test config > FTR, even with this fix, we still see failures: [JDK-8371121](https://bugs.openjdk.org/browse/JDK-8371121), [JDK-8371046](https://bugs.openjdk.org/browse/JDK-8371046), [JDK-8369150](https://bugs.openjdk.org/browse/JDK-8369150). @chadrako It would be great if you could prioritize fixing these remaining issues, as the failures cause quite some noise in our testing. Thanks! @TobiHartmann I apologize for the noise and appreciate you bringing these to my attention. I am prioritizing the fixes and will keep the JBS issues updated with my progress. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27659#issuecomment-3505482325 From syan at openjdk.org Sat Nov 8 08:17:39 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 8 Nov 2025 08:17:39 GMT Subject: RFR: 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests Message-ID: <7kEYqfoRzlpl7vu5PbOXazM0R9E4NTu57jBH7jVSty4=.ca25f1a2-fb52-4e1b-b7b8-bd81493bc594@github.com> Hi all, The DockerTestUtils.RETAIN_IMAGE_AFTER_TEST variable which read the property from "jdk.test.docker.retain.image" do not work for some of the docker tests, such as jdk/internal/platform/docker/TestDockerCpuMetrics.java, only works for some of the docker tests, such as jdk/internal/platform/docker/TestPidsLimit.java. This PR read the DockerTestUtils.RETAIN_IMAGE_AFTER_TEST inside function removeDockerImage instead of before all the fucntion removeDockerImage. This will make all the docker tests receive the property jdk.test.docker.retain.image. Change has been verified locally on linux-x64 by run the all touched tests. ------------- Commit messages: - 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests Changes: https://git.openjdk.org/jdk/pull/28208/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28208&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371503 Stats: 39 lines in 11 files changed: 2 ins; 20 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/28208.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28208/head:pull/28208 PR: https://git.openjdk.org/jdk/pull/28208 From syan at openjdk.org Sat Nov 8 08:23:02 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 8 Nov 2025 08:23:02 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) In-Reply-To: References: Message-ID: On Sat, 8 Nov 2025 00:15:24 GMT, Serguei Spitsyn wrote: > This is fix is to increase the `EXPECTED_ACCURACY` value in the test: > `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. > It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. > > Testing: > - TBD: Verify the test with mach5 test runs test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp line 43: > 41: > 42: #if (defined(WIN32) || defined(_WIN32)) > 43: static const jlong EXPECTED_ACCURACY = 32; // 16ms is longest clock update interval Does the comment 16ms should be updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2506407679 From lmesnik at openjdk.org Sat Nov 8 21:34:11 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Sat, 8 Nov 2025 21:34:11 GMT Subject: RFR: 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing In-Reply-To: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> References: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> Message-ID: On Thu, 6 Nov 2025 21:26:24 GMT, Leonid Mesnik wrote: > The problem happens because jvmti events are posted while handling JvmtiThreadState_lock. The fix just to move > flushing out of lock like it is already done in `JvmtiEventController::set_user_enabled(..)` method. > > The problem start reproducing after fix for https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from slow and unreliable `ClassUnloader.eatMemory();` to fast and robust`WhiteBox.fullGC()`. > > The jvmti events posting is not synchronized with enabling/disabling events and setting callbacks. So even if there are new events appear in the jvmti tagmap after flushing it is not a bug to don't post them or use new callback handler. > > Also, it might be makes sense to flush object events before vm_death and post all deferred events from SerrviceThread queue. > I am going to file separate RFE for this. > Also, I am going to file RFE to replace all GC provoking the `eatMemory()` calls with `WB.fullGC()` to improve test stability and reduce test execution time. @sspitsyn, @alexmenkov Thank you for review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28184#issuecomment-3506944399 From lmesnik at openjdk.org Sat Nov 8 21:34:11 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Sat, 8 Nov 2025 21:34:11 GMT Subject: Integrated: 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing In-Reply-To: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> References: <0TSSeNB540PtvusDCXFoYLc4TJm8GJMeBlExphuFDic=.5ff05b43-91c3-497f-b17a-1887c538c1ce@github.com> Message-ID: On Thu, 6 Nov 2025 21:26:24 GMT, Leonid Mesnik wrote: > The problem happens because jvmti events are posted while handling JvmtiThreadState_lock. The fix just to move > flushing out of lock like it is already done in `JvmtiEventController::set_user_enabled(..)` method. > > The problem start reproducing after fix for https://bugs.openjdk.org/browse/JDK-8370732 that replaced GC triggering from slow and unreliable `ClassUnloader.eatMemory();` to fast and robust`WhiteBox.fullGC()`. > > The jvmti events posting is not synchronized with enabling/disabling events and setting callbacks. So even if there are new events appear in the jvmti tagmap after flushing it is not a bug to don't post them or use new callback handler. > > Also, it might be makes sense to flush object events before vm_death and post all deferred events from SerrviceThread queue. > I am going to file separate RFE for this. > Also, I am going to file RFE to replace all GC provoking the `eatMemory()` calls with `WB.fullGC()` to improve test stability and reduce test execution time. This pull request has now been integrated. Changeset: 88c4678e Author: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/88c4678eed818cbe9380f35352e90883fed27d33 Stats: 8 lines in 2 files changed: 4 ins; 4 del; 0 mod 8371103: vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/TestDescription.java failing Reviewed-by: amenkov, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28184 From sspitsyn at openjdk.org Sun Nov 9 10:30:45 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Sun, 9 Nov 2025 10:30:45 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: Message-ID: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> > This is fix is to increase the `EXPECTED_ACCURACY` value in the test: > `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. > It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. > > Testing: > - TBD: Verify the test with mach5 test runs Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: restore original EXPECTED_ACCURACY for Windows ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28206/files - new: https://git.openjdk.org/jdk/pull/28206/files/1df4f7d3..c53f9b40 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28206&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28206&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28206.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28206/head:pull/28206 PR: https://git.openjdk.org/jdk/pull/28206 From sspitsyn at openjdk.org Sun Nov 9 10:30:45 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Sun, 9 Nov 2025 10:30:45 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: Message-ID: On Sat, 8 Nov 2025 08:20:19 GMT, SendaoYan wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: restore original EXPECTED_ACCURACY for Windows > > test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp line 43: > >> 41: >> 42: #if (defined(WIN32) || defined(_WIN32)) >> 43: static const jlong EXPECTED_ACCURACY = 32; // 16ms is longest clock update interval > > Does the comment 16ms should be updated. Thank you for the comment. I've decided to restore the original `EXPECTED_ACCURACY` on Windows. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2507835929 From syan at openjdk.org Mon Nov 10 06:24:07 2025 From: syan at openjdk.org (SendaoYan) Date: Mon, 10 Nov 2025 06:24:07 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 15:28:01 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `y=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > 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 five additional commits since the last revision: > > - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping > - Fix include > - Add asserts/checks for input domain > - Add regression test for jdk-8370492 > - 8370492: [Linux] Update cpu shares to cpu.weight mapping function test/hotspot/jtreg/containers/docker/TestMisc.java line 43: > 41: import jdk.test.lib.process.OutputAnalyzer; > 42: import jdk.test.lib.process.ProcessTools; > 43: import jtreg.SkippedException; Does this import 'import jtreg.SkippedException;' really needed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2508898251 From syan at openjdk.org Mon Nov 10 06:43:03 2025 From: syan at openjdk.org (SendaoYan) Date: Mon, 10 Nov 2025 06:43:03 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 15:28:01 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `y=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > 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 five additional commits since the last revision: > > - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping > - Fix include > - Add asserts/checks for input domain > - Add regression test for jdk-8370492 > - 8370492: [Linux] Update cpu shares to cpu.weight mapping function Before apply the propose patch, test jdk/internal/platform/docker/TestDockerCpuMetrics.java run failed. After apply the propose patch, test jdk/internal/platform/docker/TestDockerCpuMetrics.java run passed. test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java line 151: > 149: // have a 1-to-1 mapping from the cgroup v2 value to the OCI > 150: // value. > 151: System.out.println("Debug: cgv2 - Got CPU shares of: " + I found you 'import jtreg.SkippedException;' on file test/hotspot/jtreg/containers/docker/TestMisc.java. Do you want to 'throw new SkippedException' rather that just print 'Skipping assert' ------------- PR Review: https://git.openjdk.org/jdk/pull/28157#pullrequestreview-3441113583 PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2508932192 From syan at openjdk.org Mon Nov 10 06:54:02 2025 From: syan at openjdk.org (SendaoYan) Date: Mon, 10 Nov 2025 06:54:02 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 16:41:26 GMT, Severin Gehwolf wrote: > Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. > > The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. > > Testing (all on Linux x86_64): > - [x] CG version 2, run as root. Engine: docker. Test is skipped. > - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [X] CG version 1, run as non-root. Test skipped. > - [x] GHA, though I don't think this is very useful for this change. > > Thoughts? test/hotspot/jtreg/containers/docker/TestMemoryInvisibleParent.java line 2: > 1: /* > 2: * Copyright (C) 2025, IBM Copyright (c) 2025 IBM Corporation. All rights reserved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28201#discussion_r2508961551 From sgehwolf at openjdk.org Mon Nov 10 09:25:05 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 09:25:05 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 06:38:46 GMT, SendaoYan wrote: >> 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 five additional commits since the last revision: >> >> - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping >> - Fix include >> - Add asserts/checks for input domain >> - Add regression test for jdk-8370492 >> - 8370492: [Linux] Update cpu shares to cpu.weight mapping function > > test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java line 151: > >> 149: // have a 1-to-1 mapping from the cgroup v2 value to the OCI >> 150: // value. >> 151: System.out.println("Debug: cgv2 - Got CPU shares of: " + > > I found you 'import jtreg.SkippedException;' on file test/hotspot/jtreg/containers/docker/TestMisc.java. Do you want to 'throw new SkippedException' rather that just print 'Skipping assert' I'd rather not, since by throwing `SkippedException` the other tests won't run either. It's useful to see various values for the back-mapped value. In this case it should be a value < 1024 which is asserted by the if. Later, we have actual assertions in the test for `1024` and `2048`. Does that make sense? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2509490319 From shade at openjdk.org Mon Nov 10 09:26:06 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 10 Nov 2025 09:26:06 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 16:41:26 GMT, Severin Gehwolf wrote: > Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. > > The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. > > Testing (all on Linux x86_64): > - [x] CG version 2, run as root. Engine: docker. Test is skipped. > - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [X] CG version 1, run as non-root. Test skipped. > - [x] GHA, though I don't think this is very useful for this change. > > Thoughts? Looks fine, a few nits. test/hotspot/jtreg/containers/docker/TestMemoryInvisibleParent.java line 96: > 94: opts.addDockerOpts("--cgroup-parent=/" + cgroupParent); > 95: Common.run(opts) > 96: .shouldContain("Hierarchical Memory Limit is: " + expectedValue); Indenting a a bit off here. test/hotspot/jtreg/containers/docker/TestMemoryInvisibleParent.java line 107: > 105: Path sysFsMemory = Path.of("/", "sys", "fs", "cgroup", "memory"); > 106: Path cgroupParentPath = sysFsMemory.resolve(cgroupParent); > 107: ProcessBuilder pb = new ProcessBuilder("mkdir", "-p", cgroupParentPath.toString()); So I am guessing we are fine with leaving this cgroup behind, after the test is done? ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28201#pullrequestreview-3441857489 PR Review Comment: https://git.openjdk.org/jdk/pull/28201#discussion_r2509492642 PR Review Comment: https://git.openjdk.org/jdk/pull/28201#discussion_r2509498605 From sgehwolf at openjdk.org Mon Nov 10 09:29:01 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 09:29:01 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 In-Reply-To: References: Message-ID: <0aHFgeT-Ikjw_Ad_evc1OoWZ97gBC-nD-_8UdoXiyO4=.ff3d18a7-35d1-4828-b8bb-3cd9db962283@github.com> On Mon, 10 Nov 2025 09:23:36 GMT, Aleksey Shipilev wrote: >> Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. >> >> The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. >> >> Testing (all on Linux x86_64): >> - [x] CG version 2, run as root. Engine: docker. Test is skipped. >> - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [X] CG version 1, run as non-root. Test skipped. >> - [x] GHA, though I don't think this is very useful for this change. >> >> Thoughts? > > test/hotspot/jtreg/containers/docker/TestMemoryInvisibleParent.java line 107: > >> 105: Path sysFsMemory = Path.of("/", "sys", "fs", "cgroup", "memory"); >> 106: Path cgroupParentPath = sysFsMemory.resolve(cgroupParent); >> 107: ProcessBuilder pb = new ProcessBuilder("mkdir", "-p", cgroupParentPath.toString()); > > So I am guessing we are fine with leaving this cgroup behind, after the test is done? Yes. Unfortunately it's not easy to remove that. However, the test itself resets it to "unlimited" by setting the limit to `-1`. So it shouldn't make a difference. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28201#discussion_r2509510367 From syan at openjdk.org Mon Nov 10 09:41:03 2025 From: syan at openjdk.org (SendaoYan) Date: Mon, 10 Nov 2025 09:41:03 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: References: Message-ID: <91Wq6atcQ-B9y-oxN4qsk4F80m8jw53pbmzXcVxx_sQ=.18f531f3-921b-48df-8048-550441aa2b95@github.com> On Mon, 10 Nov 2025 09:22:01 GMT, Severin Gehwolf wrote: >> test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java line 151: >> >>> 149: // have a 1-to-1 mapping from the cgroup v2 value to the OCI >>> 150: // value. >>> 151: System.out.println("Debug: cgv2 - Got CPU shares of: " + >> >> I found you 'import jtreg.SkippedException;' on file test/hotspot/jtreg/containers/docker/TestMisc.java. Do you want to 'throw new SkippedException' rather that just print 'Skipping assert' > > I'd rather not, since by throwing `SkippedException` the other tests won't run either. It's useful to see various values for the back-mapped value. In this case it should be a value < 1024 which is asserted by the if. Later, we have actual assertions in the test for `1024` and `2048`. Does that make sense? So does the 'import jtreg.SkippedException;' in file test/hotspot/jtreg/containers/docker/TestMisc.java seems do not needed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2509574859 From thartmann at openjdk.org Mon Nov 10 10:16:06 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Mon, 10 Nov 2025 10:16:06 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: <7LtvXdcfrqOlHXnsZlsA5Kvf2RJXVt1I8IoVYz7Uj90=.eda5d489-7fbf-4051-88be-fd3c183761f6@github.com> On Fri, 7 Nov 2025 12:00:23 GMT, Tobias Hartmann wrote: > Sure, I submitted testing. All testing passed. I leave it to the original reviewers to re-review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3510638686 From sgehwolf at openjdk.org Mon Nov 10 10:22:07 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 10:22:07 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v2] In-Reply-To: <91Wq6atcQ-B9y-oxN4qsk4F80m8jw53pbmzXcVxx_sQ=.18f531f3-921b-48df-8048-550441aa2b95@github.com> References: <91Wq6atcQ-B9y-oxN4qsk4F80m8jw53pbmzXcVxx_sQ=.18f531f3-921b-48df-8048-550441aa2b95@github.com> Message-ID: On Mon, 10 Nov 2025 09:38:32 GMT, SendaoYan wrote: >> I'd rather not, since by throwing `SkippedException` the other tests won't run either. It's useful to see various values for the back-mapped value. In this case it should be a value < 1024 which is asserted by the if. Later, we have actual assertions in the test for `1024` and `2048`. Does that make sense? > > So does the 'import jtreg.SkippedException;' in file test/hotspot/jtreg/containers/docker/TestMisc.java seems do not needed Yes, indeed. I'll remove it from `test/hotspot/jtreg/containers/docker/TestMisc.java` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2509756250 From mdoerr at openjdk.org Mon Nov 10 10:54:07 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 10 Nov 2025 10:54:07 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 11:07:40 GMT, Ruben wrote: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. I haven't checked the deopt handler size on x86. Otherwise, it still looks good to me. src/hotspot/cpu/x86/nativeInst_x86.hpp line 585: > 583: }; > 584: > 585: bool check() const { return short_at(0) == 0x1f0f && short_at(2) == 0x0084; } Maybe a comment would be nice. ------------- Marked as reviewed by mdoerr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28192#pullrequestreview-3442431963 PR Review Comment: https://git.openjdk.org/jdk/pull/28192#discussion_r2509917846 From duke at openjdk.org Mon Nov 10 13:00:55 2025 From: duke at openjdk.org (Anton Artemov) Date: Mon, 10 Nov 2025 13:00:55 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: Message-ID: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Added a comment to a boolean arg for enter() - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed new lines. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Removed incorrect assert, - 8366659: Fixed merge conflict - 8366659: Fixed whitespace. - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 ------------- Changes: https://git.openjdk.org/jdk/pull/27040/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=03 Stats: 374 lines in 3 files changed: 310 ins; 44 del; 20 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From duke at openjdk.org Mon Nov 10 14:27:52 2025 From: duke at openjdk.org (Ruben) Date: Mon, 10 Nov 2025 14:27:52 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: <7LtvXdcfrqOlHXnsZlsA5Kvf2RJXVt1I8IoVYz7Uj90=.eda5d489-7fbf-4051-88be-fd3c183761f6@github.com> References: <7LtvXdcfrqOlHXnsZlsA5Kvf2RJXVt1I8IoVYz7Uj90=.eda5d489-7fbf-4051-88be-fd3c183761f6@github.com> Message-ID: On Mon, 10 Nov 2025 10:13:20 GMT, Tobias Hartmann wrote: >> Sure, I submitted testing. > >> Sure, I submitted testing. > > All testing passed. I leave it to the original reviewers to re-review. Thanks, @TobiHartmann, for the extra tests, and apologies for missing this in the original PR. @TheRealMDoerr, I will update the PR to add comments. I am exploring a possibility to add a unit test for this issue, but I have not identified a deterministic way to make the deopt handler stub end at a page boundary. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3511994160 From cjplummer at openjdk.org Mon Nov 10 17:10:31 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 10 Nov 2025 17:10:31 GMT Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes Message-ID: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint. This PR focuses on purging virtual thread ThreadNodes in two places: 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread. 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all" At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event. Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist. At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not. Tested by running all tier2, tier5, and tier6 CI svc tests. ------------- Commit messages: - update copyright - ThreadNode cleanup Changes: https://git.openjdk.org/jdk/pull/28211/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8282441 Stats: 238 lines in 1 file changed: 185 ins; 38 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/28211.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28211/head:pull/28211 PR: https://git.openjdk.org/jdk/pull/28211 From cjplummer at openjdk.org Mon Nov 10 17:10:35 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 10 Nov 2025 17:10:35 GMT Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> Message-ID: On Mon, 10 Nov 2025 03:15:06 GMT, Chris Plummer wrote: > This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint. > > This PR focuses on purging virtual thread ThreadNodes in two places: > > 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread. > 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all" > > At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event. > > Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist. > > At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not. > > Tested by running all tier2, tier5, and tier6 CI svc tests. src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 431: > 429: } > 430: #endif > 431: I moved this to earlier in the function because at one point I was using the thread name in some debug printfs, and the thread name was being setup too late. I decided to keep it here just in case I need to do that again in the future. src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 1356: > 1354: } else { > 1355: *count = 0; > 1356: } This change could use some explaining to help with the review. After this change the code is back to what it was before vthread support was added. This extra work was needed because sometimes the ThreadNode for the vthread did not already exist. Since now findRunningThread() will create the ThreadNode, there is no longer a need for this code to deal with it not existing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2508595620 PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2508599927 From sgehwolf at openjdk.org Mon Nov 10 17:43:02 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 17:43:02 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 [v2] In-Reply-To: References: Message-ID: > Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. > > The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. > > Testing (all on Linux x86_64): > - [x] CG version 2, run as root. Engine: docker. Test is skipped. > - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [X] CG version 1, run as non-root. Test skipped. > - [x] GHA, though I don't think this is very useful for this change. > > Thoughts? Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: Indenting and copyright ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28201/files - new: https://git.openjdk.org/jdk/pull/28201/files/86f8e1b8..faeff2a1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28201&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28201&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28201.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28201/head:pull/28201 PR: https://git.openjdk.org/jdk/pull/28201 From sgehwolf at openjdk.org Mon Nov 10 17:43:03 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 17:43:03 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 16:41:26 GMT, Severin Gehwolf wrote: > Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. > > The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. > > Testing (all on Linux x86_64): > - [x] CG version 2, run as root. Engine: docker. Test is skipped. > - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [X] CG version 1, run as non-root. Test skipped. > - [x] GHA, though I don't think this is very useful for this change. > > Thoughts? Thanks for the reviews. Updated the patch. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28201#issuecomment-3513094003 From sgehwolf at openjdk.org Mon Nov 10 17:43:05 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 17:43:05 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 [v2] In-Reply-To: References: Message-ID: <1qZYZuODZnsxbV1e3S7_xemZyrGNBwtBuUns2K1hJrU=.c0282af9-4ed8-4b52-82f9-6b4f62b41ae8@github.com> On Mon, 10 Nov 2025 06:51:01 GMT, SendaoYan wrote: >> Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: >> >> Indenting and copyright > > test/hotspot/jtreg/containers/docker/TestMemoryInvisibleParent.java line 2: > >> 1: /* >> 2: * Copyright (C) 2025, IBM > > Copyright (c) 2025 IBM Corporation. All rights reserved. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28201#discussion_r2511417869 From shade at openjdk.org Mon Nov 10 17:45:17 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 10 Nov 2025 17:45:17 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 [v2] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 17:43:02 GMT, Severin Gehwolf wrote: >> Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. >> >> The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. >> >> Testing (all on Linux x86_64): >> - [x] CG version 2, run as root. Engine: docker. Test is skipped. >> - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [X] CG version 1, run as non-root. Test skipped. >> - [x] GHA, though I don't think this is very useful for this change. >> >> Thoughts? > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Indenting and copyright Still good. ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28201#pullrequestreview-3444430112 From sgehwolf at openjdk.org Mon Nov 10 17:45:57 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Mon, 10 Nov 2025 17:45:57 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v3] In-Reply-To: References: Message-ID: > Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. > > For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): > > > f(x) = {(x - 2) \times 9999 + 1 \over 262142} > > > This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: > > > f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} > > > Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. > > Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. > > Thoughts? > > **Testing:** > - [x] GHA > - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: Remove SkippedException import ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28157/files - new: https://git.openjdk.org/jdk/pull/28157/files/464d162f..8ba999a9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28157.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28157/head:pull/28157 PR: https://git.openjdk.org/jdk/pull/28157 From amenkov at openjdk.org Mon Nov 10 21:01:53 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Mon, 10 Nov 2025 21:01:53 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS Message-ID: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER Testing: tier1..4,hs-tier5-svc ------------- Commit messages: - fix Changes: https://git.openjdk.org/jdk/pull/28224/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28224&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371083 Stats: 211 lines in 3 files changed: 208 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/28224.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28224/head:pull/28224 PR: https://git.openjdk.org/jdk/pull/28224 From acobbs at openjdk.org Mon Nov 10 22:24:52 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 10 Nov 2025 22:24:52 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression [v5] In-Reply-To: References: Message-ID: <26Gs2omFeLXWjo85AUbAb34PpolWLLsjB2aMS92fNKY=.04fb0491-212d-4212-9dde-08250f361053@github.com> > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 135 commits: - Suppress new unnecessary suppresion warnings created by recent commits. - Merge branch 'master' into JDK-8344159 - Merge branch 'master' into JDK-8344159 to fix conflict. - Merge branch 'master' into JDK-8344159 to fix conflict. - Merge branch 'master' into JDK-8344159 to fix conflicts. - Add clarifying comment. - Merge branch 'master' into JDK-8344159 - Change inner class name to avoid shadowing superclass name. - Add a couple of code clarification comments. - Refactor test to avoid requiring changes to TestRunner. - ... and 125 more: https://git.openjdk.org/jdk/compare/43afce54...aaf029e8 ------------- Changes: https://git.openjdk.org/jdk/pull/25167/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25167&range=04 Stats: 1667 lines in 35 files changed: 1492 ins; 49 del; 126 mod Patch: https://git.openjdk.org/jdk/pull/25167.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25167/head:pull/25167 PR: https://git.openjdk.org/jdk/pull/25167 From dcubed at openjdk.org Tue Nov 11 02:44:26 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Tue, 11 Nov 2025 02:44:26 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Mon, 10 Nov 2025 13:00:55 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - 8366659: Fixed whitespace. > - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. > - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 Vaious minor nits here with a couple of queries about why assert_mark_word_consistency calls were removed. During my crawl through I ran into quite a few nits and typos, but I'm putting those in a separate issue. Thanks for adding two new sub-test cases for better coverage. src/hotspot/share/runtime/objectMonitor.cpp line 533: > 531: } > 532: > 533: void ObjectMonitor::enter_with_contention_mark(JavaThread* current, ObjectMonitorContentionMark &cm, bool post_jvmti_events) { In the baseline also: `cm` is passed in, but it only used for this: `assert(cm._monitor == this, "must be");`. This makes me wonder if we're missing some code in `enter_with_contention_mark` that is normally done when we are passed an `ObjectMonitorContentionMark`. src/hotspot/share/runtime/objectMonitor.cpp line 1108: > 1106: assert(currentNode->_thread == current, "invariant"); > 1107: assert(_waiters > 0, "invariant"); > 1108: assert_mark_word_consistency(); Why remove call to `assert_mark_word_consistency();`? src/hotspot/share/runtime/objectMonitor.cpp line 1186: > 1184: // Current has acquired the lock -- Unlink current from the _entry_list. > 1185: assert(has_owner(current), "invariant"); > 1186: assert_mark_word_consistency(); Why remove call to `assert_mark_word_consistency();`? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 387: > 385: } > 386: try { Thread.sleep(1000); > 387: } catch(Exception e) {} Nit: The `Thread.sleep` call should be on its own line after L386. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 452: > 450: > 451: try { Thread.sleep(1000); > 452: } catch(Exception e) {} Nit: The Thread.sleep call should be on its own line after L451. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 506: > 504: } > 505: try { Thread.sleep(1000); > 506: } catch(Exception e) {} Nit: The Thread.sleep call should be on its own line after L505. ------------- Marked as reviewed by dcubed (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3444783084 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2511785347 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2511693213 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2511698003 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2512616795 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2512620831 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2512622710 From syan at openjdk.org Tue Nov 11 02:57:08 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 11 Nov 2025 02:57:08 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v3] In-Reply-To: References: Message-ID: <9_mUShL9w0WJOY_mRnI9Q6kjahjGy5C4r2nskAj84UU=.b998be5a-042f-4bcc-8eae-e5aaf485642c@github.com> On Mon, 10 Nov 2025 17:45:57 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Remove SkippedException import This fix works for me ------------- Marked as reviewed by syan (Committer). PR Review: https://git.openjdk.org/jdk/pull/28157#pullrequestreview-3446022550 From syan at openjdk.org Tue Nov 11 03:36:04 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 11 Nov 2025 03:36:04 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 [v2] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 17:43:02 GMT, Severin Gehwolf wrote: >> Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. >> >> The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. >> >> Testing (all on Linux x86_64): >> - [x] CG version 2, run as root. Engine: docker. Test is skipped. >> - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [X] CG version 1, run as non-root. Test skipped. >> - [x] GHA, though I don't think this is very useful for this change. >> >> Thoughts? > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Indenting and copyright The touch tests and new tests run passed on my local machine. ------------- Marked as reviewed by syan (Committer). PR Review: https://git.openjdk.org/jdk/pull/28201#pullrequestreview-3446098295 From lmesnik at openjdk.org Tue Nov 11 03:58:21 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 11 Nov 2025 03:58:21 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence Message-ID: Please review following fix that move GC shutdown start after VM Death and agent's unloading. The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. ------------- Commit messages: - 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence Changes: https://git.openjdk.org/jdk/pull/28227/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367902 Stats: 148 lines in 3 files changed: 145 ins; 3 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28227.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28227/head:pull/28227 PR: https://git.openjdk.org/jdk/pull/28227 From sgehwolf at openjdk.org Tue Nov 11 09:21:43 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 11 Nov 2025 09:21:43 GMT Subject: RFR: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 [v2] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 17:43:02 GMT, Severin Gehwolf wrote: >> Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. >> >> The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. >> >> Testing (all on Linux x86_64): >> - [x] CG version 2, run as root. Engine: docker. Test is skipped. >> - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) >> - [X] CG version 1, run as non-root. Test skipped. >> - [x] GHA, though I don't think this is very useful for this change. >> >> Thoughts? > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Indenting and copyright Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28201#issuecomment-3515752649 From sgehwolf at openjdk.org Tue Nov 11 09:21:45 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 11 Nov 2025 09:21:45 GMT Subject: Integrated: 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 In-Reply-To: References: Message-ID: On Fri, 7 Nov 2025 16:41:26 GMT, Severin Gehwolf wrote: > Please review this test-only enhancement. It creates a regression test for the Amazon ECS setup on cgroups v1 where the parent memory limit isn't visible inside the container and, thus, needs to rely on the cg v1 specific `hierarchical_memory_limit` token in `memory.stat`. The proposed test is cg v1 only and needs to be run as root. It's skipped otherwise. It's useful to have when working on refactorings like #27743 so as not to regress. > > The other changes are an effort to reduce code duplication in the test code where similar patterns have been used in other container tests. > > Testing (all on Linux x86_64): > - [x] CG version 2, run as root. Engine: docker. Test is skipped. > - [x] CG version 1, run as root. Engine: docker. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [x] CG version 1, run as root. Engine: podman. Test passes and fails without the product fix of [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) > - [X] CG version 1, run as non-root. Test skipped. > - [x] GHA, though I don't think this is very useful for this change. > > Thoughts? This pull request has now been integrated. Changeset: 29100320 Author: Severin Gehwolf URL: https://git.openjdk.org/jdk/commit/291003208c025ce4f9a94ba6093e207d0792bbb9 Stats: 191 lines in 8 files changed: 154 ins; 32 del; 5 mod 8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572 Reviewed-by: shade, syan ------------- PR: https://git.openjdk.org/jdk/pull/28201 From sgehwolf at openjdk.org Tue Nov 11 09:57:39 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 11 Nov 2025 09:57:39 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v4] In-Reply-To: References: Message-ID: > Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. > > For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): > > > f(x) = {(x - 2) \times 9999 + 1 \over 262142} > > > This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: > > > f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} > > > Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. > > Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. > > Thoughts? > > **Testing:** > - [x] GHA > - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. 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 seven additional commits since the last revision: - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping - Remove SkippedException import - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping - Fix include - Add asserts/checks for input domain - Add regression test for jdk-8370492 - 8370492: [Linux] Update cpu shares to cpu.weight mapping function ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28157/files - new: https://git.openjdk.org/jdk/pull/28157/files/8ba999a9..a2c6b160 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=02-03 Stats: 152084 lines in 669 files changed: 106238 ins; 18592 del; 27254 mod Patch: https://git.openjdk.org/jdk/pull/28157.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28157/head:pull/28157 PR: https://git.openjdk.org/jdk/pull/28157 From ayang at openjdk.org Tue Nov 11 10:06:14 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 11 Nov 2025 10:06:14 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence In-Reply-To: References: Message-ID: <53ymzoSHFWCq2NSuHUOoabHdtoU_uNHEDb2tshbiDh8=.836d28b5-4625-4c07-90ac-157a14ff7abd@github.com> On Tue, 11 Nov 2025 03:49:07 GMT, Leonid Mesnik wrote: > move GC shutdown start after VM Death and agent's unloading Is there a reason why `Universe::before_exit()` is moved down, instead of moving jvmti related calls (before `Universe::before_exit()`)? (The current patch would leave GC running while calling `MemMapPrinter::print_all_mappings(tty);` -- GC can potentially alter mappings.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/28227#issuecomment-3515988219 From stefank at openjdk.org Tue Nov 11 10:25:43 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 11 Nov 2025 10:25:43 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence In-Reply-To: References: Message-ID: <0QVCSBQR8WrlEi7MbVIPpwgk5ndxBkTi7i-uK2z8P9U=.b105574d-980d-4303-9186-fece5e73f94d@github.com> On Tue, 11 Nov 2025 03:49:07 GMT, Leonid Mesnik wrote: > Please review following fix that move GC shutdown start after VM Death and agent's unloading. > > The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. > > The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. I agree with Albert. I would prefer a patch that moves the JVMTI code instead. This is also what I've tested through tier1-8 in my queue of patches to clean up some of the shutdown code: https://github.com/stefank/jdk/tree/remove_2s_shutdown_workaround ------------- PR Comment: https://git.openjdk.org/jdk/pull/28227#issuecomment-3516108702 From sspitsyn at openjdk.org Tue Nov 11 11:18:49 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 11 Nov 2025 11:18:49 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Mon, 10 Nov 2025 19:21:11 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - 8366659: Fixed whitespace. >> - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. >> - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 > > src/hotspot/share/runtime/objectMonitor.cpp line 1108: > >> 1106: assert(currentNode->_thread == current, "invariant"); >> 1107: assert(_waiters > 0, "invariant"); >> 1108: assert_mark_word_consistency(); > > Why remove call to `assert_mark_word_consistency();`? Same question from me. :) > src/hotspot/share/runtime/objectMonitor.cpp line 1186: > >> 1184: // Current has acquired the lock -- Unlink current from the _entry_list. >> 1185: assert(has_owner(current), "invariant"); >> 1186: assert_mark_word_consistency(); > > Why remove call to `assert_mark_word_consistency();`? Same question from me. :) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2513824738 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2513824235 From duke at openjdk.org Tue Nov 11 12:08:36 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 11 Nov 2025 12:08:36 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Tue, 11 Nov 2025 11:15:15 GMT, Serguei Spitsyn wrote: >> src/hotspot/share/runtime/objectMonitor.cpp line 1108: >> >>> 1106: assert(currentNode->_thread == current, "invariant"); >>> 1107: assert(_waiters > 0, "invariant"); >>> 1108: assert_mark_word_consistency(); >> >> Why remove call to `assert_mark_word_consistency();`? > > Same question from me. :) This assert only works in a non-blocked state. The call to `reenter_internal` is now done in a blocked state, I also changed the assertion on the state from `!=` to `==` a few lines above it. `assert_mark_word_consistency()` calls `object()` which calls `check_object_context()`, which can pass only if the state is either `_thread_in_vm` or `_thread_in_Java`. Since the call is now made from a blocked state, the assert has to be removed. `assert_mark_word_consistency()` is called after the thread is back to a non-blocked state. >> src/hotspot/share/runtime/objectMonitor.cpp line 1186: >> >>> 1184: // Current has acquired the lock -- Unlink current from the _entry_list. >>> 1185: assert(has_owner(current), "invariant"); >>> 1186: assert_mark_word_consistency(); >> >> Why remove call to `assert_mark_word_consistency();`? > > Same question from me. :) Same answer as above, it only works in a non-blocked state, but that is no longer the case here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2513991947 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2513993815 From duke at openjdk.org Tue Nov 11 12:40:44 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 11 Nov 2025 12:40:44 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Mon, 10 Nov 2025 19:53:09 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - 8366659: Fixed whitespace. >> - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. >> - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 > > src/hotspot/share/runtime/objectMonitor.cpp line 533: > >> 531: } >> 532: >> 533: void ObjectMonitor::enter_with_contention_mark(JavaThread* current, ObjectMonitorContentionMark &cm, bool post_jvmti_events) { > > In the baseline also: `cm` is passed in, but it only used for this: > `assert(cm._monitor == this, "must be");`. > > This makes me wonder if we're missing some code in `enter_with_contention_mark` > that is normally done when we are passed an `ObjectMonitorContentionMark`. Yes, in `enter_with_contention_mark` the mark itself is only for assertion. I agree that is not clear, if there is any issue popping up, we can address it in a separate PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2514088683 From duke at openjdk.org Tue Nov 11 13:13:29 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 11 Nov 2025 13:13:29 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v5] In-Reply-To: References: Message-ID: <7LWuJgkzmagjtR5L5LQxskLT-zyMJKrPsFKy9VRjNF4=.36d14e51-9d61-4cbc-b24b-6d68208158a5@github.com> > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Fixed lines in tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/31482ba4..7f26302e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=03-04 Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From duke at openjdk.org Tue Nov 11 13:13:34 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 11 Nov 2025 13:13:34 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Tue, 11 Nov 2025 02:33:25 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - 8366659: Fixed whitespace. >> - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. >> - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 452: > >> 450: >> 451: try { Thread.sleep(1000); >> 452: } catch(Exception e) {} > > Nit: The Thread.sleep call should be on its own line after L451. Addressed in the latest commit. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 506: > >> 504: } >> 505: try { Thread.sleep(1000); >> 506: } catch(Exception e) {} > > Nit: The Thread.sleep call should be on its own line after L505. Addressed in the latest commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2514175972 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2514176496 From duke at openjdk.org Tue Nov 11 13:53:36 2025 From: duke at openjdk.org (Anton Artemov) Date: Tue, 11 Nov 2025 13:53:36 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Tue, 11 Nov 2025 02:31:57 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - 8366659: Fixed whitespace. >> - 8366659: Disabled posting JVMTI events in reenter-etner path of wait. Postponed waited event. >> - ... and 8 more: https://git.openjdk.org/jdk/compare/79fee607...31482ba4 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 387: > >> 385: } >> 386: try { Thread.sleep(1000); >> 387: } catch(Exception e) {} > > Nit: The `Thread.sleep` call should be on its own line after L386. Addressed in the latest commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2514310008 From lmesnik at openjdk.org Tue Nov 11 17:26:34 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 11 Nov 2025 17:26:34 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v2] In-Reply-To: References: Message-ID: > Please review following fix that move GC shutdown start after VM Death and agent's unloading. > > The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. > > The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: moved jvmti/gc coce ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28227/files - new: https://git.openjdk.org/jdk/pull/28227/files/a49d67ca..e728034d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=00-01 Stats: 28 lines in 1 file changed: 14 ins; 14 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28227.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28227/head:pull/28227 PR: https://git.openjdk.org/jdk/pull/28227 From lmesnik at openjdk.org Tue Nov 11 17:45:27 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 11 Nov 2025 17:45:27 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v3] In-Reply-To: References: Message-ID: > Please review following fix that move GC shutdown start after VM Death and agent's unloading. > > The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. > > The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: moving ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28227/files - new: https://git.openjdk.org/jdk/pull/28227/files/e728034d..be6eb483 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=01-02 Stats: 14 lines in 2 files changed: 8 ins; 6 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28227.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28227/head:pull/28227 PR: https://git.openjdk.org/jdk/pull/28227 From ayang at openjdk.org Tue Nov 11 17:50:43 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 11 Nov 2025 17:50:43 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: > Trivial removing obsoleted code for unsupported arch. > > Test: tier1 Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28240/files - new: https://git.openjdk.org/jdk/pull/28240/files/03330ac2..0e447848 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=00-01 Stats: 9 lines in 2 files changed: 0 ins; 8 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28240.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28240/head:pull/28240 PR: https://git.openjdk.org/jdk/pull/28240 From ayang at openjdk.org Tue Nov 11 17:50:44 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 11 Nov 2025 17:50:44 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch In-Reply-To: <8ikwqN309ZPAORjL2YvE1hgvChrTfhi3slz1r4XIK5E=.41d37c1b-ae3e-43f5-9fe0-43ae2294e57c@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> <8ikwqN309ZPAORjL2YvE1hgvChrTfhi3slz1r4XIK5E=.41d37c1b-ae3e-43f5-9fe0-43ae2294e57c@github.com> Message-ID: On Tue, 11 Nov 2025 16:16:25 GMT, Vladimir Kozlov wrote: > What happens if TLAB is at the end of heap page? Are you sure "prefetch" instructions on all OpenJDK platforms can touch unmapped memory? I see PPC can use AllocatePrefetchStyle == 3. In every `.ad` file, there is `// Must be safe to execute with invalid address (cannot fault)` for prefetching. I searched online that all currently supported platforms don't fault on prefetching invalid addresses. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3518048288 From lmesnik at openjdk.org Tue Nov 11 18:15:23 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 11 Nov 2025 18:15:23 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: > Please review following fix that move GC shutdown start after VM Death and agent's unloading. > > The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. > > The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: dot added ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28227/files - new: https://git.openjdk.org/jdk/pull/28227/files/be6eb483..6d367b4a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28227&range=02-03 Stats: 3 lines in 2 files changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28227.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28227/head:pull/28227 PR: https://git.openjdk.org/jdk/pull/28227 From lmesnik at openjdk.org Tue Nov 11 18:33:04 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 11 Nov 2025 18:33:04 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence In-Reply-To: <53ymzoSHFWCq2NSuHUOoabHdtoU_uNHEDb2tshbiDh8=.836d28b5-4625-4c07-90ac-157a14ff7abd@github.com> References: <53ymzoSHFWCq2NSuHUOoabHdtoU_uNHEDb2tshbiDh8=.836d28b5-4625-4c07-90ac-157a14ff7abd@github.com> Message-ID: On Tue, 11 Nov 2025 10:03:23 GMT, Albert Mingkun Yang wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > >> move GC shutdown start after VM Death and agent's unloading > > Is there a reason why `Universe::before_exit()` is moved down, instead of moving jvmti related calls (before `Universe::before_exit()`)? > > (The current patch would leave GC running while calling `MemMapPrinter::print_all_mappings(tty);` -- GC can potentially alter mappings.) @albertnetymk, @stefank > > move GC shutdown start after VM Death and agent's unloading > > Is there a reason why `Universe::before_exit()` is moved down, instead of moving jvmti related calls (before `Universe::before_exit()`)? I updated to move jvmti code. Seems that following opertaions WatcherThread::stop(); NativeHeapTrimmer::cleanup(); might be done before sending jvmti vm_death. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28227#issuecomment-3518247296 From ayang at openjdk.org Tue Nov 11 19:05:04 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 11 Nov 2025 19:05:04 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 18:15:23 GMT, Leonid Mesnik wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > dot added Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28227#pullrequestreview-3449515538 From stefank at openjdk.org Wed Nov 12 07:53:05 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 12 Nov 2025 07:53:05 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 18:15:23 GMT, Leonid Mesnik wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > dot added Looks good and thanks for the test! ------------- Marked as reviewed by stefank (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28227#pullrequestreview-3452083212 From iwalulya at openjdk.org Wed Nov 12 08:39:05 2025 From: iwalulya at openjdk.org (Ivan Walulya) Date: Wed, 12 Nov 2025 08:39:05 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 18:15:23 GMT, Leonid Mesnik wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > dot added Marked as reviewed by iwalulya (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28227#pullrequestreview-3452233407 From duke at openjdk.org Wed Nov 12 13:29:07 2025 From: duke at openjdk.org (Anton Artemov) Date: Wed, 12 Nov 2025 13:29:07 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed lines in tests. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Added a comment to a boolean arg for enter() - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed new lines. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Removed incorrect assert, - 8366659: Fixed merge conflict - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 ------------- Changes: https://git.openjdk.org/jdk/pull/27040/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=05 Stats: 377 lines in 3 files changed: 313 ins; 44 del; 20 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aboldtch at openjdk.org Wed Nov 12 14:06:32 2025 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 12 Nov 2025 14:06:32 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 18:15:23 GMT, Leonid Mesnik wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > dot added lgtm. ------------- Marked as reviewed by aboldtch (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28227#pullrequestreview-3453617541 From kvn at openjdk.org Wed Nov 12 15:24:30 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Wed, 12 Nov 2025 15:24:30 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: <_iaflU1ISP1m0TQKu8cUvnyQ6NQ92xs4tI1Mqs6H3E8=.9e55e39f-b852-4604-acb4-ec9f3dedd014@github.com> On Tue, 11 Nov 2025 17:50:43 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review I ran our testing (tier1-5) and there are no new failures. So I approve this change. But you need second review. Preferable from other platforms supporters (RISC-V, PPC64, s390) ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28240#pullrequestreview-3454014494 From cnorrbin at openjdk.org Wed Nov 12 15:42:24 2025 From: cnorrbin at openjdk.org (Casper Norrbin) Date: Wed, 12 Nov 2025 15:42:24 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 09:57:39 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > 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 seven additional commits since the last revision: > > - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping > - Remove SkippedException import > - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping > - Fix include > - Add asserts/checks for input domain > - Add regression test for jdk-8370492 > - 8370492: [Linux] Update cpu shares to cpu.weight mapping function Looks good! We are also starting to see tests failing. Some of the new tests fail on rootless cgroup v1 configurations, see comment. test/hotspot/jtreg/containers/docker/TestMisc.java line 107: > 105: // Don't use 1024 exactly so as to avoid mapping to the unlimited/uset case. > 106: // Use a value > 100 post-mapping so as to hit the non-default branch: 1052 => 103 > 107: printContainerInfo(1052, 1024, true); These tests fail in rootless Podman containers using cgroup v1, because that configuration does not support resource limits. We get the following error to stderr: `Resource limits are not supported and ignored on cgroups V1 rootless systems` and the cpu shares value is reset to 1024. `cpu_shares: no shares` is then in the output, leading to the first test failing. Then, `1024 != 1052` which leads to the second test failing. ------------- PR Review: https://git.openjdk.org/jdk/pull/28157#pullrequestreview-3454095579 PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2518801888 From sgehwolf at openjdk.org Wed Nov 12 16:40:42 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 12 Nov 2025 16:40:42 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v4] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 15:36:29 GMT, Casper Norrbin wrote: >> 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 seven additional commits since the last revision: >> >> - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping >> - Remove SkippedException import >> - Merge branch 'master' into jdk-8370492-fix-cpushares-mapping >> - Fix include >> - Add asserts/checks for input domain >> - Add regression test for jdk-8370492 >> - 8370492: [Linux] Update cpu shares to cpu.weight mapping function > > test/hotspot/jtreg/containers/docker/TestMisc.java line 107: > >> 105: // Don't use 1024 exactly so as to avoid mapping to the unlimited/uset case. >> 106: // Use a value > 100 post-mapping so as to hit the non-default branch: 1052 => 103 >> 107: printContainerInfo(1052, 1024, true); > > These tests fail in rootless Podman containers using cgroup v1, because that configuration does not support resource limits. We get the following error to stderr: > `Resource limits are not supported and ignored on cgroups V1 rootless systems` > and the cpu shares value is reset to 1024. `cpu_shares: no shares` is then in the output, leading to the first test failing. Then, `1024 != 1052` which leads to the second test failing. OK. Thanks for the heads-up. I'll test it. We have infra to check for rootless and can skip it there. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2519021505 From dcubed at openjdk.org Wed Nov 12 17:17:18 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 12 Nov 2025 17:17:18 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v4] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: <88Sy8kwrXhq7vxLgsKOghkK51dK06psHKkJkcjtayV4=.6895c4a5-02ae-44dc-b620-3d9890078fa3@github.com> On Tue, 11 Nov 2025 12:37:57 GMT, Anton Artemov wrote: >> src/hotspot/share/runtime/objectMonitor.cpp line 533: >> >>> 531: } >>> 532: >>> 533: void ObjectMonitor::enter_with_contention_mark(JavaThread* current, ObjectMonitorContentionMark &cm, bool post_jvmti_events) { >> >> In the baseline also: `cm` is passed in, but it only used for this: >> `assert(cm._monitor == this, "must be");`. >> >> This makes me wonder if we're missing some code in `enter_with_contention_mark` >> that is normally done when we are passed an `ObjectMonitorContentionMark`. > > Yes, in `enter_with_contention_mark` the mark itself is only for assertion. I agree that is not clear, if there is any issue popping up, we can address it in a separate PR. I took another look and since we don't do anything with `DEFLATER_MARKER` in this code path, I concur that we are not missing any code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519150311 From dcubed at openjdk.org Wed Nov 12 17:17:19 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 12 Nov 2025 17:17:19 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: <_V6XFQPX73Cy4NPUqaiSI4mgWSmjjhc1W__bpDmk5eM=.e3279b3d-0770-446b-8e37-35fd00093863@github.com> Message-ID: On Tue, 11 Nov 2025 12:05:10 GMT, Anton Artemov wrote: >> Same question from me. :) > > This assert only works in a non-blocked state. The call to `reenter_internal` is now done in a blocked state, I also changed the assertion on the state from `!=` to `==` a few lines above this line. > > `assert_mark_word_consistency()` calls `object()` which calls `check_object_context()`, which can pass only if the state is either `_thread_in_vm` or `_thread_in_Java`. Since the call is now made from a blocked state, the assert has to be removed. > > `assert_mark_word_consistency()` is called after the thread is back to a non-blocked state. Thanks for the explanation! Please add a comment above line 341: // Can only be called from _thread_in_vm or _thread_in_Java due to object() call: 341: #define assert_mark_word_consistency() \ 342: assert(UseObjectMonitorTable || object()->mark() == markWord::encode(this), \ ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519143235 From cjplummer at openjdk.org Wed Nov 12 18:24:38 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 12 Nov 2025 18:24:38 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> Message-ID: On Sun, 9 Nov 2025 10:30:45 GMT, Serguei Spitsyn wrote: >> This is fix is to increase the `EXPECTED_ACCURACY` value in the test: >> `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. >> It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. >> >> Testing: >> - TBD: Verify the test with mach5 test runs > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: restore original EXPECTED_ACCURACY for Windows test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp line 45: > 43: static const jlong EXPECTED_ACCURACY = 16; // 16ms is longest clock update interval > 44: #else > 45: static const jlong EXPECTED_ACCURACY = 32; // high frequency clock updates expected The comments are somewhat misleading now. We choose 16 on WIN32 because that is the smallest interval allowed. We expect better clock refinement on other platforms and therefore better accuracy. Thus 10ms was chosen. Now we have one test case that was just over 16ms. Is there a reason to believe that couldn't happen with WIN32 also. If not, then the comments should reflect that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2519348665 From sspitsyn at openjdk.org Wed Nov 12 18:33:46 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 12 Nov 2025 18:33:46 GMT Subject: RFR: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence [v4] In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 18:15:23 GMT, Leonid Mesnik wrote: >> Please review following fix that move GC shutdown start after VM Death and agent's unloading. >> >> The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. >> >> The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > dot added Looks good. Thank you for fixing this issue! ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28227#pullrequestreview-3454892220 From lmesnik at openjdk.org Wed Nov 12 18:58:04 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Wed, 12 Nov 2025 18:58:04 GMT Subject: Integrated: 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence In-Reply-To: References: Message-ID: On Tue, 11 Nov 2025 03:49:07 GMT, Leonid Mesnik wrote: > Please review following fix that move GC shutdown start after VM Death and agent's unloading. > > The `Universe::before_exit();` switch GC to fail any new GC allocation. So any allocation in vm death is failing. > > The test is a little bit complicated because jtreg uses wrapper even to execute othrevm tests and also results might be confusing if test is failing after main() method is completed. So the better is to run new process for vm death event handling. This pull request has now been integrated. Changeset: 705bd6fb Author: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/705bd6fbdc0e78625d05dbfa8af547c50b076e69 Stats: 161 lines in 3 files changed: 151 ins; 9 del; 1 mod 8367902: Allocation after Universe::before_exit() in the VM shutdown sequence Reviewed-by: ayang, stefank, iwalulya, aboldtch, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28227 From dcubed at openjdk.org Wed Nov 12 20:09:31 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 12 Nov 2025 20:09:31 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 I've done another crawl thru review. Thanks for making changes after the first round of comments. In this crawl-thru, my deep focus was on the modified test. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 297: > 295: } > 296: > 297: // Notify the resumer while holding the threadLock Nit: please add a period at the end of this sentence. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 372: > 370: // - a threadLock enter in the resumer thread > 371: // - resumption of the waiter thread > 372: // - a threadLock enter in the freshly resumed waiter thread This list of step tests is identical to the list on L490 -> L493 and the original llist on L256 -> L259. This step comment: `370: // - a threadLock enter in the resumer thread` should be updated to something like: // - a blocked threadLock enter in the resumer thread while the // threadLock is held by the main thread. This change of threadLock scope also requires this update from: 605: // - tries to grab the threadLock (should not block!) to: 605: // - tries to grab the threadLock (should not block with doWork1!) test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 388: > 386: try { > 387: Thread.sleep(1000); > 388: } catch(Exception e) {} Why is this 1 second delay needed? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 428: > 426: // launch the waiter thread > 427: synchronized (barrierLaunch) { > 428: waiter = new SuspendWithObjectMonitorWaitWorker("waiter", 1); This change to `wait` for `1` instead of `0` requires this comment to be updated from: // TS_READY_TO_NOTIFY is set after the main thread has // entered threadLock so a spurious wakeup can't get the // waiter thread out of this threadLock.wait(0) call: to: // TS_READY_TO_NOTIFY is set after the main thread has // entered threadLock so a spurious wakeup can't get the // waiter thread out of this threadLock.wait(0) call in // doWork1 or doWork2. doWork3 passes a one so that the // wait() can terminate early and block on reentry. I'm having trouble seeing why this third test case is necessary. We do a short `wait(1)` in this test case instead of a `wait(0)` so we terminate the `wait(1)` with a timeout instead of a `notify()` from the main thread. In all worker test cases, the main thread grabs the threadsLock when the "waiter" thread calls `wait()`, the main thread does a `notify()`, the main thread waits until the worker thread contends on threadsLock and finally the main thread suspends the worker thread. The only thing that I see that the `wait(1)` brings to the party is that the worker3 thread might get to re-entry block on threadsLock via a timeout instead of a notify. What am I missing here? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 454: > 452: try { > 453: Thread.sleep(1000); > 454: } catch(Exception e) {} Why is this 1 second delay needed? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 493: > 491: // - a threadLock enter in the resumer thread > 492: // - resumption of the waiter thread > 493: // - a threadLock enter in the freshly resumed waiter thread This list of step tests is identical to the list on L369 -> L372 and the original llist on L256 -> L259. This step comment: 491: // - a threadLock enter in the resumer thread should be updated to something like: // - a blocked threadLock enter in the resumer thread while the // threadLock is held by the main thread. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 509: > 507: try { > 508: Thread.sleep(1000); > 509: } catch(Exception e) {} Why is this 1 second delay needed? ------------- Marked as reviewed by dcubed (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3454633483 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519187101 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519214534 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519476007 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519522596 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519194484 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519205810 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519483650 From dcubed at openjdk.org Wed Nov 12 20:09:32 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 12 Nov 2025 20:09:32 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: <01keWsXsYrIpmL3GwgAFqXYuTxfM1ohW_J9FWsGsnIA=.84c0fbc2-df37-45e0-99eb-f7291dc33410@github.com> On Wed, 12 Nov 2025 17:36:44 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 372: > >> 370: // - a threadLock enter in the resumer thread >> 371: // - resumption of the waiter thread >> 372: // - a threadLock enter in the freshly resumed waiter thread > > This list of step tests is identical to the list on L490 -> L493 and the > original llist on L256 -> L259. > > This step comment: > `370: // - a threadLock enter in the resumer thread` > should be updated to something like: > > // - a blocked threadLock enter in the resumer thread while the > // threadLock is held by the main thread. > > > This change of threadLock scope also requires this update from: > > 605: // - tries to grab the threadLock (should not block!) > > > to: > > 605: // - tries to grab the threadLock (should not block with doWork1!) I can't figure out why we're delaying the resumer thread in `doWork2`. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 493: > >> 491: // - a threadLock enter in the resumer thread >> 492: // - resumption of the waiter thread >> 493: // - a threadLock enter in the freshly resumed waiter thread > > This list of step tests is identical to the list on L369 -> L372 and the > original llist on L256 -> L259. > > This step comment: > > 491: // - a threadLock enter in the resumer thread > > should be updated to something like: > > // - a blocked threadLock enter in the resumer thread while the > // threadLock is held by the main thread. I can't figure out why we're delaying the resumer thread in `doWork3`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519645665 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2519646704 From sgehwolf at openjdk.org Wed Nov 12 20:28:41 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 12 Nov 2025 20:28:41 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v5] In-Reply-To: References: Message-ID: > Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. > > For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): > > > f(x) = {(x - 2) \times 9999 + 1 \over 262142} > > > This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: > > > f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} > > > Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. > > Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. > > Thoughts? > > **Testing:** > - [x] GHA > - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: Fix TestMisc for podman on cg v1 in rootless mode. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28157/files - new: https://git.openjdk.org/jdk/pull/28157/files/a2c6b160..9417bdbe Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28157&range=03-04 Stats: 12 lines in 1 file changed: 12 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28157.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28157/head:pull/28157 PR: https://git.openjdk.org/jdk/pull/28157 From sgehwolf at openjdk.org Wed Nov 12 20:28:42 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 12 Nov 2025 20:28:42 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v4] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 16:37:30 GMT, Severin Gehwolf wrote: >> test/hotspot/jtreg/containers/docker/TestMisc.java line 107: >> >>> 105: // Don't use 1024 exactly so as to avoid mapping to the unlimited/uset case. >>> 106: // Use a value > 100 post-mapping so as to hit the non-default branch: 1052 => 103 >>> 107: printContainerInfo(1052, 1024, true); >> >> These tests fail in rootless Podman containers using cgroup v1, because that configuration does not support resource limits. We get the following error to stderr: >> `Resource limits are not supported and ignored on cgroups V1 rootless systems` >> and the cpu shares value is reset to 1024. `cpu_shares: no shares` is then in the output, leading to the first test failing. Then, `1024 != 1052` which leads to the second test failing. > > OK. Thanks for the heads-up. I'll test it. We have infra to check for rootless and can skip it there. Should be fixed in the update with: https://github.com/openjdk/jdk/pull/28157/commits/9417bdbeb4d458489953a54d253e8f79dc678734 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28157#discussion_r2519710367 From sspitsyn at openjdk.org Wed Nov 12 22:49:06 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 12 Nov 2025 22:49:06 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> Message-ID: On Wed, 12 Nov 2025 18:22:05 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: restore original EXPECTED_ACCURACY for Windows > > test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp line 45: > >> 43: static const jlong EXPECTED_ACCURACY = 16; // 16ms is longest clock update interval >> 44: #else >> 45: static const jlong EXPECTED_ACCURACY = 32; // high frequency clock updates expected > > The comments are somewhat misleading now. We choose 16 on WIN32 because that is the smallest interval allowed. We expect better clock refinement on other platforms and therefore better accuracy. Thus 10ms was chosen. Now we have one test case that was just over 16ms. Is there a reason to believe that couldn't happen with WIN32 also. If not, then the comments should reflect that. I feel that all these checks are just a source of this test instability. :) I'm not sure I fully understand why those are needed and what was the original design. It is always possible to have some delays in waiting time, so the original assumptions about expected accuracy are not fully correct as they are a little bit overly strong. >From this point of view, I do not see why the comments are confusing. The `EXPECTED_ACCURACY` values are just based on the high frequency clock updates interval but should not be equal to it. Would you like me to change the comments to something like below ? : `high frequency clock updates expected` => `expected accuracy is based on high frequency clock updates` I do not want to change the Windows part until any failure is observed but can update the comment for consistency. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2520042629 From sspitsyn at openjdk.org Wed Nov 12 23:36:02 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 12 Nov 2025 23:36:02 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS In-Reply-To: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: On Mon, 10 Nov 2025 20:54:56 GMT, Alex Menkov wrote: > FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. > All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. > The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER > > Testing: tier1..4,hs-tier5-svc The fix looks good. I've posted a couple of nits. src/hotspot/share/prims/jvmtiTagMap.cpp line 2193: > 2191: }; > 2192: > 2193: // A supporting closure used to process ClassLoaderData roots Nit: Need dot at the end of comment. test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 79: > 77: > 78: for (int i = 0; i < class_counter; i++) { > 79: tags[i] = i+1; Nit: Need spaces around `+` sign. test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 101: > 99: } > 100: > 101: Nit: Unneeded extra empty line. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28224#pullrequestreview-3455948919 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520165317 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520125928 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520132469 From lmesnik at openjdk.org Thu Nov 13 02:57:34 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 02:57:34 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni Message-ID: Please review following fix that adds jni exception check after calling java code. Tested by running test with and without -Xcheck:jni. ------------- Commit messages: - 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni Changes: https://git.openjdk.org/jdk/pull/28280/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28280&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371749 Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28280.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28280/head:pull/28280 PR: https://git.openjdk.org/jdk/pull/28280 From sspitsyn at openjdk.org Thu Nov 13 06:36:01 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 13 Nov 2025 06:36:01 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 02:51:35 GMT, Leonid Mesnik wrote: > Please review following fix that adds jni exception check after calling java code. > > Tested by running test with and without -Xcheck:jni. Looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28280#pullrequestreview-3457775471 From sspitsyn at openjdk.org Thu Nov 13 07:04:03 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 13 Nov 2025 07:04:03 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 02:51:35 GMT, Leonid Mesnik wrote: > Please review following fix that adds jni exception check after calling java code. > > Tested by running test with and without -Xcheck:jni. test/hotspot/jtreg/serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/libTestAllocatingInVMDeath.cpp line 42: > 40: if (jni->ExceptionOccurred()) { > 41: jni->ExceptionDescribe(); > 42: fatal(jni, "Unexpected exception occured in cbVMDeath."); Nit: Typo: `s/occured/occurred/` Also, this message is confusing. Unexpected exception occurred in Java upcall made from the cbVMDeath. Maybe something like this: "cbVMDeath: unexpected exception occurred in Java upcall method". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28280#discussion_r2521900137 From lmesnik at openjdk.org Thu Nov 13 07:54:42 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 07:54:42 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni [v2] In-Reply-To: References: Message-ID: > Please review following fix that adds jni exception check after calling java code. > > Tested by running test with and without -Xcheck:jni. Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: error message fixed ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28280/files - new: https://git.openjdk.org/jdk/pull/28280/files/8d539f86..12828417 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28280&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28280&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28280.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28280/head:pull/28280 PR: https://git.openjdk.org/jdk/pull/28280 From duke at openjdk.org Thu Nov 13 07:58:14 2025 From: duke at openjdk.org (Ruben) Date: Thu, 13 Nov 2025 07:58:14 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: References: Message-ID: <-h6G9ajUWQwDRcUMOtyI_YCUCkXz3pzRggJk_UaxM-0=.a8c772aa-2f09-48c0-9cfb-17e624393eb0@github.com> On Fri, 7 Nov 2025 11:07:40 GMT, Ruben wrote: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. I am planning to update this PR today to include the comments. However, I still have not identified a way to ensure the deopt handler stub ends at a page boundary in a unit test. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3526178620 From ysuenaga at openjdk.org Thu Nov 13 08:25:46 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 13 Nov 2025 08:25:46 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing Message-ID: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. Big thanks to @pchilano for your help! ------------- Commit messages: - 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing Changes: https://git.openjdk.org/jdk/pull/28284/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28284&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371194 Stats: 230 lines in 10 files changed: 117 ins; 39 del; 74 mod Patch: https://git.openjdk.org/jdk/pull/28284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28284/head:pull/28284 PR: https://git.openjdk.org/jdk/pull/28284 From cnorrbin at openjdk.org Thu Nov 13 09:05:32 2025 From: cnorrbin at openjdk.org (Casper Norrbin) Date: Thu, 13 Nov 2025 09:05:32 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v5] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 20:28:41 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Fix TestMisc for podman on cg v1 in rootless mode. LGTM ------------- Marked as reviewed by cnorrbin (Committer). PR Review: https://git.openjdk.org/jdk/pull/28157#pullrequestreview-3458531316 From mdoerr at openjdk.org Thu Nov 13 09:34:05 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Thu, 13 Nov 2025 09:34:05 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Tue, 11 Nov 2025 17:50:43 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review We have seen crashes on many platforms (including x64) while running `make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders"`: SIGSEGV (0xb) at pc=0x00007f2f95a61e7a, pid=18554, tid=18557 V [libjvm.so+0x15bfe7a] MemAllocator::finish(HeapWordImpl**) const+0xca (klass.inline.hpp:72) V [libjvm.so+0x15c029f] ObjAllocator::initialize(HeapWordImpl**) const+0x2f (memAllocator.cpp:391) V [libjvm.so+0xb0630b] CollectedHeap::fill_with_object(HeapWordImpl**, unsigned long, bool)+0x27b (collectedHeap.cpp:491) V [libjvm.so+0x1c7a0bb] ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats*)+0x11b (threadLocalAllocBuffer.cpp:118) V [libjvm.so+0x15c0b14] MemAllocator::mem_allocate_inside_tlab_slow(MemAllocator::Allocation&) const+0x84 (memAllocator.cpp:286) V [libjvm.so+0x15c13ab] MemAllocator::mem_allocate(MemAllocator::Allocation&) const+0xbb (memAllocator.cpp:340) V [libjvm.so+0x15c14f9] MemAllocator::allocate() const+0xa9 (memAllocator.cpp:353) V [libjvm.so+0x1cc052e] TypeArrayKlass::allocate_common(int, bool, JavaThread*)+0x13e (collectedHeap.inline.hpp:41) V [libjvm.so+0x16fbc98] oopFactory::new_typeArray(BasicType, int, JavaThread*)+0x38 (typeArrayKlass.hpp:51) V [libjvm.so+0x106b0f3] java_lang_Class::restore_archived_mirror(Klass*, Handle, Handle, Handle, JavaThread*)+0x413 (javaClasses.cpp:1246) V [libjvm.so+0x14100bc] Klass::restore_unshareable_info(ClassLoaderData*, Handle, JavaThread*)+0x66c (klass.cpp:903) V [libjvm.so+0xfe2cb1] InstanceKlass::restore_unshareable_info(ClassLoaderData*, Handle, PackageEntry*, JavaThread*)+0x81 (instanceKlass.cpp:2823) V [libjvm.so+0x1c0f5ad] SystemDictionary::preload_class(Handle, InstanceKlass*, JavaThread*)+0x1ed (systemDictionary.cpp:1198) V [libjvm.so+0x676e83] AOTLinkedClassBulkLoader::preload_classes_in_table(Array*, char const*, Handle, JavaThread*)+0x1a3 (aotLinkedClassBulkLoader.cpp:103) V [libjvm.so+0x679af5] AOTLinkedClassBulkLoader::preload_classes_impl(JavaThread*)+0x165 (aotLinkedClassBulkLoader.cpp:76) V [libjvm.so+0x67c371] AOTLinkedClassBulkLoader::preload_classes(JavaThread*)+0x11 (aotLinkedClassBulkLoader.cpp:61) V [libjvm.so+0x1d5bf30] vmClasses::resolve_all(JavaThread*)+0x3e0 (vmClasses.cpp:126) V [libjvm.so+0x1c0f28c] SystemDictionary::initialize(JavaThread*)+0x10c (systemDictionary.cpp:1623) V [libjvm.so+0x1cc74ca] Universe::genesis(JavaThread*)+0xfa (universe.cpp:451) V [libjvm.so+0x1ccbbf5] universe2_init()+0x35 (universe.cpp:1119) V [libjvm.so+0xfd5709] init_globals2()+0x9 (init.cpp:173) V [libjvm.so+0x1c926b1] Threads::create_vm(JavaVMInitArgs*, bool*)+0x3a1 (threads.cpp:622) V [libjvm.so+0x118b634] JNI_CreateJavaVM+0x54 (jni.cpp:3591) C [libjli.so+0x3d7f] JavaMain+0x8f (java.c:1506) C [libjli.so+0x7ad9] ThreadJavaMain+0x9 (java_md.c:646) ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3526748535 From sspitsyn at openjdk.org Thu Nov 13 10:00:17 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 13 Nov 2025 10:00:17 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni [v2] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 07:54:42 GMT, Leonid Mesnik wrote: >> Please review following fix that adds jni exception check after calling java code. >> >> Tested by running test with and without -Xcheck:jni. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > error message fixed Marked as reviewed by sspitsyn (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28280#pullrequestreview-3458830380 From sgehwolf at openjdk.org Thu Nov 13 10:05:25 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 13 Nov 2025 10:05:25 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v5] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 20:28:41 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Fix TestMisc for podman on cg v1 in rootless mode. Thanks for the review. I still need a review from a Reviewer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28157#issuecomment-3526909866 From ayang at openjdk.org Thu Nov 13 11:38:20 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Thu, 13 Nov 2025 11:38:20 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Thu, 13 Nov 2025 09:31:53 GMT, Martin Doerr wrote: > ... make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders" I suspect the crash is caused by a preexisting issue that is exposed by this patch. In `vmClasses::resolve_all`: #if INCLUDE_CDS if (CDSConfig::is_using_aot_linked_classes()) { AOTLinkedClassBulkLoader::preload_classes(THREAD); } #endif // Preload commonly used klasses vmClassID scan = vmClassID::FIRST; // first do Object, then String, Class resolve_through(VM_CLASS_ID(Object_klass), scan, CHECK); CollectedHeap::set_filler_object_klass(vmClasses::Object_klass()); The filler-klass is not initialized when `preload_classes` is invoked, but `preload_classes` use heap-allocation, which may require filler-obj. @iklam What do you think? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3527395697 From ysuenaga at openjdk.org Thu Nov 13 12:53:50 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 13 Nov 2025 12:53:50 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: > We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. > > This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. > > Big thanks to @pchilano for your help! Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Update for Linux PPC64 and RISC-V ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28284/files - new: https://git.openjdk.org/jdk/pull/28284/files/4b854cd5..dfd947ab Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28284&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28284&range=00-01 Stats: 31 lines in 3 files changed: 26 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/28284.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28284/head:pull/28284 PR: https://git.openjdk.org/jdk/pull/28284 From ysuenaga at openjdk.org Thu Nov 13 12:57:19 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Thu, 13 Nov 2025 12:57:19 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing In-Reply-To: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: <70sCitITz57g9qbvq_zHkO5qacFAnJztIRdGAW9N7Vw=.d45b9141-3717-411c-bad7-5a90585c553a@github.com> On Thu, 13 Nov 2025 08:15:38 GMT, Yasumasa Suenaga wrote: > We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. > > This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. > > Big thanks to @pchilano for your help! This PR is for Linux, other platforms (Windows, Mac) would not work. However I think it is not a problem because Windows and Mac has not been supported mixed jstack originally. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3527677564 From tschatzl at openjdk.org Thu Nov 13 14:17:00 2025 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Thu, 13 Nov 2025 14:17:00 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Tue, 11 Nov 2025 17:50:43 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Change looks good, but these AOT-related crashes should be fixed first. ------------- Marked as reviewed by tschatzl (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28240#pullrequestreview-3460006822 From kevinw at openjdk.org Thu Nov 13 14:29:16 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 13 Nov 2025 14:29:16 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v10] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 18:08:31 GMT, Jonas Norlinder wrote: >> Hi all, >> >> This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. >> >> `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. >> >> FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. >> >> Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Fix phohensee review comments Looks good. Just a question on whether we really need to specify the GCs in the tests. I was hoping we can not do this, it seems like more to maintain that should be automatic as long as we do test batches with the different collectors. Do we need available GCs as specified in the tests get run on every test, or can we afford to let that be decided by the framework? (There might be some tests where we do want to make sure they run with all GCs regardless of what jtreg command runs, but I would hope that is a small set.) ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27537#pullrequestreview-3460067101 From djelinski at openjdk.org Thu Nov 13 14:37:43 2025 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Thu, 13 Nov 2025 14:37:43 GMT Subject: RFR: 8353738: Update TLS unit tests to not use certificates with MD5 signatures [v5] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 15:02:42 GMT, Matthew Donovan wrote: >> This PR updates tests that were using MD5 certificates. For most of the tests, I added test cases for TLSv1.2/MD5withRSA and TLSv1.3/SHA256withRSA. > > Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: > > changed line wrapping Can you convert or remove the `IPAddressDNSIdentities` test as well? test/jdk/javax/net/ssl/HttpsURLConnection/CriticalSubjectAltName.java line 36: > 34: * @library /test/lib > 35: * @modules java.base/sun.security.x509 java.base/sun.security.util > 36: * @run main/othervm CriticalSubjectAltName TLSv1.2 MD5withRSA as far as I could tell, this test doesn't verify any functionality that would require a specific key type, it's simply using MD5 because that was the popular choice in 2008. Do we need to keep using MD5, or can we make it use whatever key type is the default? test/jdk/javax/net/ssl/HttpsURLConnection/CriticalSubjectAltName.java line 39: > 37: > 38: /* > 39: * This test depends on binary keystore, crisubn.jks and trusted.jks. Because Peease remove the crisubn.jks and trusted.jks files from this directory, they aren't used anywhere else. test/jdk/javax/net/ssl/HttpsURLConnection/CriticalSubjectAltName.java line 157: > 155: ks.setCertificateEntry("Trusted Cert", trustedCert); > 156: > 157: Certificate[] chain = new Certificate[] {serverCert, trustedCert}; (probably preexisting) you can remove the trusted cert from the chain; real servers usually don't send it. test/jdk/javax/net/ssl/HttpsURLConnection/CriticalSubjectAltName.java line 190: > 188: void doClientSide() throws Exception { > 189: > 190: if (!serverReady.await(SERVER_WAIT_SECS, TimeUnit.SECONDS)) { I'd remove the time limit, it only causes trouble when people increase test concurrency and timeout factors. test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java line 1: > 1: /* This might be preexisting, but this file is identical to `test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java` now. Can we remove one? test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IdentitiesBase.java line 104: > 102: CertificateBuilder.KeyUsage.KEY_ENCIPHERMENT) > 103: .addBasicConstraintsExt(false, false, -1) > 104: .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1")) I assume you verified that the DNSIdentities customization overwrites the SAN configured here, but I'd feel more confident if this line were moved to customizeServerCert in IPIdentities test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IdentitiesBase.java line 119: > 117: CertificateBuilder.KeyUsage.NONREPUDIATION, > 118: CertificateBuilder.KeyUsage.KEY_ENCIPHERMENT) > 119: .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1")) Same here. ------------- PR Review: https://git.openjdk.org/jdk/pull/27342#pullrequestreview-3459883168 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523546617 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523539070 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523561169 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523555451 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523677717 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523705701 PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2523706426 From lmesnik at openjdk.org Thu Nov 13 16:23:43 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 16:23:43 GMT Subject: RFR: 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests In-Reply-To: <7kEYqfoRzlpl7vu5PbOXazM0R9E4NTu57jBH7jVSty4=.ca25f1a2-fb52-4e1b-b7b8-bd81493bc594@github.com> References: <7kEYqfoRzlpl7vu5PbOXazM0R9E4NTu57jBH7jVSty4=.ca25f1a2-fb52-4e1b-b7b8-bd81493bc594@github.com> Message-ID: On Sat, 8 Nov 2025 08:10:45 GMT, SendaoYan wrote: > Hi all, > > The DockerTestUtils.RETAIN_IMAGE_AFTER_TEST variable which read the property from "jdk.test.docker.retain.image" do not work for some of the docker tests, such as jdk/internal/platform/docker/TestDockerCpuMetrics.java, only works for some of the docker tests, such as jdk/internal/platform/docker/TestPidsLimit.java. > > This PR read the DockerTestUtils.RETAIN_IMAGE_AFTER_TEST inside function removeDockerImage instead of before all the fucntion removeDockerImage. This will make all the docker tests receive the property jdk.test.docker.retain.image. > > Change has been verified locally on linux-x64 by run the all touched tests. Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28208#pullrequestreview-3460609576 From lmesnik at openjdk.org Thu Nov 13 16:33:03 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 16:33:03 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS In-Reply-To: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: On Mon, 10 Nov 2025 20:54:56 GMT, Alex Menkov wrote: > FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. > All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. > The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER > > Testing: tier1..4,hs-tier5-svc Changes requested by lmesnik (Reviewer). test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 43: > 41: switch (reference_kind) { > 42: case JVMTI_HEAP_REFERENCE_SYSTEM_CLASS: > 43: *tag_ptr = ++class_counter; The callback is executed on VMThread, so counters should be atomic or protected by monitors. ------------- PR Review: https://git.openjdk.org/jdk/pull/28224#pullrequestreview-3460651314 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524138908 From iklam at openjdk.org Thu Nov 13 17:04:26 2025 From: iklam at openjdk.org (Ioi Lam) Date: Thu, 13 Nov 2025 17:04:26 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: <9o8TjNxCbwshwMuqpS-CyyhwNciw1WQ6w1_ijy39DEc=.fe11d68c-f925-4c07-9c46-42c9093a5448@github.com> On Thu, 13 Nov 2025 11:35:04 GMT, Albert Mingkun Yang wrote: > The filler-klass is not initialized when `preload_classes` is invoked, but `preload_classes` use heap-allocation, which may require filler-obj. > > @iklam What do you think? I am working on a fix now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3528798525 From macarte at openjdk.org Thu Nov 13 17:52:32 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 17:52:32 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v5] In-Reply-To: References: Message-ID: > Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE > > It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: > > TRUE > FALSE > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28010/files - new: https://git.openjdk.org/jdk/pull/28010/files/d48a200f..bff7cb74 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=03-04 Stats: 129 lines in 1 file changed: 129 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28010.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010 PR: https://git.openjdk.org/jdk/pull/28010 From macarte at openjdk.org Thu Nov 13 17:57:04 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 17:57:04 GMT Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v2] In-Reply-To: References: Message-ID: > Add jcmd AOT.end_recording diagnostic command. When this command is issued, a targeted JVM that is currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The command will report back to the user one of the following messages depending on the state of the JVM: > > - Error! Not a recording run > - Error! Not recording > - Recording ended successfully > - Error! Failed to end recording > > It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses: > > - Recording ended successfully > - Error! Not recording > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27965/files - new: https://git.openjdk.org/jdk/pull/27965/files/2f09c157..7b7e2f7e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=00-01 Stats: 129 lines in 1 file changed: 129 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27965.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965 PR: https://git.openjdk.org/jdk/pull/27965 From macarte at openjdk.org Thu Nov 13 18:04:04 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 18:04:04 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v6] In-Reply-To: References: Message-ID: > Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE > > It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: > > TRUE > FALSE > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Revert "Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording" Commit was intended for parent branch (that this branch is based on) This reverts commit bff7cb7408554232c13a57bba10b67a9fd19b811. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28010/files - new: https://git.openjdk.org/jdk/pull/28010/files/bff7cb74..6a100586 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=04-05 Stats: 129 lines in 1 file changed: 0 ins; 129 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28010.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010 PR: https://git.openjdk.org/jdk/pull/28010 From macarte at openjdk.org Thu Nov 13 18:58:53 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 18:58:53 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v7] In-Reply-To: References: Message-ID: > Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE > > It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: > > TRUE > FALSE > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Incorporate changes from the CSR ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28010/files - new: https://git.openjdk.org/jdk/pull/28010/files/6a100586..b97a799f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=05-06 Stats: 67 lines in 1 file changed: 4 ins; 13 del; 50 mod Patch: https://git.openjdk.org/jdk/pull/28010.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010 PR: https://git.openjdk.org/jdk/pull/28010 From amenkov at openjdk.org Thu Nov 13 19:05:21 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 13 Nov 2025 19:05:21 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni [v2] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 07:54:42 GMT, Leonid Mesnik wrote: >> Please review following fix that adds jni exception check after calling java code. >> >> Tested by running test with and without -Xcheck:jni. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > error message fixed Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28280#pullrequestreview-3461252832 From pchilanomate at openjdk.org Thu Nov 13 19:20:36 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 13 Nov 2025 19:20:36 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 19:07:49 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 388: > >> 386: try { >> 387: Thread.sleep(1000); >> 388: } catch(Exception e) {} > > Why is this 1 second delay needed? We need to give time for the resumer thread to block on the `threadLock` before we release it. We could reduce the amount of sleep time though. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 428: > >> 426: // launch the waiter thread >> 427: synchronized (barrierLaunch) { >> 428: waiter = new SuspendWithObjectMonitorWaitWorker("waiter", 1); > > This change to `wait` for `1` instead of `0` requires this comment to be updated from: > > // TS_READY_TO_NOTIFY is set after the main thread has > // entered threadLock so a spurious wakeup can't get the > // waiter thread out of this threadLock.wait(0) call: > > to: > > // TS_READY_TO_NOTIFY is set after the main thread has > // entered threadLock so a spurious wakeup can't get the > // waiter thread out of this threadLock.wait(0) call in > // doWork1 or doWork2. doWork3 passes a one so that the > // wait() can terminate early and block on reentry. > > > I'm having trouble seeing why this third test case is necessary. We do a short `wait(1)` > in this test case instead of a `wait(0)` so we terminate the `wait(1)` with a timeout instead > of a `notify()` from the main thread. > > In all worker test cases, the main thread grabs the threadsLock when the "waiter" thread > calls `wait()`, the main thread does a `notify()`, the main thread waits until the worker > thread contends on threadsLock and finally the main thread suspends the worker thread. > The only thing that I see that the `wait(1)` brings to the party is that the worker3 thread > might get to re-entry block on threadsLock via a timeout instead of a notify. > > What am I missing here? The `notify()` call doesn?t unpark the waiter thread, it just moves it from the `_wait_set` to the `_entry_list`. The wait(timeout) is there to allow it to run again so that it is suspended in `reenter_internal()`. But currently the timings will not exercise this case well. I added some comments to fix it. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 454: > >> 452: try { >> 453: Thread.sleep(1000); >> 454: } catch(Exception e) {} > > Why is this 1 second delay needed? This sleep is not needed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 509: > >> 507: try { >> 508: Thread.sleep(1000); >> 509: } catch(Exception e) {} > > Why is this 1 second delay needed? Same here, we need to give time for the resumer thread to block on the threadLock before we release it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524648214 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524652123 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524641301 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524648857 From amenkov at openjdk.org Thu Nov 13 19:21:19 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 13 Nov 2025 19:21:19 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS In-Reply-To: References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: On Thu, 13 Nov 2025 16:30:28 GMT, Leonid Mesnik wrote: >> FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. >> All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. >> The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER >> >> Testing: tier1..4,hs-tier5-svc > > test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 43: > >> 41: switch (reference_kind) { >> 42: case JVMTI_HEAP_REFERENCE_SYSTEM_CLASS: >> 43: *tag_ptr = ++class_counter; > > The callback is executed on VMThread, so counters should be atomic or protected by monitors. Not sure I follow. There is no concurrent access to the variables. FollowReferences is executed at safepoint (so the counters are updated by single thread). The values are read after FollowReference returns (i.e. after the safepoint) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524652595 From pchilanomate at openjdk.org Thu Nov 13 19:23:46 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 13 Nov 2025 19:23:46 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 31: > 29: * @library /test/lib > 30: * @compile SuspendWithObjectMonitorWait.java > 31: * @run main/othervm/native -agentlib:SuspendWithObjectMonitorWait SuspendWithObjectMonitorWait 1 Note that these passed values are overriding timeMax. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524657555 From pchilanomate at openjdk.org Thu Nov 13 19:20:39 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 13 Nov 2025 19:20:39 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 428: > 426: // launch the waiter thread > 427: synchronized (barrierLaunch) { > 428: waiter = new SuspendWithObjectMonitorWaitWorker("waiter", 1); We should increase this timeout to minimize the chance of it happening between the main thread acquiring the `threadLock` and issuing the notification, in which case the waiter will not go through `reenter_internal` but through `enter`. Also it avoids some funny scheduling where the main thread never acquires the `threadLock`. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 466: > 464: testState = TS_READY_TO_NOTIFY; > 465: threadLock.notify(); > 466: We should add a `Thread.sleep` here to give time for the wait to timeout before suspending the waiter thread. Should be more than what the waiter thread is using as timeout. I have tested a timeout value of 100ms and here sleeping 200ms and always see the deadlock on `reenter_internal` (with current mainline code). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524640318 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524643382 From macarte at openjdk.org Thu Nov 13 19:41:40 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 19:41:40 GMT Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3] In-Reply-To: References: Message-ID: > Add jcmd AOT.end_recording diagnostic command. When this command is issued, a targeted JVM that is currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The command will report back to the user one of the following messages depending on the state of the JVM: > > - Error! Not a recording run > - Error! Not recording > - Recording ended successfully > - Error! Failed to end recording > > It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses: > > - Recording ended successfully > - Error! Not recording > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Document use of DiagnosticCommand ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27965/files - new: https://git.openjdk.org/jdk/pull/27965/files/7b7e2f7e..cdd1f1d4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=01-02 Stats: 32 lines in 1 file changed: 32 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27965.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965 PR: https://git.openjdk.org/jdk/pull/27965 From amenkov at openjdk.org Thu Nov 13 19:42:00 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 13 Nov 2025 19:42:00 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS [v2] In-Reply-To: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: > FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. > All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. > The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER > > Testing: tier1..4,hs-tier5-svc Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: feedback ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28224/files - new: https://git.openjdk.org/jdk/pull/28224/files/1ee62064..efa0b538 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28224&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28224&range=00-01 Stats: 4 lines in 2 files changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28224.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28224/head:pull/28224 PR: https://git.openjdk.org/jdk/pull/28224 From amenkov at openjdk.org Thu Nov 13 19:46:33 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 13 Nov 2025 19:46:33 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS [v2] In-Reply-To: References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: <7wURnzxhUcvMAvFBs1-ADLcdjSxsAs53lfH-M-6eHKA=.74ffc3ca-c15f-4bdc-a640-4fe50869c36c@github.com> On Wed, 12 Nov 2025 23:32:29 GMT, Serguei Spitsyn wrote: >> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: >> >> feedback > > src/hotspot/share/prims/jvmtiTagMap.cpp line 2193: > >> 2191: }; >> 2192: >> 2193: // A supporting closure used to process ClassLoaderData roots > > Nit: Need dot at the end of comment. Fixed > test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 79: > >> 77: >> 78: for (int i = 0; i < class_counter; i++) { >> 79: tags[i] = i+1; > > Nit: Need spaces around `+` sign. Fixed. > test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 101: > >> 99: } >> 100: >> 101: > > Nit: Unneeded extra empty line. removed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524717090 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524716711 PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524717427 From lmesnik at openjdk.org Thu Nov 13 19:53:12 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 19:53:12 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS [v2] In-Reply-To: References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: <_yYrCkPQbFXAsI5lfc4ErWuwr585DFf_5h2alB5nF5E=.2beeda93-1e9e-4694-9188-302e72c52f05@github.com> On Thu, 13 Nov 2025 19:42:00 GMT, Alex Menkov wrote: >> FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. >> All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. >> The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER >> >> Testing: tier1..4,hs-tier5-svc > > Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: > > feedback Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28224#pullrequestreview-3461421197 From lmesnik at openjdk.org Thu Nov 13 19:53:14 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 19:53:14 GMT Subject: RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS [v2] In-Reply-To: References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: On Thu, 13 Nov 2025 19:18:38 GMT, Alex Menkov wrote: >> test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp line 43: >> >>> 41: switch (reference_kind) { >>> 42: case JVMTI_HEAP_REFERENCE_SYSTEM_CLASS: >>> 43: *tag_ptr = ++class_counter; >> >> The callback is executed on VMThread, so counters should be atomic or protected by monitors. > > Not sure I follow. There is no concurrent access to the variables. > FollowReferences is executed at safepoint (so the counters are updated by single thread). The values are read after FollowReference returns (i.e. after the safepoint) Thanks for explanation. Then it is no need to synchronize. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524733585 From macarte at openjdk.org Thu Nov 13 19:55:24 2025 From: macarte at openjdk.org (Mat Carter) Date: Thu, 13 Nov 2025 19:55:24 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v8] In-Reply-To: References: Message-ID: > Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. > > The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE > > It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses: > > TRUE > FALSE > > Passes tier1 on linux (x64) and windows (x64) Mat Carter has updated the pull request incrementally with one additional commit since the last revision: Remove single whitespace ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28010/files - new: https://git.openjdk.org/jdk/pull/28010/files/b97a799f..f4a4af61 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=06-07 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28010.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010 PR: https://git.openjdk.org/jdk/pull/28010 From dcubed at openjdk.org Thu Nov 13 20:35:28 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:35:28 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 The transaction diagram in SuspendWithObjectMonitorWait.java on L56 -> L77 is for the `doWork1` test so the comment should be modifed to make that clear by adding this above L56: // // doWork1 algorithm: I've created a transaction diagram for doWork2: // // doWork2 algorithm: // // main waiter resumer // ================= ================== =================== // launch waiter // waiter running // launch resumer enter threadLock // threadLock.wait() resumer running // enter threadLock : wait for notify // threadLock.notify wait finishes : // : reenter blocks : // suspend waiter : // : : // : : : // notify resumer : wait finishes // delay 1-second : : // exit threadLock : : // join resumer : enter threadLock // : resume waiter // : : exit threadLock // : reenter threadLock : // : resumer exits // join waiter : // waiter exits // // Note: The sleep(1-second) in main along with the delayed exit // of threadLock in main forces the resumer thread to reach // "enter threadLock" and block. This difference from doWork1 // forces the resumer thread to be contending for threadLock // while the waiter thread is in threadLock.wait() increasing // stress on the monitor sub-system. // I've created a transaction diagram for doWork3: // // doWork3 algorithm: // // main waiter resumer // =================== ====================== =================== // launch waiter // waiter running // launch resumer enter threadLock // while !READY_TO_NOTIFY resumer running // delay 1-second threadLock.wait(1) wait for notify // enter threadLock : : // set READY_TO_NOTIFY : // threadLock.notify wait finishes : // : reenter blocks : // suspend waiter : // : : // : : : // notify resumer : wait finishes // delay 1-second : : // exit threadLock : : // join resumer : enter threadLock // : resume waiter // : : exit threadLock // : reenter threadLock : // : resumer exits // join waiter : // waiter exits // // Note: The sleep(1-second) in main along with the delayed exit // of threadLock in main forces the resumer thread to reach // "enter threadLock" and block. This difference from doWork1 // forces the resumer thread to be contending for threadLock // while the waiter thread is in the threadLock.wait(1) tight // loop increasing stress on the monitor sub-system. // // Note: The first sleep(1-second) in main and the wait(1) in the waiter // thread allows the waiter thread to loop tightly here: // while !READY_TO_NOTIFY // threadLock.wait(1) // ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3529595262 PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3529599987 PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3529602353 From dcubed at openjdk.org Thu Nov 13 20:46:49 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:46:49 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 Marked as reviewed by dcubed (Reviewer). test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 110: > 108: > 109: public static void main(String[] args) throws Exception { > 110: int test = Integer.parseInt(args[0]); I think this will throw if the test is called without any parameters. Also, the `usage` function needs to be updated to reflect the addition of the test number parameter. ------------- PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3461580809 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524858587 From dcubed at openjdk.org Thu Nov 13 20:46:52 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:46:52 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 19:20:40 GMT, Patricio Chilano Mateo wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 31: > >> 29: * @library /test/lib >> 30: * @compile SuspendWithObjectMonitorWait.java >> 31: * @run main/othervm/native -agentlib:SuspendWithObjectMonitorWait SuspendWithObjectMonitorWait 1 > > Note that these passed values are overriding timeMax. The addition of the test number should have been done as a required parameter. That would push the optional timeMax parameter to be the optional second parameter. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524856106 From dcubed at openjdk.org Thu Nov 13 20:46:54 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:46:54 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: <01keWsXsYrIpmL3GwgAFqXYuTxfM1ohW_J9FWsGsnIA=.84c0fbc2-df37-45e0-99eb-f7291dc33410@github.com> References: <01keWsXsYrIpmL3GwgAFqXYuTxfM1ohW_J9FWsGsnIA=.84c0fbc2-df37-45e0-99eb-f7291dc33410@github.com> Message-ID: On Wed, 12 Nov 2025 20:04:19 GMT, Daniel D. Daugherty wrote: >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 372: >> >>> 370: // - a threadLock enter in the resumer thread >>> 371: // - resumption of the waiter thread >>> 372: // - a threadLock enter in the freshly resumed waiter thread >> >> This list of step tests is identical to the list on L490 -> L493 and the >> original llist on L256 -> L259. >> >> This step comment: >> `370: // - a threadLock enter in the resumer thread` >> should be updated to something like: >> >> // - a blocked threadLock enter in the resumer thread while the >> // threadLock is held by the main thread. >> >> >> This change of threadLock scope also requires this update from: >> >> 605: // - tries to grab the threadLock (should not block!) >> >> >> to: >> >> 605: // - tries to grab the threadLock (should not block with doWork1!) > > I can't figure out why we're delaying the resumer thread in `doWork2`. Update: I figured this out. See the new doWork2 transaction diagram. >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 493: >> >>> 491: // - a threadLock enter in the resumer thread >>> 492: // - resumption of the waiter thread >>> 493: // - a threadLock enter in the freshly resumed waiter thread >> >> This list of step tests is identical to the list on L369 -> L372 and the >> original llist on L256 -> L259. >> >> This step comment: >> >> 491: // - a threadLock enter in the resumer thread >> >> should be updated to something like: >> >> // - a blocked threadLock enter in the resumer thread while the >> // threadLock is held by the main thread. > > I can't figure out why we're delaying the resumer thread in `doWork3`. Update: I figured this out. See the new doWork3 transaction diagram. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524860241 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524872816 From dcubed at openjdk.org Thu Nov 13 20:46:58 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:46:58 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 19:16:57 GMT, Patricio Chilano Mateo wrote: >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 388: >> >>> 386: try { >>> 387: Thread.sleep(1000); >>> 388: } catch(Exception e) {} >> >> Why is this 1 second delay needed? > > We need to give time for the resumer thread to block on the `threadLock` before we release it. We could reduce the amount of sleep time though. Agreed. I pretty much said the same thing about the resumer thread in the new doWork2 transaction diagram (and the new doWork3 transaction diagram). >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 428: >> >>> 426: // launch the waiter thread >>> 427: synchronized (barrierLaunch) { >>> 428: waiter = new SuspendWithObjectMonitorWaitWorker("waiter", 1); >> >> This change to `wait` for `1` instead of `0` requires this comment to be updated from: >> >> // TS_READY_TO_NOTIFY is set after the main thread has >> // entered threadLock so a spurious wakeup can't get the >> // waiter thread out of this threadLock.wait(0) call: >> >> to: >> >> // TS_READY_TO_NOTIFY is set after the main thread has >> // entered threadLock so a spurious wakeup can't get the >> // waiter thread out of this threadLock.wait(0) call in >> // doWork1 or doWork2. doWork3 passes a one so that the >> // wait() can terminate early and block on reentry. >> >> >> I'm having trouble seeing why this third test case is necessary. We do a short `wait(1)` >> in this test case instead of a `wait(0)` so we terminate the `wait(1)` with a timeout instead >> of a `notify()` from the main thread. >> >> In all worker test cases, the main thread grabs the threadsLock when the "waiter" thread >> calls `wait()`, the main thread does a `notify()`, the main thread waits until the worker >> thread contends on threadsLock and finally the main thread suspends the worker thread. >> The only thing that I see that the `wait(1)` brings to the party is that the worker3 thread >> might get to re-entry block on threadsLock via a timeout instead of a notify. >> >> What am I missing here? > > The `notify()` call doesn?t unpark the waiter thread, it just moves it from the `_wait_set` to the `_entry_list`. The wait(timeout) is there to allow it to run again so that it is suspended in `reenter_internal()`. But currently the timings will not exercise this case well. I added some comments to fix it. Please see the notes in the new doWork3 transaction diagram. I think I've covered this case. >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 454: >> >>> 452: try { >>> 453: Thread.sleep(1000); >>> 454: } catch(Exception e) {} >> >> Why is this 1 second delay needed? > > This sleep is not needed. I have a comment about this in the new doWork3 transaction diagram. >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 509: >> >>> 507: try { >>> 508: Thread.sleep(1000); >>> 509: } catch(Exception e) {} >> >> Why is this 1 second delay needed? > > Same here, we need to give time for the resumer thread to block on the threadLock before we release it. Agreed. I pretty much said the same thing about the resumer thread in the new doWork3 transaction diagram (and the new doWork2 transaction diagram). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524862590 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524866785 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524870502 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2524875174 From dcubed at openjdk.org Thu Nov 13 20:54:16 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Thu, 13 Nov 2025 20:54:16 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 13:29:07 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: >> >> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Removed incorrect assert, > - 8366659: Fixed merge conflict > - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 So the bug report talks about two different deadlocks and we have added two new test cases to SuspendWithObjectMonitorWait.java. I think the new `doWork2` test case is added to catch deadlock-1 when we have a suspended thread made the successor over and over again so that none of the other contending threads ever get the monitor even though it is unlocked. I think the new `doWork3` test case is added to catch deadlock-2 where the waiting thread manages to re-enter the monitor and then gets suspended while on its way back to Java. @toxaart and/or @pchilano - Please verify my understanding of this mapping from the two new test cases to the two deadlocks. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3529662045 From pchilanomate at openjdk.org Thu Nov 13 21:49:46 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 13 Nov 2025 21:49:46 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 20:50:57 GMT, Daniel D. Daugherty wrote: > So the bug report talks about two different deadlocks and we have added two new test cases to SuspendWithObjectMonitorWait.java. > > I think the new `doWork2` test case is added to catch deadlock-1 when we have a suspended thread made the successor over and over again so that none of the other contending threads ever get the monitor even though it is unlocked. > > I think the new `doWork3` test case is added to catch deadlock-2 where the waiting thread manages to re-enter the monitor and then gets suspended while on its way back to Java. > > @toxaart and/or @pchilano - Please verify my understanding of this mapping from the two new test cases to the two deadlocks. Thanks! > The PR description of the cases isn?t quite accurate. The explanation in `1.` applies to both deadlocks, the only difference is where the successor could be suspended: [1] https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 (exercised by doWork2) [2] https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 (exercised by doWork3) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3529846713 From cjplummer at openjdk.org Thu Nov 13 22:22:18 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 13 Nov 2025 22:22:18 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> Message-ID: <7KUmTufrD6xtVMSP1L4QEFdXxRSe0hyoVV0KTwdgKDI=.76640a01-7d86-438f-9614-684b11773c37@github.com> On Sun, 9 Nov 2025 10:30:45 GMT, Serguei Spitsyn wrote: >> This is fix is to increase the `EXPECTED_ACCURACY` value in the test: >> `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. >> It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. >> >> Testing: >> - TBD: Verify the test with mach5 test runs > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: restore original EXPECTED_ACCURACY for Windows Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28206#pullrequestreview-3461917746 From cjplummer at openjdk.org Thu Nov 13 22:23:06 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 13 Nov 2025 22:23:06 GMT Subject: RFR: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni [v2] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 07:54:42 GMT, Leonid Mesnik wrote: >> Please review following fix that adds jni exception check after calling java code. >> >> Tested by running test with and without -Xcheck:jni. > > Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: > > error message fixed Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28280#pullrequestreview-3461921809 From sspitsyn at openjdk.org Thu Nov 13 22:47:00 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 13 Nov 2025 22:47:00 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v3] In-Reply-To: References: Message-ID: > This is fix is to increase the `EXPECTED_ACCURACY` value in the test: > `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. > It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. > > Testing: > - TBD: Verify the test with mach5 test runs Serguei Spitsyn 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 three additional commits since the last revision: - Merge - review: restore original EXPECTED_ACCURACY for Windows - 8349192: Test jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28206/files - new: https://git.openjdk.org/jdk/pull/28206/files/c53f9b40..e98facf9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28206&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28206&range=01-02 Stats: 245054 lines in 1955 files changed: 157091 ins; 53344 del; 34619 mod Patch: https://git.openjdk.org/jdk/pull/28206.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28206/head:pull/28206 PR: https://git.openjdk.org/jdk/pull/28206 From duke at openjdk.org Thu Nov 13 23:49:28 2025 From: duke at openjdk.org (Ruben) Date: Thu, 13 Nov 2025 23:49:28 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. Ruben has updated the pull request incrementally with one additional commit since the last revision: Add an assertion to detect out of bounds access in post-call NOP checks ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28192/files - new: https://git.openjdk.org/jdk/pull/28192/files/7bb43523..20cc58a3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=00-01 Stats: 71 lines in 18 files changed: 65 ins; 2 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/28192.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28192/head:pull/28192 PR: https://git.openjdk.org/jdk/pull/28192 From duke at openjdk.org Thu Nov 13 23:49:29 2025 From: duke at openjdk.org (Ruben) Date: Thu, 13 Nov 2025 23:49:29 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 10:50:13 GMT, Martin Doerr wrote: >> Ruben has updated the pull request incrementally with one additional commit since the last revision: >> >> Add an assertion to detect out of bounds access in post-call NOP checks > > src/hotspot/cpu/x86/nativeInst_x86.hpp line 585: > >> 583: }; >> 584: >> 585: bool check() const { return short_at(0) == 0x1f0f && short_at(2) == 0x0084; } > > Maybe a comment would be nice. Thanks for the suggestion. Would the comments added at https://github.com/openjdk/jdk/pull/28192/commits/20cc58a3649db0650da054809f64e0c4416d616f be suitable? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28192#discussion_r2525276626 From lmesnik at openjdk.org Thu Nov 13 23:57:10 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 13 Nov 2025 23:57:10 GMT Subject: Integrated: 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 02:51:35 GMT, Leonid Mesnik wrote: > Please review following fix that adds jni exception check after calling java code. > > Tested by running test with and without -Xcheck:jni. This pull request has now been integrated. Changeset: 155d7df5 Author: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/155d7df555fcebc318db89408ef0fffbd95414a0 Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod 8371749: New test serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/TestAllocatingInVMDeath.java fails with -Xcheck:jni Reviewed-by: sspitsyn, amenkov, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/28280 From iklam at openjdk.org Fri Nov 14 04:48:16 2025 From: iklam at openjdk.org (Ioi Lam) Date: Fri, 14 Nov 2025 04:48:16 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: <9o8TjNxCbwshwMuqpS-CyyhwNciw1WQ6w1_ijy39DEc=.fe11d68c-f925-4c07-9c46-42c9093a5448@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> <9o8TjNxCbwshwMuqpS-CyyhwNciw1WQ6w1_ijy39DEc=.fe11d68c-f925-4c07-9c46-42c9093a5448@github.com> Message-ID: On Thu, 13 Nov 2025 17:01:45 GMT, Ioi Lam wrote: > > The filler-klass is not initialized when `preload_classes` is invoked, but `preload_classes` use heap-allocation, which may require filler-obj. > > @iklam What do you think? > > I am working on a fix now. The fix is quite simple. See https://github.com/openjdk/jdk/pull/28315 ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3530816677 From dfuchs at openjdk.org Fri Nov 14 10:10:01 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 14 Nov 2025 10:10:01 GMT Subject: RFR: 8353738: Update TLS unit tests to not use certificates with MD5 signatures [v5] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 14:32:33 GMT, Daniel Jeli?ski wrote: >> Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: >> >> changed line wrapping > > test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IdentitiesBase.java line 104: > >> 102: CertificateBuilder.KeyUsage.KEY_ENCIPHERMENT) >> 103: .addBasicConstraintsExt(false, false, -1) >> 104: .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1")) > > I assume you verified that the DNSIdentities customization overwrites the SAN configured here, but I'd feel more confident if this line were moved to customizeServerCert in IPIdentities If there is an alternative SAN for IPv4 loopback address there should be one for the IPv6 loopback too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2526848102 From duke at openjdk.org Fri Nov 14 11:11:43 2025 From: duke at openjdk.org (Jonas Norlinder) Date: Fri, 14 Nov 2025 11:11:43 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v10] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 18:08:31 GMT, Jonas Norlinder wrote: >> Hi all, >> >> This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. >> >> `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. >> >> FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. >> >> Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Fix phohensee review comments Thanks Kevin! > Just a question on whether we really need to specify the GCs in the tests. I think it is required for the shutdown test and we need to keep them all. However, we may omit this for the trivial API test. Would that be a reasonable compromise? I'd suggest to keep Epsilon and G1 for `TestGetTotalGcCpuTime`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27537#issuecomment-3532230611 From duke at openjdk.org Fri Nov 14 11:29:48 2025 From: duke at openjdk.org (Jonas Norlinder) Date: Fri, 14 Nov 2025 11:29:48 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v11] In-Reply-To: References: Message-ID: > Hi all, > > This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. > > `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. > > FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. > > Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: Reduce GC coverage for trivial API test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27537/files - new: https://git.openjdk.org/jdk/pull/27537/files/44f5d864..8fd1ee09 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27537&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27537&range=09-10 Stats: 36 lines in 1 file changed: 0 ins; 36 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27537.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27537/head:pull/27537 PR: https://git.openjdk.org/jdk/pull/27537 From ayang at openjdk.org Fri Nov 14 11:54:12 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 14 Nov 2025 11:54:12 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v5] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 20:28:41 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Fix TestMisc for podman on cg v1 in rootless mode. Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28157#pullrequestreview-3464591706 From aartemov at openjdk.org Fri Nov 14 12:04:26 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:26 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v7] In-Reply-To: References: Message-ID: <-UqELJ5fcs2hmKx51_i77VwQGSq70cV4Wd73_6YkcGA=.2d572210-d0f7-45a1-9fd4-9b06f2e5609c@github.com> > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible. There are two places where it can happen: > > 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM. > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Fixed the test. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/702880c6..15efce1b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=05-06 Stats: 105 lines in 1 file changed: 88 ins; 4 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aartemov at openjdk.org Fri Nov 14 12:04:30 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:30 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: <1sh5xXfgN3ykKP6JO7fkEO-06usdJoBMp_igGw9OzJI=.b9325a92-1e8d-49a2-aaed-b7a154d9bb6a@github.com> On Thu, 13 Nov 2025 20:50:57 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 > > So the bug report talks about two different deadlocks and we have added two new test cases to SuspendWithObjectMonitorWait.java. > > I think the new `doWork2` test case is added to catch deadlock-1 when we have a suspended > thread made the successor over and over again so that none of the other contending threads > ever get the monitor even though it is unlocked. > > I think the new `doWork3` test case is added to catch deadlock-2 where the waiting thread > manages to re-enter the monitor and then gets suspended while on its way back to Java. > > @toxaart and/or @pchilano - Please verify my understanding of this mapping from the two > new test cases to the two deadlocks. Thanks! Thanks @dcubed-ojdk and @pchilano, I addressed all the points. The diagrams are now added to the test. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 110: > >> 108: >> 109: public static void main(String[] args) throws Exception { >> 110: int test = Integer.parseInt(args[0]); > > I think this will throw if the test is called without any parameters. > > Also, the `usage` function needs to be updated to reflect the addition of the > test number parameter. Addressed in the latest commit. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 297: > >> 295: } >> 296: >> 297: // Notify the resumer while holding the threadLock > > Nit: please add a period at the end of this sentence. Addressed in the latest commit. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3532412149 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527249217 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527245664 From aartemov at openjdk.org Fri Nov 14 12:04:32 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:32 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: <4J4hAvATWVRnKGA8E1_R2dYYY-QPd6rWm6BQECf2jpI=.e624cd45-7b4b-4f55-a870-3cfb66f577c4@github.com> On Thu, 13 Nov 2025 20:34:46 GMT, Daniel D. Daugherty wrote: >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 31: >> >>> 29: * @library /test/lib >>> 30: * @compile SuspendWithObjectMonitorWait.java >>> 31: * @run main/othervm/native -agentlib:SuspendWithObjectMonitorWait SuspendWithObjectMonitorWait 1 >> >> Note that these passed values are overriding timeMax. > > The addition of the test number should have been done as a required parameter. > That would push the optional timeMax parameter to be the optional second parameter. Addressed in the latest commit. I did not figure out how to do it with jtreg, made it instead right in the test code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527248823 From aartemov at openjdk.org Fri Nov 14 12:04:32 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:32 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: <01keWsXsYrIpmL3GwgAFqXYuTxfM1ohW_J9FWsGsnIA=.84c0fbc2-df37-45e0-99eb-f7291dc33410@github.com> Message-ID: On Thu, 13 Nov 2025 20:36:37 GMT, Daniel D. Daugherty wrote: >> I can't figure out why we're delaying the resumer thread in `doWork2`. > > Update: I figured this out. See the new doWork2 transaction diagram. Addressed. >> I can't figure out why we're delaying the resumer thread in `doWork3`. > > Update: I figured this out. See the new doWork3 transaction diagram. Addressed the comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527246445 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527246193 From aartemov at openjdk.org Fri Nov 14 12:04:33 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:33 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 20:38:52 GMT, Daniel D. Daugherty wrote: >> The `notify()` call doesn?t unpark the waiter thread, it just moves it from the `_wait_set` to the `_entry_list`. The wait(timeout) is there to allow it to run again so that it is suspended in `reenter_internal()`. But currently the timings will not exercise this case well. I added some comments to fix it. > > Please see the notes in the new doWork3 transaction diagram. I think I've covered this case. Thanks @dcubed-ojdk! I added your diagrams to the test. >> This sleep is not needed. > > I have a comment about this in the new doWork3 transaction diagram. Removed as suggested. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527248191 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527245983 From aartemov at openjdk.org Fri Nov 14 12:04:36 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:04:36 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v6] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 19:13:39 GMT, Patricio Chilano Mateo wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Removed incorrect assert, >> - 8366659: Fixed merge conflict >> - ... and 10 more: https://git.openjdk.org/jdk/compare/400a83da...702880c6 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 428: > >> 426: // launch the waiter thread >> 427: synchronized (barrierLaunch) { >> 428: waiter = new SuspendWithObjectMonitorWaitWorker("waiter", 1); > > We should increase this timeout to minimize the chance of it happening between the main thread acquiring the `threadLock` and issuing the notification, in which case the waiter will not go through `reenter_internal` but through `enter`. Also it avoids some funny scheduling where the main thread never acquires the `threadLock`. Done. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 466: > >> 464: testState = TS_READY_TO_NOTIFY; >> 465: threadLock.notify(); >> 466: > > We should add a `Thread.sleep` here to give time for the wait to timeout before suspending the waiter thread. Should be more than what the waiter thread is using as timeout. I have tested a timeout value of 100ms and here sleeping 200ms and always see the deadlock on `reenter_internal` (with current mainline code). Removed the sleep which was not needed and added another one with 200ms as suggested. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527251981 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2527248616 From kevinw at openjdk.org Fri Nov 14 12:11:11 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Fri, 14 Nov 2025 12:11:11 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v10] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 11:08:40 GMT, Jonas Norlinder wrote: > I think it is required for the shutdown test and we need to keep them all. However, we may omit this for the trivial API test. Would that be a reasonable compromise? I'd suggest to keep Epsilon and G1 for `TestGetTotalGcCpuTime`. OK that's great to cut it down a bit, thanks. I meant I think we need to remove all the specific GCs from that test, and let the test harness run with the variety of collectors. If test/jdk/java/lang/management/MemoryMXBean/TestGetTotalGcCpuTime.java specifies those two, doesn't it only run with those two? We want most code to be tested with a variety of collectors, we should get that if we just say nothing. 8-) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27537#issuecomment-3532441029 From aartemov at openjdk.org Fri Nov 14 12:15:35 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Fri, 14 Nov 2025 12:15:35 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed the test. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed lines in tests. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Added a comment to a boolean arg for enter() - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - 8366659: Fixed new lines. - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock - ... and 12 more: https://git.openjdk.org/jdk/compare/ff851de8...2ac18b94 ------------- Changes: https://git.openjdk.org/jdk/pull/27040/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=07 Stats: 469 lines in 3 files changed: 397 ins; 44 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From kevinw at openjdk.org Fri Nov 14 13:01:08 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Fri, 14 Nov 2025 13:01:08 GMT Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 19:41:40 GMT, Mat Carter wrote: >> Add jcmd AOT.end_recording diagnostic command. When this command is issued, a targeted JVM that is currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. >> >> The command will report back to the user one of the following messages depending on the state of the JVM: >> >> - Error! Not a recording run >> - Error! Not recording >> - Recording ended successfully >> - Error! Failed to end recording >> >> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses: >> >> - Recording ended successfully >> - Error! Not recording >> >> Passes tier1 on linux (x64) and windows (x64) > > Mat Carter has updated the pull request incrementally with one additional commit since the last revision: > > Document use of DiagnosticCommand src/hotspot/share/services/diagnosticCommand.cpp line 991: > 989: } > 990: > 991: #if INCLUDE_CDS A simple style nit-pick: Error! The JVM doesn't really dramatize problems like that. It tells you there was an error, and calmly describes the problem after a colon. "Error: " 8-) (There are some "Error!" exclamations in java.xml and one has got into jdk.jfr, but they are unusual.) You can tell me that nit-picking is NOT hyphenated if you like. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2527414361 From sgehwolf at openjdk.org Fri Nov 14 13:15:18 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 14 Nov 2025 13:15:18 GMT Subject: RFR: 8370492: [Linux] Update cpu shares to cpu.weight mapping function [v5] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 20:28:41 GMT, Severin Gehwolf wrote: >> Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. >> >> For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): >> >> >> f(x) = {(x - 2) \times 9999 + 1 \over 262142} >> >> >> This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: >> >> >> f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} >> >> >> Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. >> >> Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. >> >> Thoughts? >> >> **Testing:** >> - [x] GHA >> - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Fix TestMisc for podman on cg v1 in rootless mode. Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28157#issuecomment-3532678185 From sgehwolf at openjdk.org Fri Nov 14 13:15:19 2025 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Fri, 14 Nov 2025 13:15:19 GMT Subject: Integrated: 8370492: [Linux] Update cpu shares to cpu.weight mapping function In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 18:13:55 GMT, Severin Gehwolf wrote: > Please review this change to the Linux container detection code updating the mapping function of cg v2 to most recent runtimes' implementation. OCI has been standardized with cgroup v1 in mind and there is a mapping function in place - implemented by container runtimes such as `runc` or `crun` - which map the passed `--cpu-shares` value on the engine's `run` command to the internal cgroup v2 `cpu.weight` interface file's values. > > For runtimes lower than 1.23 (crun) and 1.3.2 (runc) the mapping function was (where `f(x)=` and `x=`): > > > f(x) = {(x - 2) \times 9999 + 1 \over 262142} > > > This changed in `crun` >= 1.23 and `runc` >= 1.3.2 to: > > > f(x)=10^{({{\log_{2}(x)}^2 \over 612} + {125 \over 612} \times \log_{2}(x) - {7 \over 34})} > > > Therefore, we need to find the inverse of the new quadratic mapping function and use that over the inverse of the old mapping function. Since the input domain is `[2,262144]` for `--cpu-shares` mapping to `[1,10000]` for `cpu.weight` we can discount the negative exponent value as a possible solution. > > Since there are production systems out there with those runtimes already I believe it's time to change the mapping function internal to the JDK to the new one in JDK 26. There is a chance that JDK 26 would run on old runtimes in a container using cgroup v2, resulting in wrong diagnostics. The chance of this happening will decrease over time. > > Thoughts? > > **Testing:** > - [x] GHA > - [x] `test/hotspot/jtreg/containers` and `test/jdk/jdk/internal/platform` on cgroup v1 (with an old runtime - code not affected) and on cgroup v2 with a new runtime. All tests passed. This pull request has now been integrated. Changeset: 5d65c23c Author: Severin Gehwolf URL: https://git.openjdk.org/jdk/commit/5d65c23cd99b72527dcfab9eb6da9510e7dc6330 Stats: 107 lines in 4 files changed: 90 ins; 0 del; 17 mod 8370492: [Linux] Update cpu shares to cpu.weight mapping function Reviewed-by: cnorrbin, ayang, syan ------------- PR: https://git.openjdk.org/jdk/pull/28157 From kevinw at openjdk.org Fri Nov 14 14:52:16 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Fri, 14 Nov 2025 14:52:16 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v11] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 11:29:48 GMT, Jonas Norlinder wrote: >> Hi all, >> >> This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. >> >> `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. >> >> FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. >> >> Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Reduce GC coverage for trivial API test Or, if we don't want to remove the GC specifics and go with what the framework sets, then we should revert that last delete, sorry, otherwise with will just not be run with all GCs. I was thinking it was more efficient to say nothing in the test, but can leave this to be done with specifics in the test if you like. 8-) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27537#issuecomment-3533138317 From dcubed at openjdk.org Fri Nov 14 18:19:40 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 14 Nov 2025 18:19:40 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 12:15:35 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: > > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed the test. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed lines in tests. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Added a comment to a boolean arg for enter() > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - 8366659: Fixed new lines. > - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock > - ... and 12 more: https://git.openjdk.org/jdk/compare/ff851de8...2ac18b94 Another crawl thru review of the test with more suggested changes. I'll be doing one last round of commenting on the argument parsing stuff. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 124: > 122: // launch resumer enter threadLock > 123: // while !READY_TO_NOTIFY resumer running > 124: // delay 1-second threadLock.wait(1) wait for notify We've deleted this sleep, so this line should change from: // delay 1-second threadLock.wait(1) wait for notify to: // : threadLock.wait(1) wait for notify test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 128: > 126: // set READY_TO_NOTIFY : > 127: // threadLock.notify wait finishes : > 128: // : reenter blocks : We added a sleep here, so this line should change from: // : reenter blocks : to: // : delay 200ms reenter blocks : test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 153: > 151: // thread allows the waiter thread to loop tightly here: > 152: // while !READY_TO_NOTIFY > 153: // threadLock.wait(1) Please replace this note with the following: // Note: sleep(200ms) here while holding the threadLock to allow the waiter thread's // timed wait to finish before we attempt to suspend the waiter thread. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 212: > 210: argsLeft--; > 211: } > 212: if (argsLeft == 0) { Because of the addition of a mandatory argument (test case), argument parsing will be more complicated. I need to mull on this a bit and I'll post another suggestion after this round. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 237: > 235: > 236: public static void usage() { > 237: System.err.println("Usage: " + AGENT_LIB + " [N][-p][time_max]"); The `N` argument is not optional so it should not be surrounded by `[` and `]`. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 239: > 237: System.err.println("Usage: " + AGENT_LIB + " [N][-p][time_max]"); > 238: System.err.println("where:"); > 239: System.err.println(" N ::= test case"); s/case/case: 1 | 2 | 3/ test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 470: > 468: } > 469: try { > 470: Thread.sleep(1000); Please add something like this above the `sleep`: // Delay for 1-second while holding the threadLock to force the // resumer thread to block on entering the threadLock. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 552: > 550: // wait for the waiter thread to block > 551: logDebug("before contended enter wait"); > 552: int retCode = wait4ContendedEnter(waiter); Since we are waiting here for ContendedEnter by the waiter thread, do we really need the above `sleep(200)` or are we just being polite CPU resource wise? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 592: > 590: } > 591: try { > 592: Thread.sleep(1000); Please add something like this above the sleep: // Delay for 1-second while holding the threadLock to force the // resumer thread to block on entering the threadLock. ------------- Marked as reviewed by dcubed (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3466061446 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528454607 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528465014 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528473772 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528423196 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528406725 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528408659 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528432284 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528443735 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528446025 From kvn at openjdk.org Fri Nov 14 18:41:11 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Fri, 14 Nov 2025 18:41:11 GMT Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 19:41:40 GMT, Mat Carter wrote: >> Add jcmd AOT.end_recording diagnostic command. When this command is issued, a targeted JVM that is currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated. >> >> The command will report back to the user one of the following messages depending on the state of the JVM: >> >> - Error! Not a recording run >> - Error! Not recording >> - Recording ended successfully >> - Error! Failed to end recording >> >> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses: >> >> - Recording ended successfully >> - Error! Not recording >> >> Passes tier1 on linux (x64) and windows (x64) > > Mat Carter has updated the pull request incrementally with one additional commit since the last revision: > > Document use of DiagnosticCommand Comments. src/hotspot/share/cds/aotMetaspace.cpp line 961: > 959: } > 960: > 961: bool AOTMetaspace::is_recording_preimage_static_archive() { I think the name should be `preimage_static_archive_dumped()` to match field's name you accessing and check ` == 1` instead. The code in `AOTEndRecordingDCmd::execute()` will be more clear then. src/hotspot/share/cds/aotMetaspace.cpp line 962: > 960: > 961: bool AOTMetaspace::is_recording_preimage_static_archive() { > 962: if (CDSConfig::is_dumping_preimage_static_archive()) { This is called after you already checked `CDSConfig::is_dumping_preimage_static_archive()`. May be replace the check with assert. src/hotspot/share/cds/aotMetaspace.cpp line 973: > 971: return; > 972: } > 973: } Add comment that this could be called from different threads and possibly concurrently: when JCMD requested it and normal call during VM exit. We should dump archive only once. src/hotspot/share/services/diagnosticCommand.cpp line 996: > 994: output()->print_cr("Error! Not a recording run"); > 995: return; > 996: } First, is `output()` directed to VM's tty or somewhere else? Second, I think you need to be more verbose in error. Maybe: Error: AOT recording is not initiated. VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing. src/hotspot/share/services/diagnosticCommand.cpp line 1000: > 998: if (!AOTMetaspace::is_recording_preimage_static_archive()) { > 999: output()->print_cr("Error! Not recording"); > 1000: return; This check is confusing because your error message is cryptic. Actually I think you don't need any message here - it is not error. Use comment instead: // The other thread already initiated end of recording. src/hotspot/share/services/diagnosticCommand.cpp line 1007: > 1005: output()->print_cr("Recording ended successfully"); > 1006: return; > 1007: } I think this should be reversed and message replaced with comment. if (AOTMetaspace::is_recording_preimage_static_archive()) { // Other thread already dumped archive. return; } output()->print_cr("AOT recording ended successfully"); ------------- PR Review: https://git.openjdk.org/jdk/pull/27965#pullrequestreview-3466124096 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528503476 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528453164 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528486742 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528446012 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528465285 PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2528496380 From pchilanomate at openjdk.org Fri Nov 14 18:42:09 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Fri, 14 Nov 2025 18:42:09 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: <4dipoan9jnaJpGdBc2b4tpnEDvxsIOSjSPrvIMwnka8=.1ad85705-c8d1-46a2-b364-2a5880386845@github.com> On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga wrote: >> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. >> >> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. >> >> Big thanks to @pchilano for your help! > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Update for Linux PPC64 and RISC-V Fix looks good to me (can't comment on the PPC and RISCV parts though). test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java line 40: > 38: * @requires vm.hasSA > 39: * @requires os.family == "linux" > 40: * @requires os.arch == "amd64" Can't we run the test on AArch64 now? ------------- PR Review: https://git.openjdk.org/jdk/pull/28284#pullrequestreview-3466259361 PR Review Comment: https://git.openjdk.org/jdk/pull/28284#discussion_r2528531491 From iklam at openjdk.org Fri Nov 14 19:13:04 2025 From: iklam at openjdk.org (Ioi Lam) Date: Fri, 14 Nov 2025 19:13:04 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: <09Z7-ZZkmzO2T0nkSl3czZlkhJPzun79PkiNngWrQcU=.472c6dd5-5f54-42f2-ae16-62cc74c197fe@github.com> On Thu, 13 Nov 2025 11:35:04 GMT, Albert Mingkun Yang wrote: >> We have seen crashes on many platforms (including x64) while running `make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders"`: >> >> SIGSEGV (0xb) at pc=0x00007f2f95a61e7a, pid=18554, tid=18557 >> V [libjvm.so+0x15bfe7a] MemAllocator::finish(HeapWordImpl**) const+0xca (klass.inline.hpp:72) >> V [libjvm.so+0x15c029f] ObjAllocator::initialize(HeapWordImpl**) const+0x2f (memAllocator.cpp:391) >> V [libjvm.so+0xb0630b] CollectedHeap::fill_with_object(HeapWordImpl**, unsigned long, bool)+0x27b (collectedHeap.cpp:491) >> V [libjvm.so+0x1c7a0bb] ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats*)+0x11b (threadLocalAllocBuffer.cpp:118) >> V [libjvm.so+0x15c0b14] MemAllocator::mem_allocate_inside_tlab_slow(MemAllocator::Allocation&) const+0x84 (memAllocator.cpp:286) >> V [libjvm.so+0x15c13ab] MemAllocator::mem_allocate(MemAllocator::Allocation&) const+0xbb (memAllocator.cpp:340) >> V [libjvm.so+0x15c14f9] MemAllocator::allocate() const+0xa9 (memAllocator.cpp:353) >> V [libjvm.so+0x1cc052e] TypeArrayKlass::allocate_common(int, bool, JavaThread*)+0x13e (collectedHeap.inline.hpp:41) >> V [libjvm.so+0x16fbc98] oopFactory::new_typeArray(BasicType, int, JavaThread*)+0x38 (typeArrayKlass.hpp:51) >> V [libjvm.so+0x106b0f3] java_lang_Class::restore_archived_mirror(Klass*, Handle, Handle, Handle, JavaThread*)+0x413 (javaClasses.cpp:1246) >> V [libjvm.so+0x14100bc] Klass::restore_unshareable_info(ClassLoaderData*, Handle, JavaThread*)+0x66c (klass.cpp:903) >> V [libjvm.so+0xfe2cb1] InstanceKlass::restore_unshareable_info(ClassLoaderData*, Handle, PackageEntry*, JavaThread*)+0x81 (instanceKlass.cpp:2823) >> V [libjvm.so+0x1c0f5ad] SystemDictionary::preload_class(Handle, InstanceKlass*, JavaThread*)+0x1ed (systemDictionary.cpp:1198) >> V [libjvm.so+0x676e83] AOTLinkedClassBulkLoader::preload_classes_in_table(Array*, char const*, Handle, JavaThread*)+0x1a3 (aotLinkedClassBulkLoader.cpp:103) >> V [libjvm.so+0x679af5] AOTLinkedClassBulkLoader::preload_classes_impl(JavaThread*)+0x165 (aotLinkedClassBulkLoader.cpp:76) >> V [libjvm.so+0x67c371] AOTLinkedClassBulkLoader::preload_classes(JavaThread*)+0x11 (aotLinkedClassBulkLoader.cpp:61) >> V [libjvm.so+0x1d5bf30] vmClasses::resolve_all(JavaThread*)+0x3e0 (vmClasses.cpp:126) >> V [libjvm.so+0x1c0f28c] SystemDictionary::initialize(JavaThread*)+0x10c (systemDictionary.cpp:1623) >> V [libjvm.so+0x1cc74ca] Uni... > >> ... make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders" > > I suspect the crash is caused by a preexisting issue that is exposed by this patch. > > In `vmClasses::resolve_all`: > > #if INCLUDE_CDS > if (CDSConfig::is_using_aot_linked_classes()) { > AOTLinkedClassBulkLoader::preload_classes(THREAD); > } > #endif > > // Preload commonly used klasses > vmClassID scan = vmClassID::FIRST; > // first do Object, then String, Class > resolve_through(VM_CLASS_ID(Object_klass), scan, CHECK); > CollectedHeap::set_filler_object_klass(vmClasses::Object_klass()); > > > The filler-klass is not initialized when `preload_classes` is invoked, but `preload_classes` use heap-allocation, which may require filler-obj. > > @iklam What do you think? @albertnetymk I've pushed https://github.com/openjdk/jdk/pull/28315. Please verify if it fixes the crash before integrating this PR. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3534185759 From ayang at openjdk.org Fri Nov 14 19:22:39 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 14 Nov 2025 19:22:39 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v3] In-Reply-To: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: > Trivial removing obsoleted code for unsupported arch. > > Test: tier1 Albert Mingkun Yang 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 three additional commits since the last revision: - Merge branch 'master' into remove-tlab-reserve - review - remove-tlab-reserve ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28240/files - new: https://git.openjdk.org/jdk/pull/28240/files/0e447848..d6c34da7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=01-02 Stats: 10141 lines in 159 files changed: 5771 ins; 3554 del; 816 mod Patch: https://git.openjdk.org/jdk/pull/28240.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28240/head:pull/28240 PR: https://git.openjdk.org/jdk/pull/28240 From amenkov at openjdk.org Fri Nov 14 19:42:21 2025 From: amenkov at openjdk.org (Alex Menkov) Date: Fri, 14 Nov 2025 19:42:21 GMT Subject: Integrated: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS In-Reply-To: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> References: <6rHIf2ptpmqaSNTLtKNv6bZSQCENxBpxnk3i193hOHE=.dbc266c3-e9b5-4c27-ac5a-5d9ca399ea87@github.com> Message-ID: On Mon, 10 Nov 2025 20:54:56 GMT, Alex Menkov wrote: > FollowReferences with null initial_object starts heap walking from "heap roots", which include system classes. > All oops from ClassLoaderDataGraph are reported with JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not classes. > The fix updates FollowReferences to report non-class objects from ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER > > Testing: tier1..4,hs-tier5-svc This pull request has now been integrated. Changeset: 3924a28a Author: Alex Menkov URL: https://git.openjdk.org/jdk/commit/3924a28a2281bbdb13fe9f1e0b5347d57197f8dc Stats: 209 lines in 3 files changed: 206 ins; 0 del; 3 mod 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS Reviewed-by: lmesnik, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28224 From dcubed at openjdk.org Fri Nov 14 20:09:08 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Fri, 14 Nov 2025 20:09:08 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 17:54:05 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed the test. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - ... and 12 more: https://git.openjdk.org/jdk/compare/ff851de8...2ac18b94 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 212: > >> 210: argsLeft--; >> 211: } >> 212: if (argsLeft == 0) { > > Because of the addition of a mandatory argument (test case), argument parsing will > be more complicated. I need to mull on this a bit and I'll post another suggestion > after this round. I emailed you an updated version of the current test (v07) with a better parser. Feel free to merge it in or not. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2528792374 From sspitsyn at openjdk.org Fri Nov 14 20:34:19 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 14 Nov 2025 20:34:19 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v3] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 22:47:00 GMT, Serguei Spitsyn wrote: >> This is fix is to increase the `EXPECTED_ACCURACY` value in the test: >> `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. >> It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. >> >> Testing: >> - TBD: Verify the test with mach5 test runs > > Serguei Spitsyn 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 three additional commits since the last revision: > > - Merge > - review: restore original EXPECTED_ACCURACY for Windows > - 8349192: Test jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Thank you for review, Chris! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28206#issuecomment-3534463535 From marcus.hirt at datadoghq.com Fri Nov 14 21:20:34 2025 From: marcus.hirt at datadoghq.com (Marcus Hirt) Date: Fri, 14 Nov 2025 22:20:34 +0100 Subject: Virtual Serviceability Meetup 2025 Message-ID: Hi all, The 17th of December we're organizing another OpenJDK Serviceability Meetup! Last time [1] 39 attendees from various companies (Oracle, Red Hat, Amazon, SAP, Datadog, Jetbrains, and more) came together to discuss problems and potential solutions related to OpenJDK serviceability. If you?re interested in participating, here?s the registration form: https://forms.gle/jFhiX8Wwfka58T8Z8 And here is a link to the form to propose topics: https://forms.gle/dnM79D43wbKnef7m6 Registration is open until the 28th of November. Hope to see you there! Kind regards, Marcus [1]: https://mail.openjdk.org/pipermail/serviceability-dev/2024-July/056669.html From duke at openjdk.org Fri Nov 14 21:21:16 2025 From: duke at openjdk.org (Jonas Norlinder) Date: Fri, 14 Nov 2025 21:21:16 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v12] In-Reply-To: References: Message-ID: > Hi all, > > This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. > > `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. > > FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. > > Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: Revert "Reduce GC coverage for trivial API test" This reverts commit 8fd1ee093066138c9aa5602dcac0e7db1916db6b. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27537/files - new: https://git.openjdk.org/jdk/pull/27537/files/8fd1ee09..97978d04 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27537&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27537&range=10-11 Stats: 36 lines in 1 file changed: 36 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27537.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27537/head:pull/27537 PR: https://git.openjdk.org/jdk/pull/27537 From duke at openjdk.org Fri Nov 14 21:23:22 2025 From: duke at openjdk.org (duke) Date: Fri, 14 Nov 2025 21:23:22 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v11] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 11:29:48 GMT, Jonas Norlinder wrote: >> Hi all, >> >> This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. >> >> `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. >> >> FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. >> >> Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Reduce GC coverage for trivial API test @JonasNorlinder Your change (at version 97978d04c241061cd0fdf656748bfe08da88017a) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27537#issuecomment-3534600306 From lmesnik at openjdk.org Fri Nov 14 22:52:07 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Fri, 14 Nov 2025 22:52:07 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v3] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 22:47:00 GMT, Serguei Spitsyn wrote: >> This is fix is to increase the `EXPECTED_ACCURACY` value in the test: >> `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. >> It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. >> >> Testing: >> - TBD: Verify the test with mach5 test runs > > Serguei Spitsyn 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 three additional commits since the last revision: > > - Merge > - review: restore original EXPECTED_ACCURACY for Windows > - 8349192: Test jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28206#pullrequestreview-3467119221 From sspitsyn at openjdk.org Fri Nov 14 23:08:04 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 14 Nov 2025 23:08:04 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v3] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 22:47:00 GMT, Serguei Spitsyn wrote: >> This is fix is to increase the `EXPECTED_ACCURACY` value in the test: >> `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. >> It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. >> >> Testing: >> - TBD: Verify the test with mach5 test runs > > Serguei Spitsyn 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 three additional commits since the last revision: > > - Merge > - review: restore original EXPECTED_ACCURACY for Windows > - 8349192: Test jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Thank you for review, Leonid! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28206#issuecomment-3534991646 From ysuenaga at openjdk.org Sat Nov 15 01:35:07 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 15 Nov 2025 01:35:07 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: <4dipoan9jnaJpGdBc2b4tpnEDvxsIOSjSPrvIMwnka8=.1ad85705-c8d1-46a2-b364-2a5880386845@github.com> References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> <4dipoan9jnaJpGdBc2b4tpnEDvxsIOSjSPrvIMwnka8=.1ad85705-c8d1-46a2-b364-2a5880386845@github.com> Message-ID: <4BLSKl8w2Lhm2HDKDQ6jwVRsWQMssF_tUak9wNk5mkg=.36bcf655-a812-4b2b-86b7-1f02251740a9@github.com> On Fri, 14 Nov 2025 18:36:31 GMT, Patricio Chilano Mateo wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update for Linux PPC64 and RISC-V > > test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java line 40: > >> 38: * @requires vm.hasSA >> 39: * @requires os.family == "linux" >> 40: * @requires os.arch == "amd64" > > Can't we run the test on AArch64 now? I think this PR works on Linux AArch64, but I'm not sure because previous change (#27885) worked on some Linux AArch64, but there are some platforms whch did not work. Thus I think it is better to keep this test for Linux AMD64 only. I couldn't reproduce the problem on Fedora Rawhide on Raspberry Pi 4, but there might be some issue because SA does not have DWARF parser for AArch 64 - it means the native we cannot find sender frame which depends on DWARF, does not use FP as frame pointer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28284#discussion_r2529372235 From sspitsyn at openjdk.org Sat Nov 15 01:54:20 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Sat, 15 Nov 2025 01:54:20 GMT Subject: Integrated: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) In-Reply-To: References: Message-ID: On Sat, 8 Nov 2025 00:15:24 GMT, Serguei Spitsyn wrote: > This is fix is to increase the `EXPECTED_ACCURACY` value in the test: > `hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001`. > It is used check that the waiting time between `MonitorWait` and `MonitorWaited` event is not big. It seems that in some corner cases this time can be bigger than expected. > > Testing: > - TBD: Verify the test with mach5 test runs This pull request has now been integrated. Changeset: f971ee5e Author: Serguei Spitsyn URL: https://git.openjdk.org/jdk/commit/f971ee5ea07e3e1c0efe447a416e7242f5e46a16 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) Reviewed-by: cjplummer, lmesnik ------------- PR: https://git.openjdk.org/jdk/pull/28206 From syan at openjdk.org Sat Nov 15 04:09:01 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 15 Nov 2025 04:09:01 GMT Subject: RFR: 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests In-Reply-To: <7kEYqfoRzlpl7vu5PbOXazM0R9E4NTu57jBH7jVSty4=.ca25f1a2-fb52-4e1b-b7b8-bd81493bc594@github.com> References: <7kEYqfoRzlpl7vu5PbOXazM0R9E4NTu57jBH7jVSty4=.ca25f1a2-fb52-4e1b-b7b8-bd81493bc594@github.com> Message-ID: On Sat, 8 Nov 2025 08:10:45 GMT, SendaoYan wrote: > Hi all, > > The DockerTestUtils.RETAIN_IMAGE_AFTER_TEST variable which read the property from "jdk.test.docker.retain.image" do not work for some of the docker tests, such as jdk/internal/platform/docker/TestDockerCpuMetrics.java, only works for some of the docker tests, such as jdk/internal/platform/docker/TestPidsLimit.java. > > This PR read the DockerTestUtils.RETAIN_IMAGE_AFTER_TEST inside function removeDockerImage instead of before all the fucntion removeDockerImage. This will make all the docker tests receive the property jdk.test.docker.retain.image. > > Change has been verified locally on linux-x64 by run the all touched tests. Looking for 2rd reviewer, since this PR touch files in hotspot directory. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28208#issuecomment-3535663799 From mdoerr at openjdk.org Sun Nov 16 13:23:07 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Sun, 16 Nov 2025 13:23:07 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v2] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Thu, 13 Nov 2025 11:35:04 GMT, Albert Mingkun Yang wrote: >> We have seen crashes on many platforms (including x64) while running `make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders"`: >> >> SIGSEGV (0xb) at pc=0x00007f2f95a61e7a, pid=18554, tid=18557 >> V [libjvm.so+0x15bfe7a] MemAllocator::finish(HeapWordImpl**) const+0xca (klass.inline.hpp:72) >> V [libjvm.so+0x15c029f] ObjAllocator::initialize(HeapWordImpl**) const+0x2f (memAllocator.cpp:391) >> V [libjvm.so+0xb0630b] CollectedHeap::fill_with_object(HeapWordImpl**, unsigned long, bool)+0x27b (collectedHeap.cpp:491) >> V [libjvm.so+0x1c7a0bb] ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats*)+0x11b (threadLocalAllocBuffer.cpp:118) >> V [libjvm.so+0x15c0b14] MemAllocator::mem_allocate_inside_tlab_slow(MemAllocator::Allocation&) const+0x84 (memAllocator.cpp:286) >> V [libjvm.so+0x15c13ab] MemAllocator::mem_allocate(MemAllocator::Allocation&) const+0xbb (memAllocator.cpp:340) >> V [libjvm.so+0x15c14f9] MemAllocator::allocate() const+0xa9 (memAllocator.cpp:353) >> V [libjvm.so+0x1cc052e] TypeArrayKlass::allocate_common(int, bool, JavaThread*)+0x13e (collectedHeap.inline.hpp:41) >> V [libjvm.so+0x16fbc98] oopFactory::new_typeArray(BasicType, int, JavaThread*)+0x38 (typeArrayKlass.hpp:51) >> V [libjvm.so+0x106b0f3] java_lang_Class::restore_archived_mirror(Klass*, Handle, Handle, Handle, JavaThread*)+0x413 (javaClasses.cpp:1246) >> V [libjvm.so+0x14100bc] Klass::restore_unshareable_info(ClassLoaderData*, Handle, JavaThread*)+0x66c (klass.cpp:903) >> V [libjvm.so+0xfe2cb1] InstanceKlass::restore_unshareable_info(ClassLoaderData*, Handle, PackageEntry*, JavaThread*)+0x81 (instanceKlass.cpp:2823) >> V [libjvm.so+0x1c0f5ad] SystemDictionary::preload_class(Handle, InstanceKlass*, JavaThread*)+0x1ed (systemDictionary.cpp:1198) >> V [libjvm.so+0x676e83] AOTLinkedClassBulkLoader::preload_classes_in_table(Array*, char const*, Handle, JavaThread*)+0x1a3 (aotLinkedClassBulkLoader.cpp:103) >> V [libjvm.so+0x679af5] AOTLinkedClassBulkLoader::preload_classes_impl(JavaThread*)+0x165 (aotLinkedClassBulkLoader.cpp:76) >> V [libjvm.so+0x67c371] AOTLinkedClassBulkLoader::preload_classes(JavaThread*)+0x11 (aotLinkedClassBulkLoader.cpp:61) >> V [libjvm.so+0x1d5bf30] vmClasses::resolve_all(JavaThread*)+0x3e0 (vmClasses.cpp:126) >> V [libjvm.so+0x1c0f28c] SystemDictionary::initialize(JavaThread*)+0x10c (systemDictionary.cpp:1623) >> V [libjvm.so+0x1cc74ca] Uni... > >> ... make run-test TEST=runtime/cds/appcds/aotClassLinking/LambdaInExcludedClass.java JTREG="VM_OPTIONS=-XX:+UseCompactObjectHeaders" > > I suspect the crash is caused by a preexisting issue that is exposed by this patch. > > In `vmClasses::resolve_all`: > > #if INCLUDE_CDS > if (CDSConfig::is_using_aot_linked_classes()) { > AOTLinkedClassBulkLoader::preload_classes(THREAD); > } > #endif > > // Preload commonly used klasses > vmClassID scan = vmClassID::FIRST; > // first do Object, then String, Class > resolve_through(VM_CLASS_ID(Object_klass), scan, CHECK); > CollectedHeap::set_filler_object_klass(vmClasses::Object_klass()); > > > The filler-klass is not initialized when `preload_classes` is invoked, but `preload_classes` use heap-allocation, which may require filler-obj. > > @iklam What do you think? > @albertnetymk I've pushed #28315. Please verify if it fixes the crash before integrating this PR. Thanks! The crashes are fixed. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3538748578 From mdoerr at openjdk.org Sun Nov 16 13:42:02 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Sun, 16 Nov 2025 13:42:02 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch In-Reply-To: <8ikwqN309ZPAORjL2YvE1hgvChrTfhi3slz1r4XIK5E=.41d37c1b-ae3e-43f5-9fe0-43ae2294e57c@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> <8ikwqN309ZPAORjL2YvE1hgvChrTfhi3slz1r4XIK5E=.41d37c1b-ae3e-43f5-9fe0-43ae2294e57c@github.com> Message-ID: On Tue, 11 Nov 2025 16:18:04 GMT, Vladimir Kozlov wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Please ask all OpenJDK platforms supporters to test these changes. > > Note, when this code was introduced we did not have so many platforms. This change looks incomplete to me. @vnkozlov: Shouldn't we remove `AllocatePrefetchStyle == 3` completely? `PhaseMacroExpand::prefetch_allocation` still mentions "BIS instruction is used on SPARC as prefetch". Please note that PPC64 also still has an implementation for it (nodes with `predicate(AllocatePrefetchStyle == 3)`). I guess that we don't need it any more. Maybe we should check performance again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3538765487 From ayang at openjdk.org Sun Nov 16 17:19:13 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Sun, 16 Nov 2025 17:19:13 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v3] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Fri, 14 Nov 2025 19:22:39 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang 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 three additional commits since the last revision: > > - Merge branch 'master' into remove-tlab-reserve > - review > - remove-tlab-reserve `AllocatePrefetchStyle == 3` means "generate one prefetch instruction per cache line". This patch removes the reserved alignment that was required for `AllocatePrefetchStyle == 3` on SPARC, but that does not imply that `AllocatePrefetchStyle == 3` itself should be removed. (Maybe a separate ticket if it's indeed deemed useless.) > PhaseMacroExpand::prefetch_allocation still mentions "BIS instruction is used on SPARC as prefetch". Will remove it in the next revision. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3538970541 From mdoerr at openjdk.org Sun Nov 16 21:13:05 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Sun, 16 Nov 2025 21:13:05 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v3] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Fri, 14 Nov 2025 19:22:39 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang 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 three additional commits since the last revision: > > - Merge branch 'master' into remove-tlab-reserve > - review > - remove-tlab-reserve At least PPC64 will need an update because your change breaks the following nodes: diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 7fcd096d2ad..c169d673aaf 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -6328,36 +6328,8 @@ instruct loadConD_Ex(regD dst, immD src) %{ // Prefetch instructions. // Must be safe to execute with invalid address (cannot fault). -// Special prefetch versions which use the dcbz instruction. -instruct prefetch_alloc_zero(indirectMemory mem, iRegLsrc src) %{ - match(PrefetchAllocation (AddP mem src)); - predicate(AllocatePrefetchStyle == 3); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem, 2, $src \t// Prefetch write-many with zero" %} - size(4); - ins_encode %{ - __ dcbz($src$$Register, $mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - -instruct prefetch_alloc_zero_no_offset(indirectMemory mem) %{ - match(PrefetchAllocation mem); - predicate(AllocatePrefetchStyle == 3); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem, 2 \t// Prefetch write-many with zero" %} - size(4); - ins_encode %{ - __ dcbz($mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - instruct prefetch_alloc(indirectMemory mem, iRegLsrc src) %{ match(PrefetchAllocation (AddP mem src)); - predicate(AllocatePrefetchStyle != 3); ins_cost(MEMORY_REF_COST); format %{ "PREFETCH $mem, 2, $src \t// Prefetch write-many" %} @@ -6370,7 +6342,6 @@ instruct prefetch_alloc(indirectMemory mem, iRegLsrc src) %{ instruct prefetch_alloc_no_offset(indirectMemory mem) %{ match(PrefetchAllocation mem); - predicate(AllocatePrefetchStyle != 3); ins_cost(MEMORY_REF_COST); format %{ "PREFETCH $mem, 2 \t// Prefetch write-many" %} ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3539357960 From dholmes at openjdk.org Mon Nov 17 01:12:19 2025 From: dholmes at openjdk.org (David Holmes) Date: Mon, 17 Nov 2025 01:12:19 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> Message-ID: On Wed, 12 Nov 2025 22:45:05 GMT, Serguei Spitsyn wrote: >> test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp line 45: >> >>> 43: static const jlong EXPECTED_ACCURACY = 16; // 16ms is longest clock update interval >>> 44: #else >>> 45: static const jlong EXPECTED_ACCURACY = 32; // high frequency clock updates expected >> >> The comments are somewhat misleading now. We choose 16 on WIN32 because that is the smallest interval allowed. We expect better clock refinement on other platforms and therefore better accuracy. Thus 10ms was chosen. Now we have one test case that was just over 16ms. Is there a reason to believe that couldn't happen with WIN32 also. If not, then the comments should reflect that. > > I feel that all these checks are just a source of this test instability. :) > I'm not sure I fully understand why those are needed and what was the original design. It is always possible to have some delays in waiting time, so the original assumptions about expected accuracy are not fully correct as they are a little bit overly strong. > From this point of view, I do not see why the comments are confusing. The `EXPECTED_ACCURACY` values are just based on the high frequency clock updates interval but should not be equal to it. > Would you like me to change the comments to something like below ? : > `high frequency clock updates expected` > => > `expected accuracy is based on high frequency clock updates` > I do not want to change the Windows part until any failure is observed but can update the comment for consistency. This is wrong. The "expected" accuracy is still 10ms or even 1ms, it is never 32ms. The test may need to wait longer but changing this value makes no sense. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2532387592 From cjplummer at openjdk.org Mon Nov 17 03:14:21 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 17 Nov 2025 03:14:21 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> Message-ID: <6OyfaZdrxTVlW9fdpnuttddsAMPIRHXCE1oAPzCvj7A=.d92c4650-ce57-4ee6-b752-720ba524028b@github.com> On Mon, 17 Nov 2025 01:10:12 GMT, David Holmes wrote: >> I feel that all these checks are just a source of this test instability. :) >> I'm not sure I fully understand why those are needed and what was the original design. It is always possible to have some delays in waiting time, so the original assumptions about expected accuracy are not fully correct as they are a little bit overly strong. >> From this point of view, I do not see why the comments are confusing. The `EXPECTED_ACCURACY` values are just based on the high frequency clock updates interval but should not be equal to it. >> Would you like me to change the comments to something like below ? : >> `high frequency clock updates expected` >> => >> `expected accuracy is based on high frequency clock updates` >> I do not want to change the Windows part until any failure is observed but can update the comment for consistency. > > This is wrong. The "expected" accuracy is still 10ms or even 1ms, it is never 32ms. The test may need to wait longer but changing this value makes no sense. I think the real issue is that EXPECTED_ACCURACY is incorrectly named. It is being used as a max amount of elapsed time, not as an "accuracy" value. The comment on the WIN32 part just adds to the confusion. The "max elapsed time" has to be 16 ms because that is the clock is only accurate to 16ms, so even 1ms of elapsed times will show up as 16ms. The comment "16ms is longest clock update interval" should read "shortest", not "longest". EXPECTED_TIMEOUT_ACCURACY_NS also seems to be misnamed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2532529663 From ayang at openjdk.org Mon Nov 17 09:35:49 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Mon, 17 Nov 2025 09:35:49 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v4] In-Reply-To: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: > Trivial removing obsoleted code for unsupported arch. > > Test: tier1 Albert Mingkun Yang has updated the pull request incrementally with two additional commits since the last revision: - review - patch ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28240/files - new: https://git.openjdk.org/jdk/pull/28240/files/d6c34da7..6c5a07ec Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28240&range=02-03 Stats: 31 lines in 2 files changed: 0 ins; 30 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28240.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28240/head:pull/28240 PR: https://git.openjdk.org/jdk/pull/28240 From mdoerr at openjdk.org Mon Nov 17 09:53:16 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 17 Nov 2025 09:53:16 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v4] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Mon, 17 Nov 2025 09:35:49 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with two additional commits since the last revision: > > - review > - patch Thanks for the updates! `make run-test TEST=test/hotspot/jtreg/compiler/c2 JTREG="VM_OPTIONS=-XX:AllocatePrefetchStyle=3"` has passed on PPC64. I agree, the general AllocatePrefetchStyle==3 topic can be discussed separately. ------------- Marked as reviewed by mdoerr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28240#pullrequestreview-3471900133 From kevinw at openjdk.org Mon Nov 17 10:45:34 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 17 Nov 2025 10:45:34 GMT Subject: RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v12] In-Reply-To: References: Message-ID: <4qjsyzSPqc8GERYbwMkCVTvoa547lAHi2in0d1MotCY=.7f7d0fcd-bc20-49e6-833a-3ec2404006f8@github.com> On Fri, 14 Nov 2025 21:21:16 GMT, Jonas Norlinder wrote: >> Hi all, >> >> This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. >> >> `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. >> >> FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. >> >> Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Revert "Reduce GC coverage for trivial API test" > > This reverts commit 8fd1ee093066138c9aa5602dcac0e7db1916db6b. Marked as reviewed by kevinw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27537#pullrequestreview-3472086274 From duke at openjdk.org Mon Nov 17 10:45:36 2025 From: duke at openjdk.org (Jonas Norlinder) Date: Mon, 17 Nov 2025 10:45:36 GMT Subject: Integrated: 8368527: JMX: Add an MXBeans method to query GC CPU time In-Reply-To: References: Message-ID: On Sat, 27 Sep 2025 11:18:58 GMT, Jonas Norlinder wrote: > Hi all, > > This PR augments the CPU time sampling measurement capabilities that a user can perform from Java code with the addition of `MemoryMXBean.getGcCpuTime()`. With this patch it will be possible for a user to measure process and GC CPU time during critical section or iterations in benchmarks to name a few. This new method complements the existing `OperatingSystemMXBean.getProcessCpuTime()` for a refined understanding. > > `CollectedHeap::gc_threads_do` may operate on terminated GC threads during shutdown, but thanks to JDK-8366865 by @walulyai we can piggyback on the new `Universe::is_shutting_down`. I have implemented a stress-test `test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java` that may identify reading CPU time of terminated threads. Synchronizing on `Universe::is_shutting_down` and `Heap_lock` resolves this problem. > > FWIW; To my understanding we don't want to add a `Universe::is_shutting_down` check in gc_threads_do as this may introduce a performance penalty that is unacceptable, therefore we must be careful about the few places where external users call upon gc_threads_do and may race with a terminating VM. > > Tested: test/jdk/java/lang/management/MemoryMXBean/GetGcCpuTime.java, jdk/javax/management/mxbean hotspot/jtreg/vmTestbase/nsk/monitoring on Linux x64, Linux aarch64, Windows x64, macOS x64 and macOS aarch64 with release and fastdebug. This pull request has now been integrated. Changeset: 812add27 Author: Jonas Norlinder Committer: Kevin Walls URL: https://git.openjdk.org/jdk/commit/812add27abdc70bc52ca105bc9430494a6491ecd Stats: 305 lines in 12 files changed: 302 ins; 1 del; 2 mod 8368527: JMX: Add an MXBeans method to query GC CPU time Reviewed-by: phh, kevinw ------------- PR: https://git.openjdk.org/jdk/pull/27537 From duke at openjdk.org Mon Nov 17 12:14:07 2025 From: duke at openjdk.org (Ruben) Date: Mon, 17 Nov 2025 12:14:07 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: <-h6G9ajUWQwDRcUMOtyI_YCUCkXz3pzRggJk_UaxM-0=.a8c772aa-2f09-48c0-9cfb-17e624393eb0@github.com> References: <-h6G9ajUWQwDRcUMOtyI_YCUCkXz3pzRggJk_UaxM-0=.a8c772aa-2f09-48c0-9cfb-17e624393eb0@github.com> Message-ID: On Thu, 13 Nov 2025 07:54:32 GMT, Ruben wrote: > However, I still have not identified a way to ensure the deopt handler stub ends at a page boundary in a unit test. The latest update implements an alternative way to detect the failure early during testing - via the newly added assertion in the `emit_deopt_handler`. @adinn, @dean-long, @TheRealMDoerr, would it be possible for you to review the latest version of the PR? Is there any additional testing you would recommend to perform before this can be integrated? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3541484205 From kevinw at openjdk.org Mon Nov 17 13:30:14 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 17 Nov 2025 13:30:14 GMT Subject: RFR: 8371991: Build failure in docs for MemoryMXBean Message-ID: Build failure after JDK-8368527 due to Javadoc linking between modules, causes a failure in "make docs-javase" Remove the link and the existing warning suppression, change formatting. This is part of an advisory apiNote which refers to other existing CPU timing methods in jdk.management, from java.management. ------------- Commit messages: - 8371991: Build failure in docs for MemoryMXBean Changes: https://git.openjdk.org/jdk/pull/28350/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28350&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371991 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28350.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28350/head:pull/28350 PR: https://git.openjdk.org/jdk/pull/28350 From mdoerr at openjdk.org Mon Nov 17 13:32:21 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 17 Nov 2025 13:32:21 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 23:49:28 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request incrementally with one additional commit since the last revision: > > Add an assertion to detect out of bounds access in post-call NOP checks I think assertions would be sufficient in C1 instead of guarantee. But, ok. I'll put it into our test queue. ------------- Marked as reviewed by mdoerr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28192#pullrequestreview-3472719238 From alanb at openjdk.org Mon Nov 17 13:35:24 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 17 Nov 2025 13:35:24 GMT Subject: RFR: 8371991: Build failure in docs for MemoryMXBean In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:23:15 GMT, Kevin Walls wrote: > Build failure after JDK-8368527 due to Javadoc linking between modules, causes a failure in "make docs-javase" > Remove the link and the existing warning suppression, change formatting. > > This is part of an advisory apiNote which refers to other existing CPU timing methods in jdk.management, from java.management. Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28350#pullrequestreview-3472727251 From duke at openjdk.org Mon Nov 17 13:35:25 2025 From: duke at openjdk.org (Jonas Norlinder) Date: Mon, 17 Nov 2025 13:35:25 GMT Subject: RFR: 8371991: Build failure in docs for MemoryMXBean In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:23:15 GMT, Kevin Walls wrote: > Build failure after JDK-8368527 due to Javadoc linking between modules, causes a failure in "make docs-javase" > Remove the link and the existing warning suppression, change formatting. > > This is part of an advisory apiNote which refers to other existing CPU timing methods in jdk.management, from java.management. LGTM. Thanks Kevin! ------------- Marked as reviewed by JonasNorlinder at github.com (no known OpenJDK username). PR Review: https://git.openjdk.org/jdk/pull/28350#pullrequestreview-3472730382 From kevinw at openjdk.org Mon Nov 17 13:35:26 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 17 Nov 2025 13:35:26 GMT Subject: RFR: 8371991: Build failure in docs for MemoryMXBean In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:23:15 GMT, Kevin Walls wrote: > Build failure after JDK-8368527 due to Javadoc linking between modules, causes a failure in "make docs-javase" > Remove the link and the existing warning suppression, change formatting. > > This is part of an advisory apiNote which refers to other existing CPU timing methods in jdk.management, from java.management. Thanks Alan! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28350#issuecomment-3541858039 From kevinw at openjdk.org Mon Nov 17 13:43:28 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 17 Nov 2025 13:43:28 GMT Subject: Integrated: 8371991: Build failure in docs for MemoryMXBean In-Reply-To: References: Message-ID: <5y--xSzUBzgg-krK1QNHtThGOZUu41byXpoLacltv8M=.5a512b1d-5976-41b0-be3d-9da2877c8cf5@github.com> On Mon, 17 Nov 2025 13:23:15 GMT, Kevin Walls wrote: > Build failure after JDK-8368527 due to Javadoc linking between modules, causes a failure in "make docs-javase" > Remove the link and the existing warning suppression, change formatting. > > This is part of an advisory apiNote which refers to other existing CPU timing methods in jdk.management, from java.management. This pull request has now been integrated. Changeset: 960987e8 Author: Kevin Walls URL: https://git.openjdk.org/jdk/commit/960987e8c1428ce1d89ee13e007e06206fe6885c Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod 8371991: Build failure in docs for MemoryMXBean Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/28350 From aartemov at openjdk.org Mon Nov 17 13:50:30 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Mon, 17 Nov 2025 13:50:30 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v9] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Addressed reviewer's comments. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/2ac18b94..28725284 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=07-08 Stats: 81 lines in 1 file changed: 49 ins; 7 del; 25 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aartemov at openjdk.org Mon Nov 17 13:50:38 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Mon, 17 Nov 2025 13:50:38 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 18:07:27 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed the test. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed lines in tests. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Added a comment to a boolean arg for enter() >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - 8366659: Fixed new lines. >> - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock >> - ... and 12 more: https://git.openjdk.org/jdk/compare/ff851de8...2ac18b94 > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 124: > >> 122: // launch resumer enter threadLock >> 123: // while !READY_TO_NOTIFY resumer running >> 124: // delay 1-second threadLock.wait(1) wait for notify > > We've deleted this sleep, so this line should change from: > > // delay 1-second threadLock.wait(1) wait for notify > > to: > > // : threadLock.wait(1) wait for notify Addressed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 128: > >> 126: // set READY_TO_NOTIFY : >> 127: // threadLock.notify wait finishes : >> 128: // : reenter blocks : > > We added a sleep here, so this line should change from: > > // : reenter blocks : > > to: > > // : delay 200ms reenter blocks : Addressed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 153: > >> 151: // thread allows the waiter thread to loop tightly here: >> 152: // while !READY_TO_NOTIFY >> 153: // threadLock.wait(1) > > Please replace this note with the following: > > // Note: sleep(200ms) here while holding the threadLock to allow the waiter thread's > // timed wait to finish before we attempt to suspend the waiter thread. Addressed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 237: > >> 235: >> 236: public static void usage() { >> 237: System.err.println("Usage: " + AGENT_LIB + " [N][-p][time_max]"); > > The `N` argument is not optional so it should not be surrounded by `[` and `]`. Addressed in the latest commit. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 239: > >> 237: System.err.println("Usage: " + AGENT_LIB + " [N][-p][time_max]"); >> 238: System.err.println("where:"); >> 239: System.err.println(" N ::= test case"); > > s/case/case: 1 | 2 | 3/ Addressed in the latest commit. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 470: > >> 468: } >> 469: try { >> 470: Thread.sleep(1000); > > Please add something like this above the `sleep`: > > // Delay for 1-second while holding the threadLock to force the > // resumer thread to block on entering the threadLock. Addressed in the latest commit. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 552: > >> 550: // wait for the waiter thread to block >> 551: logDebug("before contended enter wait"); >> 552: int retCode = wait4ContendedEnter(waiter); > > Since we are waiting here for ContendedEnter by the waiter thread, do we really > need the above `sleep(200)` or are we just being polite CPU resource wise? Maybe I do not fully understand the question, but isn't it what differentiates test case 2 from test case 3? > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 592: > >> 590: } >> 591: try { >> 592: Thread.sleep(1000); > > Please add something like this above the sleep: > > // Delay for 1-second while holding the threadLock to force the > // resumer thread to block on entering the threadLock. Added. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534136973 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534137344 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534137633 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534135509 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534135744 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534138176 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534136258 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534136725 From aartemov at openjdk.org Mon Nov 17 13:50:39 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Mon, 17 Nov 2025 13:50:39 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Fri, 14 Nov 2025 20:05:31 GMT, Daniel D. Daugherty wrote: >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 212: >> >>> 210: argsLeft--; >>> 211: } >>> 212: if (argsLeft == 0) { >> >> Because of the addition of a mandatory argument (test case), argument parsing will >> be more complicated. I need to mull on this a bit and I'll post another suggestion >> after this round. > > I emailed you an updated version of the current test (v07) with a better > parser. Feel free to merge it in or not. Thanks, I added your parsing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2534135964 From xuelei at openjdk.org Mon Nov 17 18:27:26 2025 From: xuelei at openjdk.org (Xue-Lei Andrew Fan) Date: Mon, 17 Nov 2025 18:27:26 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v18] In-Reply-To: <4O9v08uY1viSeMh_w821RNfKj67p74y2PqDrB8GdZCs=.e21a3d53-4a00-4f4a-99dc-589b1044d7bd@github.com> References: <4O9v08uY1viSeMh_w821RNfKj67p74y2PqDrB8GdZCs=.e21a3d53-4a00-4f4a-99dc-589b1044d7bd@github.com> Message-ID: On Fri, 7 Nov 2025 15:25:49 GMT, Erik ?sterlund wrote: >> Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove -server in test for static GHA build > > Thank you for the reviews everyone! @fisk Is there any chance to backport this update to 25? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27732#issuecomment-3543306783 From eosterlund at openjdk.org Mon Nov 17 19:02:27 2025 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Mon, 17 Nov 2025 19:02:27 GMT Subject: RFR: 8365932: Implementation of JEP 516: Ahead-of-Time Object Caching with Any GC [v18] In-Reply-To: <4O9v08uY1viSeMh_w821RNfKj67p74y2PqDrB8GdZCs=.e21a3d53-4a00-4f4a-99dc-589b1044d7bd@github.com> References: <4O9v08uY1viSeMh_w821RNfKj67p74y2PqDrB8GdZCs=.e21a3d53-4a00-4f4a-99dc-589b1044d7bd@github.com> Message-ID: On Fri, 7 Nov 2025 15:25:49 GMT, Erik ?sterlund wrote: >> Erik ?sterlund has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove -server in test for static GHA build > > Thank you for the reviews everyone! > @fisk Is there any chance to backport this update to 25? Unfortunately, we generally do not backport JEPs. But the next LTS is just around the corner, in the grand scheme of things. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27732#issuecomment-3543420953 From dcubed at openjdk.org Mon Nov 17 19:30:43 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Mon, 17 Nov 2025 19:30:43 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v9] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:50:30 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Addressed reviewer's comments. Marked as reviewed by dcubed (Reviewer). test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 140: > 138: // launch resumer enter threadLock > 139: // while !READY_TO_NOTIFY resumer running > 140: // : threadLock.wait(1) wait for notify The wait(1) call is in the while-loop. Please insert two spaces before the `threadlock.wait(1)` call. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 235: > 233: } catch (NumberFormatException nfe) { > 234: System.err.println("'" + args[argIndex] + > 235: "': invalid test_case value."); The leading double quote should be lined up with the one on the previous line. test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 251: > 249: } catch (NumberFormatException nfe) { > 250: System.err.println("'" + args[argIndex] + > 251: "': invalid time_max value."); The leading double quote should be lined up with the one on the previous line. ------------- PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3474239279 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535265622 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535273619 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535274696 From dcubed at openjdk.org Mon Nov 17 19:34:28 2025 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Mon, 17 Nov 2025 19:34:28 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:45:51 GMT, Anton Artemov wrote: >> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 552: >> >>> 550: // wait for the waiter thread to block >>> 551: logDebug("before contended enter wait"); >>> 552: int retCode = wait4ContendedEnter(waiter); >> >> Since we are waiting here for ContendedEnter by the waiter thread, do we really >> need the above `sleep(200)` or are we just being polite CPU resource wise? > > Maybe I do not fully understand the question, but isn't it what differentiates test case 2 from test case 3? Sorry, I wasn't very clear. I'm questioning the need for the 200ms delay since our call to `wait4ContendedEnter` will already delay the calling thread. Since @pchilano requested the addition of the 200ms delay, he should probably chime in here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535285282 From pchilanomate at openjdk.org Mon Nov 17 21:14:03 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Mon, 17 Nov 2025 21:14:03 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga wrote: >> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. >> >> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. >> >> Big thanks to @pchilano for your help! > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Update for Linux PPC64 and RISC-V Marked as reviewed by pchilanomate (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28284#pullrequestreview-3474569448 From pchilanomate at openjdk.org Mon Nov 17 21:53:04 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Mon, 17 Nov 2025 21:53:04 GMT Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes without JVMTI agent Message-ID: When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes. This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes: - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. An alternative that avoids the extra fence would be to place extra overhead on the thread requesting to disable transitions (e.g. by using a safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so I believe this approach is simpler. - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`. - The code was structured in terms of mount and unmount cases, and a variable was used to differentiate between start or end of the transition. With the changes to make the mechanism independent of JVMTI it becomes simpler to invert this and structure the code in terms of start transition and end transition, and use a variable to differentiate between mount and unmount cases. - All JVMTI code required during start/end transitions has been encapsulated in classes `JVMTIStartTransition` and `JVMTIEndTransition`. I kept the ordering of event posting as it is today. - Global variables `_sync_protocol_enabled_count` and `_sync_protocol_enabled_permanently` were removed. Variable `_VTMS_transition_disable_for_all_count` was renamed to `_global_start_transition_disable_count`, `_SR_mode` to `_exclusive_operation_ongoing` and `_VTMS_notify_jvmti_events` to `_notify_jvmti_events`. New global variable `_active_disablers` replaces the functionality of `_VTMS_transition_disable_for_one_count`. - Now, when the first agent attaches we not only set `_notify_jvmti_events` but we also increase global counter `_global_start_transition_disable_count`. This has the effect of always forcing the slow path when starting and ending a transition as we do today when `_VTMS_notify_jvmti_events` is set. A new `Handshake::execute` variant to handshake a virtual thread is introduced with this patch, which makes use of the new `MountUnmountDisabler` class. Method `ThreadSnapshotFactory::get_thread_snapshot` has been simplified to use this handshake variant to capture the snapshot of a virtual thread. The changes include new test `DumpThreadsWhenParking.java` from @AlanBateman which reliably reproduces the issue. I also verified the changes in Mach5 tiers1-7. Thanks, Patricio ------------- Commit messages: - v1 Changes: https://git.openjdk.org/jdk/pull/28361/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364343 Stats: 1848 lines in 40 files changed: 844 ins; 824 del; 180 mod Patch: https://git.openjdk.org/jdk/pull/28361.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361 PR: https://git.openjdk.org/jdk/pull/28361 From jnorlinder at openjdk.org Mon Nov 17 21:56:39 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Mon, 17 Nov 2025 21:56:39 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) Message-ID: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. ------------- Commit messages: - Add some work for GC Changes: https://git.openjdk.org/jdk/pull/28362/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28362&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8372008 Stats: 10 lines in 1 file changed: 9 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28362.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28362/head:pull/28362 PR: https://git.openjdk.org/jdk/pull/28362 From sspitsyn at openjdk.org Mon Nov 17 22:51:13 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Mon, 17 Nov 2025 22:51:13 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: <6OyfaZdrxTVlW9fdpnuttddsAMPIRHXCE1oAPzCvj7A=.d92c4650-ce57-4ee6-b752-720ba524028b@github.com> References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> <6OyfaZdrxTVlW9fdpnuttddsAMPIRHXCE1oAPzCvj7A=.d92c4650-ce57-4ee6-b752-720ba524028b@github.com> Message-ID: On Mon, 17 Nov 2025 03:11:25 GMT, Chris Plummer wrote: >> This is wrong. The "expected" accuracy is still 10ms or even 1ms, it is never 32ms. The test may need to wait longer but changing this value makes no sense. > > I think the real issue is that EXPECTED_ACCURACY is incorrectly named. It is being used as a max amount of elapsed time, not as an "accuracy" value. The comment on the WIN32 part just adds to the confusion. The "max elapsed time" has to be 16 ms because that is the clock is only accurate to 16ms, so even 1ms of elapsed times will show up as 16ms. The comment "16ms is longest clock update interval" should read "shortest", not "longest". > > EXPECTED_TIMEOUT_ACCURACY_NS also seems to be misnamed. Thank you, Chris. My intention was to fix this intermittent failure and achieve better stability. My preference would be to get rid of these troublesome and useless checks instead of fixing confusing constant names and comments. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2535742944 From cjplummer at openjdk.org Mon Nov 17 23:17:05 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 17 Nov 2025 23:17:05 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. Looks good. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28362#pullrequestreview-3474885533 From cjplummer at openjdk.org Mon Nov 17 23:19:06 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 17 Nov 2025 23:19:06 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: <4BLSKl8w2Lhm2HDKDQ6jwVRsWQMssF_tUak9wNk5mkg=.36bcf655-a812-4b2b-86b7-1f02251740a9@github.com> References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> <4dipoan9jnaJpGdBc2b4tpnEDvxsIOSjSPrvIMwnka8=.1ad85705-c8d1-46a2-b364-2a5880386845@github.com> <4BLSKl8w2Lhm2HDKDQ6jwVRsWQMssF_tUak9wNk5mkg=.36bcf655-a812-4b2b-86b7-1f02251740a9@github.com> Message-ID: On Sat, 15 Nov 2025 01:31:56 GMT, Yasumasa Suenaga wrote: >> test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithXComp.java line 40: >> >>> 38: * @requires vm.hasSA >>> 39: * @requires os.family == "linux" >>> 40: * @requires os.arch == "amd64" >> >> Can't we run the test on AArch64 now? > > I think this PR works on Linux AArch64, but I'm not sure because previous change (#27885) worked on some Linux AArch64, but there are some platforms whch did not work. Thus I think it is better to keep this test for Linux AMD64 only. > > I couldn't reproduce the problem on Fedora Rawhide on Raspberry Pi 4, but there might be some issue because SA does not have DWARF parser for AArch 64 - it means the native we cannot find sender frame which depends on DWARF, does not use FP as frame pointer. I enabled this test for linux-aarch64 and it seems to pass our testing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28284#discussion_r2535790504 From ysuenaga at openjdk.org Tue Nov 18 00:15:06 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Tue, 18 Nov 2025 00:15:06 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> <4dipoan9jnaJpGdBc2b4tpnEDvxsIOSjSPrvIMwnka8=.1ad85705-c8d1-46a2-b364-2a5880386845@github.com> <4BLSKl8w2Lhm2HDKDQ6jwVRsWQMssF_tUak9wNk5mkg=.36bcf655-a812-4b2b-86b7-1f02251740a9@github.com> Message-ID: On Mon, 17 Nov 2025 23:16:24 GMT, Chris Plummer wrote: >> I think this PR works on Linux AArch64, but I'm not sure because previous change (#27885) worked on some Linux AArch64, but there are some platforms whch did not work. Thus I think it is better to keep this test for Linux AMD64 only. >> >> I couldn't reproduce the problem on Fedora Rawhide on Raspberry Pi 4, but there might be some issue because SA does not have DWARF parser for AArch 64 - it means the native we cannot find sender frame which depends on DWARF, does not use FP as frame pointer. > > I enabled this test for linux-aarch64 and it seems to pass our testing. I saw the problem on `VMError::report_and_die` because its frame could not be unwinded without DWARF. I have not seen the problem in other place, but I'm concerned the test fails on some Linux AArch64 platforms. Thus I think it is better to wait enabling the test until SA supports DWARF. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28284#discussion_r2535887854 From sspitsyn at openjdk.org Tue Nov 18 00:54:33 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 18 Nov 2025 00:54:33 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v9] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 13:50:30 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Addressed reviewer's comments. src/hotspot/share/runtime/objectMonitor.cpp line 1950: > 1948: // as having "-locked" the monitor, but the OS and java.lang.Thread > 1949: // states will still report that the thread is blocked trying to > 1950: // acquire it. Q: I have a concern here. Did we have a similar inconsistency before? As I see, this can be observable not only by thread dumps but also by JVMTI in general (independently of the thread's suspend status). Dan, can you comment on this, please? test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 52: > 50: * @compile SuspendWithObjectMonitorWait.java > 51: * @run main/othervm/native -agentlib:SuspendWithObjectMonitorWait SuspendWithObjectMonitorWait 3 > 52: */ Q: I'm not that happy with adding this complexity into one single test. Would it make sense to split `doWork1`, `doWork2` and `doWork3` tests into independent test sharing some parts, e.g. .cpp file, `SuspendWithObjectMonitorWaitWorker` class etc.? Then the only duplication will be the `main()` method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535945583 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2535957986 From sspitsyn at openjdk.org Tue Nov 18 03:02:24 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 18 Nov 2025 03:02:24 GMT Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> Message-ID: On Mon, 10 Nov 2025 03:15:06 GMT, Chris Plummer wrote: > This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint. > > This PR focuses on purging virtual thread ThreadNodes in two places: > > 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread. > 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all" > > At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event. > > Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist. > > At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not. > > Tested by running all tier2, tier5, and tier6 CI svc tests. src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 564: > 562: * to keep the node around. It's possible for it to be 0 yet we still need to > 563: * keep the node around. Also, it's possbile for it to be non-zero yet we > 564: * don't need to keep the node around. More details int he comments below. Nit: Typo: s/int he/in the/ src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 1399: > 1397: if (node == NULL) { > 1398: node = findThread(&otherThreads, thread); > 1399: } Q: Could you explain a little bit why this change is needed? Do we need an update of the comment above? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2536075055 PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2536120552 From dholmes at openjdk.org Tue Nov 18 04:16:23 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 18 Nov 2025 04:16:23 GMT Subject: RFR: 8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) [v2] In-Reply-To: References: <05mxQE7Br_qOo9qhqPc5cx6aGbUq6v7hwm4iuvFGsCk=.c9e384cf-1e00-4976-baa5-f489424f4391@github.com> <6OyfaZdrxTVlW9fdpnuttddsAMPIRHXCE1oAPzCvj7A=.d92c4650-ce57-4ee6-b752-720ba524028b@github.com> Message-ID: On Mon, 17 Nov 2025 22:48:26 GMT, Serguei Spitsyn wrote: >> I think the real issue is that EXPECTED_ACCURACY is incorrectly named. It is being used as a max amount of elapsed time, not as an "accuracy" value. The comment on the WIN32 part just adds to the confusion. The "max elapsed time" has to be 16 ms because that is the clock is only accurate to 16ms, so even 1ms of elapsed times will show up as 16ms. The comment "16ms is longest clock update interval" should read "shortest", not "longest". >> >> EXPECTED_TIMEOUT_ACCURACY_NS also seems to be misnamed. > > Thank you, Chris. My intention was to fix this intermittent failure and achieve better stability. My preference would be to get rid of these troublesome and useless checks instead of fixing confusing constant names and comments. > The comment "16ms is longest clock update interval" should read "shortest", not "longest". No it is the longest interval between clock updates (actually 15.259) based on the old PIT timer (1/65536). Modern hardware will have 10ms or even 1ms. The code expects to see at most one timer-tick of elapsed time, hence the name and the value. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28206#discussion_r2536241336 From cjplummer at openjdk.org Tue Nov 18 04:48:14 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 18 Nov 2025 04:48:14 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga wrote: >> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. >> >> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. >> >> Big thanks to @pchilano for your help! > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Update for Linux PPC64 and RISC-V On macosx I'm seeing the following when running ClhsdbPStack.java: ``` Opening core file, please wait... hsdb> hsdb> + verbose true hsdb> + pstack -v Deadlock Detection: No deadlocks found. Not available for Mac OS X processes hsdb> + quit The "Not available for Mac OS X processes" message is expected when running on a macosx process, but in this case the test is running the core version of the test, so SA is acting on a core file. The test goes on to fail because there are no threads in the output. The message is generated by PStack.java whenever the thread list is null and it is running on OSX. In that case it assumes the reason the thread list is null is because it is running on a macosx process. It's not clear to me why the thread list is null. I don't see any changes that look like they could cause that. This happens with both x64 and aarch64, although you need to remove the test from the problem list for macosx-aarch64 to get it to reproduce. macosx-x64 is not problem listed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3545013052 From cjplummer at openjdk.org Tue Nov 18 05:02:06 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 18 Nov 2025 05:02:06 GMT Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes In-Reply-To: References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> Message-ID: <7gBK0x7oqxFNv50kwhyx9kbGZQD6hMxsawxRJY7-h0A=.8ff3fe4c-ebc4-49be-b2dc-3c3ea63bd027@github.com> On Tue, 18 Nov 2025 02:45:18 GMT, Serguei Spitsyn wrote: >> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint. >> >> This PR focuses on purging virtual thread ThreadNodes in two places: >> >> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread. >> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all" >> >> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event. >> >> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist. >> >> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not. >> >> Tested by running all tier2, tier5, and tier6 CI svc tests. > > src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 1399: > >> 1397: if (node == NULL) { >> 1398: node = findThread(&otherThreads, thread); >> 1399: } > > Q: Could you explain a little bit why this change is needed? Do we need an update of the comment above? You need to call findRunningThread() to get the ThreadNode created if there isn't already one. findThread() does not create the ThreadNode like findRunningThread() does, so after my changes to free up ThreadNodes, findThread() was returning NULL, which causes a lot of problems here. You then need to add the findThread(&otherThreads, thread) call because this is normally done by findThread() but is purposefully note done by findRunningThread(). otherThreads hold threads that have been created but not yet started. It's kind of rare that threads every end up on the list. It means the debugger somehow got hold of a ThreadReferences (such as through a local var) and then called a ThreadReference API with it. The usual way it works is when an event finally comes in on the thread, that is when it gets moved from otherThreads to runningThreads or runningVThreads. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2536308645 From ysuenaga at openjdk.org Tue Nov 18 06:43:08 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Tue, 18 Nov 2025 06:43:08 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Tue, 18 Nov 2025 04:45:46 GMT, Chris Plummer wrote: > The message is generated by PStack.java whenever the thread list is null and it is running on OSX. Maybe it is a side effect of deleting `initJFrameCache()` from PStack.java. I do not have Mac, so I cannot verify the following... `BsdDebuggerLocal::threadList` would be filled in `getJavaThreadsInfo()`, and it is eventually called through a chain of calls starting from `BsdThread::getContext()`. It is eventually called by `getCurrentFrameGuess()` from `PStack::initJFrameCache()`. I think it is better to separate BsdDebuggerLocal::getJavaThreadsInfo() - filling threadList can move to getThreadList() because it is not needed in getJavaThreadsInfo(). ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3545625295 From dholmes at openjdk.org Tue Nov 18 07:46:32 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 18 Nov 2025 07:46:32 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. Having the test actually do something that looks like it triggers GC certainly makes sense. I'm unclear what a GC's "slower update rate" means. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28362#pullrequestreview-3475947140 From jnorlinder at openjdk.org Tue Nov 18 08:34:09 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Tue, 18 Nov 2025 08:34:09 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. Thanks David and Chris for the reviews! > I'm unclear what a GC's "slower update rate" means. It is the OS's scheduler that needs to schedule its task to update the thread CPU time. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28362#issuecomment-3546173687 From duke at openjdk.org Tue Nov 18 08:34:10 2025 From: duke at openjdk.org (duke) Date: Tue, 18 Nov 2025 08:34:10 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. @JonasNorlinder Your change (at version f6d3a127a2583b41a851908956d7f1ed5bd434f5) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28362#issuecomment-3546176137 From alanb at openjdk.org Tue Nov 18 08:50:04 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 18 Nov 2025 08:50:04 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. test/jdk/java/lang/management/MemoryMXBean/TestGetTotalGcCpuTime.java line 106: > 104: objs.add(new Object()); > 105: } > 106: System.gc(); No concern that escape analysis will eliminate the allocations here? Minor nit, should use 4-space indentation here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28362#discussion_r2536907844 From jnorlinder at openjdk.org Tue Nov 18 09:00:04 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Tue, 18 Nov 2025 09:00:04 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v2] In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: Prevent escaping ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28362/files - new: https://git.openjdk.org/jdk/pull/28362/files/f6d3a127..dff1c323 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28362&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28362&range=00-01 Stats: 7 lines in 1 file changed: 2 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/28362.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28362/head:pull/28362 PR: https://git.openjdk.org/jdk/pull/28362 From jnorlinder at openjdk.org Tue Nov 18 09:06:24 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Tue, 18 Nov 2025 09:06:24 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v3] In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: Prevent escaping: no shadowing ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28362/files - new: https://git.openjdk.org/jdk/pull/28362/files/dff1c323..f99ad286 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28362&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28362&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28362.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28362/head:pull/28362 PR: https://git.openjdk.org/jdk/pull/28362 From kevinw at openjdk.org Tue Nov 18 09:06:25 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 18 Nov 2025 09:06:25 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v2] In-Reply-To: References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Tue, 18 Nov 2025 09:00:04 GMT, Jonas Norlinder wrote: >> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. >> >> Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Prevent escaping Marked as reviewed by kevinw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28362#pullrequestreview-3476300135 From kevinw at openjdk.org Tue Nov 18 09:06:26 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 18 Nov 2025 09:06:26 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v3] In-Reply-To: References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Tue, 18 Nov 2025 09:01:53 GMT, Jonas Norlinder wrote: >> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. >> >> Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Prevent escaping: no shadowing Marked as reviewed by kevinw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28362#pullrequestreview-3476311218 From jnorlinder at openjdk.org Tue Nov 18 09:06:29 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Tue, 18 Nov 2025 09:06:29 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v3] In-Reply-To: References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Tue, 18 Nov 2025 08:47:47 GMT, Alan Bateman wrote: >> Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: >> >> Prevent escaping: no shadowing > > test/jdk/java/lang/management/MemoryMXBean/TestGetTotalGcCpuTime.java line 106: > >> 104: objs.add(new Object()); >> 105: } >> 106: System.gc(); > > No concern that escape analysis will eliminate the allocations here? > > Minor nit, should use 4-space indentation here. Thanks Alan. I believe this didn't happen with the current implementation. That being said, I reached out to @robcasloz to get his opinion if there are any risks. FWIW; I added objs as a private static field. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28362#discussion_r2536969057 From alanb at openjdk.org Tue Nov 18 09:14:49 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 18 Nov 2025 09:14:49 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v3] In-Reply-To: References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: <_AJyLNZXwD5jk4Mo3u3Qa3UO3miYJueM9PpjcPBtpm4=.9cd8bd86-0dd5-473b-a106-daad14ad2611@github.com> On Tue, 18 Nov 2025 09:06:24 GMT, Jonas Norlinder wrote: >> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. >> >> Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Prevent escaping: no shadowing Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28362#pullrequestreview-3476366794 From ayang at openjdk.org Tue Nov 18 09:40:37 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 18 Nov 2025 09:40:37 GMT Subject: RFR: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch [v4] In-Reply-To: References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Mon, 17 Nov 2025 09:35:49 GMT, Albert Mingkun Yang wrote: >> Trivial removing obsoleted code for unsupported arch. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with two additional commits since the last revision: > > - review > - patch Thanks for review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28240#issuecomment-3546476614 From ayang at openjdk.org Tue Nov 18 09:40:38 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 18 Nov 2025 09:40:38 GMT Subject: Integrated: 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch In-Reply-To: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> References: <73HZdkIlDts3as9Xfechu5Sj4RhDGpUx-HVxj6B9m5o=.d147e8ff-7488-4358-af54-956b966d499d@github.com> Message-ID: On Tue, 11 Nov 2025 15:42:21 GMT, Albert Mingkun Yang wrote: > Trivial removing obsoleted code for unsupported arch. > > Test: tier1 This pull request has now been integrated. Changeset: 50a30497 Author: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/50a30497370799e8f377a11914562a15b0a48fbb Stats: 69 lines in 7 files changed: 0 ins; 66 del; 3 mod 8371643: Remove ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch Reviewed-by: mdoerr, kvn, tschatzl ------------- PR: https://git.openjdk.org/jdk/pull/28240 From kevinw at openjdk.org Tue Nov 18 09:42:22 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 18 Nov 2025 09:42:22 GMT Subject: RFR: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) [v3] In-Reply-To: References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Tue, 18 Nov 2025 09:06:24 GMT, Jonas Norlinder wrote: >> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. >> >> Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. > > Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision: > > Prevent escaping: no shadowing Looks good. Runs many times for me, I let it go for 15 iterations with jtreg. Then I let it run for 4 iterations with -Xcomp and over 20 with -XX:-TieredCompilation ------------- PR Comment: https://git.openjdk.org/jdk/pull/28362#issuecomment-3546490368 From mdoerr at openjdk.org Tue Nov 18 10:09:11 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Tue, 18 Nov 2025 10:09:11 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: On Thu, 13 Nov 2025 23:49:28 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request incrementally with one additional commit since the last revision: > > Add an assertion to detect out of bounds access in post-call NOP checks Our tests haven't revealed any new issues related to this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3546631812 From jnorlinder at openjdk.org Tue Nov 18 10:12:00 2025 From: jnorlinder at openjdk.org (Jonas Norlinder) Date: Tue, 18 Nov 2025 10:12:00 GMT Subject: Integrated: 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) In-Reply-To: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> References: <6SMM4ifRY34vKE5h6ORjtewOgVLkEpttbk2N8Mlq6Yo=.dc7fbfb0-7d23-4035-9af4-03f8ed6a7a03@github.com> Message-ID: On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder wrote: > Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a slower update rate for the underlying CPU time thread counters than the code anticipated, causing the test to fail which assumes that some work have been performed and the count should be non-zero. > > Solution: All GCs we are testing are tracing GCs. Therefore, add some marking job to inflate the GC CPU time such that we can guarantee to observe a non-zero value. This pull request has now been integrated. Changeset: 28d94d6a Author: Jonas Norlinder Committer: Kevin Walls URL: https://git.openjdk.org/jdk/commit/28d94d6ab4994b844af98c5c227b40b5fb8a72e5 Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod 8372008: TestGetTotalGcCpuTime test failures on Windows (Some GC CPU time must have been reported) Reviewed-by: kevinw, alanb, cjplummer, dholmes ------------- PR: https://git.openjdk.org/jdk/pull/28362 From aartemov at openjdk.org Tue Nov 18 10:14:19 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 10:14:19 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v10] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with two additional commits since the last revision: - 8366659: Addressed reviewer's comments. - 8366659: Addressed reviewer's comments. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/28725284..a429cb26 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=08-09 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aartemov at openjdk.org Tue Nov 18 10:14:22 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 10:14:22 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v9] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 19:23:52 GMT, Daniel D. Daugherty wrote: >> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8366659: Addressed reviewer's comments. > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 140: > >> 138: // launch resumer enter threadLock >> 139: // while !READY_TO_NOTIFY resumer running >> 140: // : threadLock.wait(1) wait for notify > > The wait(1) call is in the while-loop. Please insert two spaces before the `threadlock.wait(1)` call. Addressed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 235: > >> 233: } catch (NumberFormatException nfe) { >> 234: System.err.println("'" + args[argIndex] + >> 235: "': invalid test_case value."); > > The leading double quote should be lined up with the one on the previous line. Addressed. > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 251: > >> 249: } catch (NumberFormatException nfe) { >> 250: System.err.println("'" + args[argIndex] + >> 251: "': invalid time_max value."); > > The leading double quote should be lined up with the one on the previous line. Addressed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2537288143 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2537288285 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2537288511 From aartemov at openjdk.org Tue Nov 18 13:03:35 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 13:03:35 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v11] In-Reply-To: References: Message-ID: <5fIR4uxrdE0GVVCOwUYVlz5OyBpiio0fe32-BKOmO_I=.2b262076-a045-4a51-929f-2fb6e5201880@github.com> > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Refactored the big test into 3 smaller tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/a429cb26..3da08471 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=09-10 Stats: 1696 lines in 7 files changed: 921 ins; 773 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aartemov at openjdk.org Tue Nov 18 13:03:37 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 13:03:37 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v9] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 00:48:11 GMT, Serguei Spitsyn wrote: >> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8366659: Addressed reviewer's comments. > > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait.java line 52: > >> 50: * @compile SuspendWithObjectMonitorWait.java >> 51: * @run main/othervm/native -agentlib:SuspendWithObjectMonitorWait SuspendWithObjectMonitorWait 3 >> 52: */ > > Q: I'm not that happy with adding this complexity into one single test. It is usually not easy to deal with such big and multi-mode tests. Would it make sense to split `doWork1`, `doWork2` and `doWork3` tests into independent tests `SuspendWithObjectMonitorWait{1|2|3}.java` sharing some parts, e.g. .cpp file, `SuspendWithObjectMonitorWaitWorker.java` class etc.? Then the only duplication will be the `main()` method. Actually I agree, it has become way too long. I refactored it into 3 smaller tests. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2538107049 From erikj at openjdk.org Tue Nov 18 14:08:15 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 18 Nov 2025 14:08:15 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Tue, 18 Nov 2025 08:55:16 GMT, Matthias Baesken wrote: > > Is there is a particular reason to not apply this on x64 as well? > > On macOS x86_64 I saw in our CI those tests failing when enabling the dead_strip feature serviceability/sa/ClhsdbCDSCore.java serviceability/sa/ClhsdbFindPC.jav serviceability/sa/ClhsdbPstack.java That information should at least be stated in the bug for future reference on why this decision was made. > For macOS aarch64, the tests in our CI were fine but I see some failures in the GHA in the serviceability area. > > ``` > finding class loader instances ..java.lang.InternalError: Metadata does not appear to be polymorphic > at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:223) > at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104) > at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:78) > at jdk.hotspot.agent/sun.jvm.hotspot.memory.SystemDictionary.getClassLoaderKlass(SystemDictionary.java:102) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.printClassLoaderStatistics(ClassLoaderStats.java:93) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.run(ClassLoaderStats.java:78) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:121) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:202) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:344) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507) > ``` Adding serviceability label as this is affecting their tests. I have a vague memory of some seemingly dead code being necessary for certain sa functionality. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3547789577 From duke at openjdk.org Tue Nov 18 14:18:11 2025 From: duke at openjdk.org (Ruben) Date: Tue, 18 Nov 2025 14:18:11 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 10:05:48 GMT, Martin Doerr wrote: >> Ruben has updated the pull request incrementally with one additional commit since the last revision: >> >> Add an assertion to detect out of bounds access in post-call NOP checks > > Our tests haven't revealed any new issues related to this PR. Thank you, @TheRealMDoerr, > I think assertions would be sufficient in C1 instead of guarantee. Sure, I will change these to assertions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3547827280 From aartemov at openjdk.org Tue Nov 18 14:35:16 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 14:35:16 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Added bool arg to notify_contended_enter ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/3da08471..8c82d39c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=10-11 Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From mbaesken at openjdk.org Tue Nov 18 14:38:17 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Tue, 18 Nov 2025 14:38:17 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Tue, 18 Nov 2025 14:05:32 GMT, Erik Joelsson wrote: > I have a vague memory of some seemingly dead code being necessary for certain sa functionality. Yeah I remember too, We noticed similar issues when using the lto configure flag on libjvm with gcc (other platform and switch but similar issues). Is there a way to attribute such 'dead' functions with e.g. an attribute to pragma or something similar to avoid removal of those ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3547901166 From mbaesken at openjdk.org Tue Nov 18 14:42:19 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Tue, 18 Nov 2025 14:42:19 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM The was a bit of discussion on serviceability-dev some years ago about that lto on libjvm issue and the serviceability errors and Magnus commented 'We used to have LTO enabled on the old, closed-source Oracle arm-32 builds. There is still a "link-time-opt" JVM feature present; afaik it still works and adds the -flto flag. The main drawback of this is the *extremely* long link times of libjvm.so. I don't think servicability was ever supported for that platform, so I'm not surprised this does not work. ' Probably the dead-strip feature runs into similar issues. I commented back then 'The serviceability tests like serviceability/sa seems to rely heavily on the "normal" structure of libjvm.so (from what I understand e.g. in LinuxVtblAccess it is attempted to access internal symbols like _ZTV ).' ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3547920976 From aartemov at openjdk.org Tue Nov 18 14:45:45 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Tue, 18 Nov 2025 14:45:45 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 14:35:16 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Added bool arg to notify_contended_enter @sspitsyn the proposed changes do have an effect on the order of jvmti events posted. For instance, in the timed-out case: Master branch, events posted: wait -> waited -> contended enter -> contended entered This PR: events posted: wait -> contended enter -> contended entered -> waited I have checked the specs, and it is not really clear: is (re)entering the OM considered to be a part of `wait` or not? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3547934122 From coleenp at openjdk.org Tue Nov 18 15:43:00 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 18 Nov 2025 15:43:00 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass Message-ID: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). Tested with tier1-4. 5-7 in progress. ------------- Commit messages: - Fix C2 to test for array first. - Move AccessFlags to InstanceKlass - array classes don't set access flags so don't look for them there. Changes: https://git.openjdk.org/jdk/pull/28371/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8372098 Stats: 155 lines in 29 files changed: 62 ins; 54 del; 39 mod Patch: https://git.openjdk.org/jdk/pull/28371.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28371/head:pull/28371 PR: https://git.openjdk.org/jdk/pull/28371 From liach at openjdk.org Tue Nov 18 15:43:03 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 18 Nov 2025 15:43:03 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass In-Reply-To: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 13:27:06 GMT, Coleen Phillimore wrote: > ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. > Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). > Tested with tier1-4. 5-7 in progress. src/hotspot/share/oops/constantPool.cpp line 1228: > 1226: > 1227: // Check constant pool method consistency > 1228: InstanceKlass* callee = InstanceKlass::cast(k); I know a MethodRef can be `[I`, `clone`, `()Ljava/lang/Object;` for `intArray.clone()` Java calls translated by javac. I wonder if this new code would break for such an array callee class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2538494116 From coleenp at openjdk.org Tue Nov 18 15:58:15 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 18 Nov 2025 15:58:15 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass In-Reply-To: References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 14:48:37 GMT, Chen Liang wrote: >> ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. >> Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). >> Tested with tier1-4. 5-7 in progress. > > src/hotspot/share/oops/constantPool.cpp line 1228: > >> 1226: >> 1227: // Check constant pool method consistency >> 1228: InstanceKlass* callee = InstanceKlass::cast(k); > > I know a MethodRef can be `[I`, `clone`, `()Ljava/lang/Object;` for `intArray.clone()` Java calls translated by javac. I wonder if this new code would break for such an array callee class. At one point, I removed is_interface() from class Klass, but then restored it because dependencies uses this a lot and has many Klass parameter types, instead of InstanceKlass. I'll revert this change, but I'm curious why none of the tests failed with this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2538747727 From aph at openjdk.org Tue Nov 18 18:00:10 2025 From: aph at openjdk.org (Andrew Haley) Date: Tue, 18 Nov 2025 18:00:10 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM Surely you're going to use features that are provided for debugging. They aren't called from anywhere, but they are used when debugging HotSpot. And you still need them even if you're not using a debug build. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3548890774 From duke at openjdk.org Tue Nov 18 18:21:35 2025 From: duke at openjdk.org (ExE Boss) Date: Tue, 18 Nov 2025 18:21:35 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass In-Reply-To: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 13:27:06 GMT, Coleen Phillimore wrote: > ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. > Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). > Tested with tier1-4. 5-7 in progress. src/hotspot/share/classfile/classFileParser.cpp line 815: > 813: interface_index, CHECK); > 814: if (cp->tag_at(interface_index).is_klass()) { > 815: interf = InstanceKlass::cast(cp->resolved_klass_at(interface_index)); Note?that a?resolved `CONSTANT_Class` can refer to an array?type, so?this?cast is?incorrect. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2539226107 From coleenp at openjdk.org Tue Nov 18 18:55:03 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 18 Nov 2025 18:55:03 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass In-Reply-To: References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 18:15:40 GMT, ExE Boss wrote: >> ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. >> Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). >> Tested with tier1-4. 5-7 in progress. > > src/hotspot/share/classfile/classFileParser.cpp line 815: > >> 813: interface_index, CHECK); >> 814: if (cp->tag_at(interface_index).is_klass()) { >> 815: interf = InstanceKlass::cast(cp->resolved_klass_at(interface_index)); > > Note?that a?resolved `CONSTANT_Class` can refer to an array?type, so?this?cast is?incorrect. There are a bunch of tests that we don't have. This would be an error since Interfaces are never arrays, but that's checked later. I'll revert some of these casts (as well as try to write a test for this). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2539318553 From liach at openjdk.org Tue Nov 18 20:05:14 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 18 Nov 2025 20:05:14 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass In-Reply-To: References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 18:50:55 GMT, Coleen Phillimore wrote: >> src/hotspot/share/classfile/classFileParser.cpp line 815: >> >>> 813: interface_index, CHECK); >>> 814: if (cp->tag_at(interface_index).is_klass()) { >>> 815: interf = InstanceKlass::cast(cp->resolved_klass_at(interface_index)); >> >> Note?that a?resolved `CONSTANT_Class` can refer to an array?type, so?this?cast is?incorrect. > > There are a bunch of tests that we don't have. This would be an error since Interfaces are never arrays, but that's checked later. I'll revert some of these casts (as well as try to write a test for this). I thought the cast at line 839 would have handled this. Turns out it has a `!interf->is_interface()` check before so this cast is problematic. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2539538759 From pchilanomate at openjdk.org Tue Nov 18 21:41:43 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 18 Nov 2025 21:41:43 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v8] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 19:30:44 GMT, Daniel D. Daugherty wrote: >> Maybe I do not fully understand the question, but isn't it what differentiates test case 2 from test case 3? > > Sorry, I wasn't very clear. I'm questioning the need for the 200ms delay since our call > to `wait4ContendedEnter` will already delay the calling thread. Since @pchilano requested > the addition of the 200ms delay, he should probably chime in here. We need it because the `notify()` call already changes the state of the waiter to the BLOCKED state [1] (note that it doesn't unpark it). That means this call to `wait4ContendedEnter` will always return immediately (except for the rare case of the wait timing out before the notify call). [1] https://github.com/openjdk/jdk/blob/27a38d9093958ae4851bc61b8d3f0d71dc780823/src/hotspot/share/runtime/objectMonitor.cpp#L2077 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2539670920 From cjplummer at openjdk.org Tue Nov 18 21:47:05 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 18 Nov 2025 21:47:05 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM SA is throwing an exception on the following: ` Klass classLoaderKlass = vm.getSystemDictionary().getClassLoaderKlass();` This looks to be the first thing it is doing that involves looking up a hotspot symbol. Possibly the issue is with symbols in general being stripped, or maybe just this one was. The fact that only 3 tests failed makes me think it is some very selective dead stripping of symbols that is the problem. Most SA functionality does not use SystemDictionary().getClassLoaderKlass(), so if just this one symbol was missing, that would explain why for the most part SA is working. On the assumption that it is just this one symbol, Hotspot declares an array of InstanceKlass* for some critical classes: InstanceKlass* vmClasses::_klasses[static_cast(vmClassID::LIMIT)] = { nullptr /*, nullptr...*/ }; In SA, the failed SystemDictionary.initialize() part of the stacktrace shows an attempt to access this array for the ClassLoader InstanceKlass* ` classLoaderKlassField = type.getAddressField(VM_CLASS_AT("ClassLoader_klass"));` private static String VM_CLASS_AT(String name) { return "_klasses[static_cast(" + VM_CLASS_ID(name) + ")]"; } And in vmStructs we have: ` static_field(vmClasses, VM_CLASS_AT(ClassLoader_klass), InstanceKlass*) ` I think this vmStructs static field is getting dead stripped. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3549555596 From coleenp at openjdk.org Tue Nov 18 21:50:35 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 18 Nov 2025 21:50:35 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v2] In-Reply-To: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: > ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. > Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). > Tested with tier1-4. 5-7 in progress. Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision: Revert two InstanceKlass::cast() calls that might not be InstanceKlass. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28371/files - new: https://git.openjdk.org/jdk/pull/28371/files/80079012..e8973f59 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=00-01 Stats: 5 lines in 2 files changed: 0 ins; 1 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/28371.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28371/head:pull/28371 PR: https://git.openjdk.org/jdk/pull/28371 From coleenp at openjdk.org Tue Nov 18 21:50:38 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 18 Nov 2025 21:50:38 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v2] In-Reply-To: References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: On Tue, 18 Nov 2025 20:02:09 GMT, Chen Liang wrote: >> There are a bunch of tests that we don't have. This would be an error since Interfaces are never arrays, but that's checked later. I'll revert some of these casts (as well as try to write a test for this). > > I thought the cast at line 839 would have handled this. Turns out it has a `!interf->is_interface()` check before so this cast is problematic. There's a reason this isn't tested. The constant pool reference for JVM_CONSTANT_Class is tested to be resolved at line 814 and because it's an interface, it's not easy to be resolved by this point (unless it's a duplicate class in which case it will be an InstanceKlass). The array case goes through the else part of this and throws a ClassFormatError. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2539645039 From cjplummer at openjdk.org Tue Nov 18 21:51:26 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 18 Nov 2025 21:51:26 GMT Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes [v2] In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com> Message-ID: > This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint. > > This PR focuses on purging virtual thread ThreadNodes in two places: > > 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread. > 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all" > > At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event. > > Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist. > > At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not. > > Tested by running all tier2, tier5, and tier6 CI svc tests. Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: comment typo ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28211/files - new: https://git.openjdk.org/jdk/pull/28211/files/717f9d70..49a358c5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28211.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28211/head:pull/28211 PR: https://git.openjdk.org/jdk/pull/28211 From cjplummer at openjdk.org Tue Nov 18 22:27:03 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 18 Nov 2025 22:27:03 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: <2CNk3Ufuu-ZmSz5qfhB4jKCP4H7VGDP0DqA_xAsEKic=.50f3f7c7-38db-4a94-a607-82837685e5d2@github.com> On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM Sorry, I think I went somewhat astray in my comments above. I think `classLoaderKlassField` is being initialized. It's value (an address) is then passed to instantiateWrapperFor(): public static InstanceKlass getClassLoaderKlass() { return (InstanceKlass)Metadata.instantiateWrapperFor(classLoaderKlassField.getValue()); } instantiateWrapperFor() is failing. If you look at the stack trace (and the accompanying code), it appears that it has failed to lookup the base type, which is Metadata. There probably are no instances of Metadata allocated, just instances of subclasses, so possibly the Metadata vtbl has been dead stripped, and SA needs it. However, I would think this would result in mass failures since we call Metadata.instantiateWrapperFor() all over the place. If you want to attempt a fix, have hotspot allocate a Metadata instance somewhere and keep a reference to it. That should prevent the Metadata vtbl from being dead stripped. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3549682521 From duke at openjdk.org Tue Nov 18 22:35:38 2025 From: duke at openjdk.org (Ruben) Date: Tue, 18 Nov 2025 22:35:38 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v3] In-Reply-To: References: Message-ID: > The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. > > The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. > > According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. Ruben has updated the pull request incrementally with one additional commit since the last revision: Replace `guarantee` with `assert` in the C1 `emit_deopt_handler` ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28192/files - new: https://git.openjdk.org/jdk/pull/28192/files/20cc58a3..3a014376 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=01-02 Stats: 10 lines in 5 files changed: 0 ins; 0 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/28192.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28192/head:pull/28192 PR: https://git.openjdk.org/jdk/pull/28192 From serb at openjdk.org Tue Nov 18 23:39:32 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 18 Nov 2025 23:39:32 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM As usual, maybe it is possible to split this patch between hotspot and the libraries? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3549889174 From cjplummer at openjdk.org Wed Nov 19 02:31:51 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 02:31:51 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM I reproduced the SA issues locally. Not surprisingly almost every SA test failed (I'm not sure why only 3 were listed above). They seemed to all fail trying to get a vtable for a hotspot type. The tests that didn't failed were doing mundane things like testing attaching, hotspot flags, and clhsdb history, but not doing anything with hotspot objects, or at least not with hotspot metadata. I was able to confirm the problem is with the Metadata vtable missing. I fixed it by allocating a Metadata instance and assigning it to a global. However, in order to get this to compile I had make Metadata no longer be abstract. All tests passed after I did this. I'm not sure how viable a solution this is. The hotspot team will probably object to the Metadata changes. Maybe there is some other way to cause a reference to the Metadata vtable so it is not dead stripped. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3550388831 From ysuenaga at openjdk.org Wed Nov 19 03:05:17 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 19 Nov 2025 03:05:17 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Tue, 18 Nov 2025 04:45:46 GMT, Chris Plummer wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update for Linux PPC64 and RISC-V > > On macosx I'm seeing the following when running ClhsdbPStack.java: > ``` Opening core file, please wait... > hsdb> hsdb> + verbose true > hsdb> + pstack -v > Deadlock Detection: > > No deadlocks found. > > Not available for Mac OS X processes > hsdb> + quit > > The "Not available for Mac OS X processes" message is expected when running on a macosx process, but in this case the test is running the core version of the test, so SA is acting on a core file. The test goes on to fail because there are no threads in the output. > > The message is generated by PStack.java whenever the thread list is null and it is running on OSX. In that case it assumes the reason the thread list is null is because it is running on a macosx process. It's not clear to me why the thread list is null. I don't see any changes that look like they could cause that. > > This happens with both x64 and aarch64, although you need to remove the test from the problem list for macosx-aarch64 to get it to reproduce. macosx-x64 is not problem listed. @plummercj Can you try this patch on your Mac? You can apply it to this PR branch. diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java index 10f6881d010..f091b22f9d7 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,9 @@ package sun.jvm.hotspot.debugger.bsd; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.stream.IntStream; import sun.jvm.hotspot.debugger.Address; import sun.jvm.hotspot.debugger.DebuggerBase; @@ -75,10 +77,11 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger { // CDebugger support private BsdCDebugger cdbg; - // threadList and loadObjectList are filled by attach0 method - private List threadList; + // loadObjectList are filled by attach0 method private List loadObjectList; + private List javaThreadList; + // called by native method lookupByAddress0 private ClosestSymbol createClosestSymbol(String name, long offset) { return new ClosestSymbol(name, offset); @@ -244,7 +247,7 @@ private void findABIVersion() throws DebuggerException { /** From the Debugger interface via JVMDebugger */ public synchronized void attach(int processID) throws DebuggerException { checkAttached(); - threadList = new ArrayList<>(); + javaThreadList = new ArrayList<>(); loadObjectList = new ArrayList<>(); class AttachTask implements WorkerThreadTask { int pid; @@ -264,7 +267,7 @@ public void doit(BsdDebuggerLocal debugger) { /** From the Debugger interface via JVMDebugger */ public synchronized void attach(String execName, String coreName) { checkAttached(); - threadList = new ArrayList<>(); + javaThreadList = new ArrayList<>(); loadObjectList = new ArrayList<>(); attach0(execName, coreName); attached = true; @@ -278,7 +281,7 @@ public synchronized boolean detach() { return false; } - threadList = null; + javaThreadList = null; loadObjectList = null; if (isCore) { @@ -492,7 +495,25 @@ public Address newAddress(long value) { /** From the BsdCDebugger interface */ public List getThreadList() { requireAttach(); - return threadList; + + if (javaThreadList == null) { + return null; + } + if (!isCore) { + // TODO: thread list is now supported for corefile only. + return Collections.emptyList(); + } + + if (javaThreadList.isEmpty()) { + Threads threads = VM.getVM().getThreads(); + IntStream.range(0, threads.getNumberOfThreads()) + .mapToObj(threads::getJavaThreadAt) + .forEach(javaThreadList::add); + } + + return javaThreadList.stream() + .map(t -> t.getThreadProxy()) + .toList(); } /** From the BsdCDebugger interface */ @@ -561,21 +582,16 @@ public void doit(BsdDebuggerLocal debugger) { /** this functions used for core file reading and called from native attach0, it returns an array of long integers as [thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for - all java threads recorded in Threads. Also adds the ThreadProxy to threadList */ + all java threads recorded in Threads. */ public long[] getJavaThreadsInfo() { requireAttach(); - Threads threads = VM.getVM().getThreads(); - int len = threads.getNumberOfThreads(); - long[] result = new long[len * 3]; // triple + long[] result = new long[javaThreadList.size() * 3]; // triple long beg, end; int i = 0; - for (int k = 0; k < threads.getNumberOfThreads(); k++) { - JavaThread t = threads.getJavaThreadAt(k); + for (var t : javaThreadList) { end = t.getStackBaseValue(); beg = end - t.getStackSize(); - BsdThread bsdt = (BsdThread)t.getThreadProxy(); - long uid = bsdt.getUniqueThreadId(); - if (threadList != null) threadList.add(bsdt); + long uid = ((BsdThread)t.getThreadProxy()).getUniqueThreadId(); result[i] = uid; result[i + 1] = beg; result[i + 2] = end; ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3550467374 From dlong at openjdk.org Wed Nov 19 04:20:44 2025 From: dlong at openjdk.org (Dean Long) Date: Wed, 19 Nov 2025 04:20:44 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v3] In-Reply-To: References: Message-ID: <2VkzhmbwgWzKma52fXgAHF-zi2Asd54tED_c57K8WOk=.6ee5549b-2136-489d-a71b-ba468b1e1de0@github.com> On Tue, 18 Nov 2025 22:35:38 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request incrementally with one additional commit since the last revision: > > Replace `guarantee` with `assert` in the C1 `emit_deopt_handler` src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp line 539: > 537: // the return address points to the deopt handler stub code entry point which could be > 538: // at the end of page. > 539: first_check_size = 4 Suggestion: first_check_size = instruction_size ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28192#discussion_r2540463385 From dlong at openjdk.org Wed Nov 19 04:27:09 2025 From: dlong at openjdk.org (Dean Long) Date: Wed, 19 Nov 2025 04:27:09 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v3] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 22:35:38 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request incrementally with one additional commit since the last revision: > > Replace `guarantee` with `assert` in the C1 `emit_deopt_handler` src/hotspot/cpu/s390/nativeInst_s390.hpp line 657: > 655: // code entry point, then it has to happen in two stages - to prevent out of bounds access > 656: // in case the return address points to the entry point which could be at the end of page. > 657: first_check_size = 0 Suggestion: first_check_size = 0 // check is unimplemented ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28192#discussion_r2540471158 From dlong at openjdk.org Wed Nov 19 04:31:41 2025 From: dlong at openjdk.org (Dean Long) Date: Wed, 19 Nov 2025 04:31:41 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 In-Reply-To: References: <-h6G9ajUWQwDRcUMOtyI_YCUCkXz3pzRggJk_UaxM-0=.a8c772aa-2f09-48c0-9cfb-17e624393eb0@github.com> Message-ID: On Mon, 17 Nov 2025 12:10:45 GMT, Ruben wrote: > Is there any additional testing you would recommend to perform before this can be integrated? Oracle likes to make sure the final version passes in our CI. I got burned last time testing an earlier version and not the final version. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3550665267 From sspitsyn at openjdk.org Wed Nov 19 04:57:38 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 19 Nov 2025 04:57:38 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 14:35:16 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Added bool arg to notify_contended_enter Thank you for refactoring the test into several tests which share a common part. It is nice! May I ask you about more refactoring? I'll inline my comments with the refactoring suggestions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3550803652 From sspitsyn at openjdk.org Wed Nov 19 05:08:33 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 19 Nov 2025 05:08:33 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 14:35:16 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Added bool arg to notify_contended_enter test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait1.java line 218: > 216: > 217: return 0; > 218: } Nit: Launch of `Waiter` and `Resumer`, some testing steps and test shutdown are identical for all 3 tests. So, they can be factored out into separate functions located in the base file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2540553311 From cjplummer at openjdk.org Wed Nov 19 05:48:59 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 05:48:59 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga wrote: >> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. >> >> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. >> >> Big thanks to @pchilano for your help! > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Update for Linux PPC64 and RISC-V With your diffs ClhsdbPStack.java is passing but now I'm seeing issues with the following 3 core file tests on both aarch64 and x64: serviceability/sa/ClhsdbFindPC.java#xcomp-core serviceability/sa/ClhsdbFindPC.java#no-xcomp-core serviceability/sa/ClhsdbCDSCore.java In the log it is having trouble with the stack trace: hsdb> + jstack -v Deadlock Detection: No deadlocks found. "main" #3 prio=5 tid=0x00007fa48a809010 nid=10499 runnable [0x000070000b780000] java.lang.Thread.State: RUNNABLE JavaThread state: _thread_in_native Error occurred during stack walking: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.getThreadIntegerRegisterSet0(Native Method) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.getThreadIntegerRegisterSet(BsdDebuggerLocal.java:462) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdThread.getContext(BsdThread.java:68) at jdk.hotspot.agent/sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess.getCurrentFrameGuess(BsdAMD64JavaThreadPDAccess.java:98) at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:266) at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:228) at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:81) at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$23.doit(CommandProcessor.java:1020) at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2088) at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2058) at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1929) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:113) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:45) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:285) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507) This repeats for every thread. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3550910458 From ysuenaga at openjdk.org Wed Nov 19 07:09:30 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Wed, 19 Nov 2025 07:09:30 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: On Wed, 19 Nov 2025 05:46:37 GMT, Chris Plummer wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update for Linux PPC64 and RISC-V > > With your diffs ClhsdbPStack.java is passing but now I'm seeing issues with the following 3 core file tests on both aarch64 and x64: > > > serviceability/sa/ClhsdbFindPC.java#xcomp-core > serviceability/sa/ClhsdbFindPC.java#no-xcomp-core > serviceability/sa/ClhsdbCDSCore.java > > > In the log it is having trouble with the stack trace: > > > hsdb> + jstack -v > Deadlock Detection: > > No deadlocks found. > > "main" #3 prio=5 tid=0x00007fa48a809010 nid=10499 runnable [0x000070000b780000] > java.lang.Thread.State: RUNNABLE > JavaThread state: _thread_in_native > > Error occurred during stack walking: > sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp > at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.getThreadIntegerRegisterSet0(Native Method) > at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.getThreadIntegerRegisterSet(BsdDebuggerLocal.java:462) > at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdThread.getContext(BsdThread.java:68) > at jdk.hotspot.agent/sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess.getCurrentFrameGuess(BsdAMD64JavaThreadPDAccess.java:98) > at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:266) > at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:228) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:81) > at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$23.doit(CommandProcessor.java:1020) > at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2088) > at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2058) > at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1929) > at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:113) > at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:45) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:285) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507) > > > This repeats for every thread. @plummercj Thanks a lot for your report! The error what you saw is caused that thread list wasn't made in `attach()`. I think following patch goes well... Can you try it? diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java index 10f6881d010..7c71dcd0ca5 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,9 @@ package sun.jvm.hotspot.debugger.bsd; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.stream.IntStream; import sun.jvm.hotspot.debugger.Address; import sun.jvm.hotspot.debugger.DebuggerBase; @@ -75,10 +77,11 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger { // CDebugger support private BsdCDebugger cdbg; - // threadList and loadObjectList are filled by attach0 method - private List threadList; + // loadObjectList are filled by attach0 method private List loadObjectList; + private List javaThreadList; + // called by native method lookupByAddress0 private ClosestSymbol createClosestSymbol(String name, long offset) { return new ClosestSymbol(name, offset); @@ -241,10 +244,16 @@ private void findABIVersion() throws DebuggerException { } } + private List generateJavaThreadList() { + Threads threads = VM.getVM().getThreads(); + return IntStream.range(0, threads.getNumberOfThreads()) + .mapToObj(threads::getJavaThreadAt) + .toList(); + } + /** From the Debugger interface via JVMDebugger */ public synchronized void attach(int processID) throws DebuggerException { checkAttached(); - threadList = new ArrayList<>(); loadObjectList = new ArrayList<>(); class AttachTask implements WorkerThreadTask { int pid; @@ -253,6 +262,10 @@ public void doit(BsdDebuggerLocal debugger) { debugger.attached = true; debugger.isCore = false; findABIVersion(); + + // TODO: thread list on macOS is now supported for corefile only. + debugger.javaThreadList = debugger.isDarwin ? Collections.emptyList() + : generateJavaThreadList(); } } @@ -264,12 +277,12 @@ public void doit(BsdDebuggerLocal debugger) { /** From the Debugger interface via JVMDebugger */ public synchronized void attach(String execName, String coreName) { checkAttached(); - threadList = new ArrayList<>(); loadObjectList = new ArrayList<>(); attach0(execName, coreName); attached = true; isCore = true; findABIVersion(); + javaThreadList = generateJavaThreadList(); } /** From the Debugger interface via JVMDebugger */ @@ -278,7 +291,7 @@ public synchronized boolean detach() { return false; } - threadList = null; + javaThreadList = null; loadObjectList = null; if (isCore) { @@ -492,7 +505,9 @@ public Address newAddress(long value) { /** From the BsdCDebugger interface */ public List getThreadList() { requireAttach(); - return threadList; + return javaThreadList.stream() + .map(JavaThread::getThreadProxy) + .toList(); } /** From the BsdCDebugger interface */ @@ -561,21 +576,16 @@ public void doit(BsdDebuggerLocal debugger) { /** this functions used for core file reading and called from native attach0, it returns an array of long integers as [thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for - all java threads recorded in Threads. Also adds the ThreadProxy to threadList */ + all java threads recorded in Threads. */ public long[] getJavaThreadsInfo() { requireAttach(); - Threads threads = VM.getVM().getThreads(); - int len = threads.getNumberOfThreads(); - long[] result = new long[len * 3]; // triple + long[] result = new long[javaThreadList.size() * 3]; // triple long beg, end; int i = 0; - for (int k = 0; k < threads.getNumberOfThreads(); k++) { - JavaThread t = threads.getJavaThreadAt(k); + for (var t : javaThreadList) { end = t.getStackBaseValue(); beg = end - t.getStackSize(); - BsdThread bsdt = (BsdThread)t.getThreadProxy(); - long uid = bsdt.getUniqueThreadId(); - if (threadList != null) threadList.add(bsdt); + long uid = ((BsdThread)t.getThreadProxy()).getUniqueThreadId(); result[i] = uid; result[i + 1] = beg; result[i + 2] = end; ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3551112603 From mbaesken at openjdk.org Wed Nov 19 08:32:25 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 08:32:25 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> Message-ID: On Wed, 19 Nov 2025 02:29:31 GMT, Chris Plummer wrote: > Maybe there is some other way to cause a reference to the Metadata vtable so it is not dead stripped. Would be good to have a fix people agree on, because we already saw the issue with lto enabled for Hotspot (see my comment above). So it is not only an issue related to the dead_strip flag. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3551410166 From mdoerr at openjdk.org Wed Nov 19 09:15:51 2025 From: mdoerr at openjdk.org (Martin Doerr) Date: Wed, 19 Nov 2025 09:15:51 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v3] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 22:35:38 GMT, Ruben wrote: >> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO. >> >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has updated the pull request incrementally with one additional commit since the last revision: > > Replace `guarantee` with `assert` in the C1 `emit_deopt_handler` Marked as reviewed by mdoerr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28192#pullrequestreview-3481619005 From adinn at openjdk.org Wed Nov 19 09:33:52 2025 From: adinn at openjdk.org (Andrew Dinn) Date: Wed, 19 Nov 2025 09:33:52 GMT Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v2] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 14:15:58 GMT, Ruben wrote: >> Our tests haven't revealed any new issues related to this PR. > > Thank you, @TheRealMDoerr, > >> I think assertions would be sufficient in C1 instead of guarantee. > > Sure, I will change these to assertions. @ruben-arm I'm ok with this version assuming it passes tests. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3551720864 From coleenp at openjdk.org Wed Nov 19 12:34:30 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 19 Nov 2025 12:34:30 GMT Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v3] In-Reply-To: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com> Message-ID: > ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details. > Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August). > Tested with tier1-4. 5-7 in progress. Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision: Revert a couple more InstanceKlass::casts also to get GHA to restart. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28371/files - new: https://git.openjdk.org/jdk/pull/28371/files/e8973f59..1060463b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=01-02 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28371.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28371/head:pull/28371 PR: https://git.openjdk.org/jdk/pull/28371 From mbaesken at openjdk.org Wed Nov 19 13:07:28 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 13:07:28 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Tue, 18 Nov 2025 23:36:10 GMT, Sergey Bylokhov wrote: > As usual, maybe it is possible to split this patch between hotspot and the libraries? For sure we can do this. But as listed above, we only see for a few jdk native libs a good size benefit when using this additional flag. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3552594695 From mbaesken at openjdk.org Wed Nov 19 13:11:29 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 13:11:29 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Tue, 18 Nov 2025 08:55:16 GMT, Matthias Baesken wrote: > > Is there is a particular reason to not apply this on x64 as well? > > On macOS x86_64 I saw in our CI those tests failing when enabling the dead_strip feature serviceability/sa/ClhsdbCDSCore.java serviceability/sa/ClhsdbFindPC.jav serviceability/sa/ClhsdbPstack.java > > (and macOS on Intel is not that interesting any more these days) > > For macOS aarch64, the tests in our CI were fine but I see some failures in the GHA in the serviceability area. > > ``` > finding class loader instances ..java.lang.InternalError: Metadata does not appear to be polymorphic > at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:223) > at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104) > at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:78) > at jdk.hotspot.agent/sun.jvm.hotspot.memory.SystemDictionary.getClassLoaderKlass(SystemDictionary.java:102) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.printClassLoaderStatistics(ClassLoaderStats.java:93) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.run(ClassLoaderStats.java:78) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:121) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134) > at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:202) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:344) > at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507) > ``` > > Have to check why I do not see those issues in our test infra. Okay I checked why this is the case. In our internal test setup we see some serviceability/sa - tests skipped because of 'SA Attach not expected to work. Insufficient privileges' . This can happen in some test setups especially on macOS but is not very helpful to test the influence of the dead_strip flag on the sa tests . ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3552605391 From aph at openjdk.org Wed Nov 19 13:19:16 2025 From: aph at openjdk.org (Andrew Haley) Date: Wed, 19 Nov 2025 13:19:16 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM I remember s390 used to strip unneeded stuff, and it was very hard to debug anything. Please think about whether you need to do this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3552643306 From mbaesken at openjdk.org Wed Nov 19 13:26:29 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 13:26:29 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Wed, 19 Nov 2025 13:14:33 GMT, Andrew Haley wrote: > I remember s390 used to strip unneeded stuff, and it was very hard to debug anything. What exactly was hard to debug? Did you use (fast)debug or product binaries ? I do not remember issues like this on s390 but I can ask my (ex)colleagues who dealt more with s390 . ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3552676735 From alanb at openjdk.org Wed Nov 19 13:54:03 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 19 Nov 2025 13:54:03 GMT Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes without JVMTI agent In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 20:19:58 GMT, Patricio Chilano Mateo wrote: > When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes. > > This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes: > > - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. An alternative that avoids the extra fence would be to place extra overhead on the thread requesting to disable transitions (e.g. by usi ng a safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so I believe this approach is simpler. > > - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`. > > - The code was previously structured in terms of mount and unmount cases, and a... src/java.base/share/classes/java/lang/VirtualThread.java line 1390: > 1388: } > 1389: > 1390: // -- JVM TI support -- We'll need to update is comment as it no longer only for JVMTI. This might be a good place for a block comment to define "transitions" covering the changing of thread identity the continuation mount/unmount, and how the notification to the VM support JVMTI and handshakes. Maybe I could contribute a block comment to include here? src/java.base/share/native/libjava/VirtualThread.c line 38: > 36: { "startFinalTransition", "()V", (void *)&JVM_VirtualThreadEnd }, > 37: { "startTransition", "(Z)V", (void *)&JVM_VirtualThreadStartTransition }, > 38: { "endTransition", "(Z)V", (void *)&JVM_VirtualThreadEndTransition }, I wonder if JVM_VirtualThreadStart and JVM_VirtualThreadEnd should be renamed to have EndFirstTransition and StartFinalTransaction in the names so it's easy to follow through from the Java code down to MountUnmountDisabler::start_transition/end_transition. test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreadsWhenParking.java line 94: > 92: }); > 93: } > 94: // wait for all virtual threads to start so all have a non-empty stack This reminds me the loom repo has a small update to to the DumpThreadsWithEliminatedLock.java test to ensure that the virtual thread starts execution before doing the thread dump. This was noticed with test-repeat runs of the new test to ensure it was stable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2542097138 PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2542016761 PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2542034248 From jsjolen at openjdk.org Wed Nov 19 14:28:37 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 19 Nov 2025 14:28:37 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v16] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 12:42:01 GMT, Coleen Phillimore wrote: >> Johan Sj?len 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 31 additional commits since the last revision: >> >> - Merge remote-tracking branch 'openjdk/master' into operands-again >> - It's fine to initialize the iterator with null, it's not fine to reserve an entry if it's null >> - Fix naming >> - Serguei comments >> - Revert change >> - Some nits >> - Fix copyright >> - Move BSMAttribute BSMAttributeEntries to own header file >> - Merge remote-tracking branch 'origin/operands-again' into operands-again >> - Apply suggestions from code review >> >> Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> >> - ... and 21 more: https://git.openjdk.org/jdk/compare/c1908450...57f0093e > > src/hotspot/share/oops/bsmAttribute.hpp line 28: > >> 26: #define SHARE_OOPS_BSMATTRIBUTE_HPP >> 27: >> 28: #include "classfile/classLoaderData.hpp" > > I think you can forward declare ClassLoaderData rather than include the whole file here. Ooh, you're right about that! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2542245468 From jsjolen at openjdk.org Wed Nov 19 14:33:19 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 19 Nov 2025 14:33:19 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v17] In-Reply-To: References: Message-ID: <6CQmVFTykatS4KDf9yWPGhLS8a_acPcW9Ds4Y6Utbuw=.4d3d889f-46e9-4766-9680-26b8b162746f@github.com> > Hi, > > This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. > > We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. > > For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. > > On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. > > Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision: Comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27198/files - new: https://git.openjdk.org/jdk/pull/27198/files/57f0093e..3686fc34 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=15-16 Stats: 8 lines in 3 files changed: 2 ins; 1 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/27198.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27198/head:pull/27198 PR: https://git.openjdk.org/jdk/pull/27198 From jsjolen at openjdk.org Wed Nov 19 14:33:21 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 19 Nov 2025 14:33:21 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v12] In-Reply-To: <8WVVrT5cKKUY1wGnTvxzj-8FFM-dZnYtuActIQRXZUQ=.0f11587c-e06f-47ee-93e4-bd7a5e7fc16f@github.com> References: <_0HzhdWbRBZNJvB33qf8VXRnc70eYXm7NCmb6oSEllw=.482f6b91-c612-4be7-a007-29954f0f5080@github.com> <8WVVrT5cKKUY1wGnTvxzj-8FFM-dZnYtuActIQRXZUQ=.0f11587c-e06f-47ee-93e4-bd7a5e7fc16f@github.com> Message-ID: On Wed, 5 Nov 2025 12:46:04 GMT, Coleen Phillimore wrote: >> src/hotspot/share/oops/bsmAttribute.inline.hpp line 34: >> >>> 32: _cur_array + BSMAttributeEntry::u2s_required(argc) > insert_into->bootstrap_methods()->length()) { >>> 33: return nullptr; >>> 34: } >> >> Nit: This check needs a comment. Also, I'd suggest to add a guarantee here instead of returning `nullptr`. > > I agree with this comment - is returning null going to crash somewhere down the line? Is this an overflow? Returning null generally shouldn't happen. It indicates that we have supplied too little space for the entries. The reason I don't `guarantee` here is because this function doesn't have enough context to output a proper error message. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2542253926 From jsjolen at openjdk.org Wed Nov 19 14:38:56 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 19 Nov 2025 14:38:56 GMT Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v17] In-Reply-To: <6CQmVFTykatS4KDf9yWPGhLS8a_acPcW9Ds4Y6Utbuw=.4d3d889f-46e9-4766-9680-26b8b162746f@github.com> References: <6CQmVFTykatS4KDf9yWPGhLS8a_acPcW9Ds4Y6Utbuw=.4d3d889f-46e9-4766-9680-26b8b162746f@github.com> Message-ID: On Wed, 19 Nov 2025 14:33:19 GMT, Johan Sj?len wrote: >> Hi, >> >> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`. >> >> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately. >> >> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc. >> >> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement. >> >> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again. > > Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision: > > Comments Hi! I'm back. I've done some benchmarking (DaCapo, etc) and found no discernible differences. I've also run Tier1-tier6 with the changes before 'Comments'. A total of 4 test failures, all seems highly unrelated to my changes so I'm not worried. I'd apprecaite a re-approval so I can integrate this :-). Thank you all for your efforts in making this PR happen. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27198#issuecomment-3553042638 From mbaesken at openjdk.org Wed Nov 19 15:06:46 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 15:06:46 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM Btw on Linux s390x it is the `linktime-gc` , but from what I see this can be disabled by configure if you don't like it https://github.com/openjdk/jdk/blob/0bff5f3dbe69ab2a59db771af1020b04c0132954/make/autoconf/jdk-options.m4#L112 https://github.com/openjdk/jdk/blob/0bff5f3dbe69ab2a59db771af1020b04c0132954/make/autoconf/flags-ldflags.m4#L55 ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553211601 From mbaesken at openjdk.org Wed Nov 19 15:22:45 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 15:22:45 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> Message-ID: On Wed, 19 Nov 2025 02:29:31 GMT, Chris Plummer wrote: > I reproduced the SA issues locally. Not surprisingly almost every SA test failed (I'm not sure why only 3 were listed above). They seemed to all fail trying to get a vtable for a hotspot type. The tests that didn't failed were doing mundane things like testing attaching, hotspot flags, and clhsdb history, but not doing anything with hotspot objects, or at least not with hotspot metadata. > > I was able to confirm the problem is with the Metadata vtable missing. I fixed it by allocating a Metadata instance and assigning it to a global. However, in order to get this to compile I had make Metadata no longer be abstract. All tests passed after I did this. I'm not sure how viable a solution this is. The hotspot team will probably object to the Metadata changes. Maybe there is some other way to cause a reference to the Metadata vtable so it is not dead stripped. There seem to be attributes for this kind of use case in clang, e.g. retain https://reviews.llvm.org/D97447 https://clang.llvm.org/docs/AttributeReference.html#retain Should we add this to 'class Metadata' ? If we can do it with attributes or something similar (and without changing lots of code locations) it sounds better to me than adjusting the coding. 'Pseudo dead' stuff that is used from external tools (so it is not really 'dead' in practise) should be somehow marked to assist the tools. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553303689 From aph at openjdk.org Wed Nov 19 15:33:26 2025 From: aph at openjdk.org (Andrew Haley) Date: Wed, 19 Nov 2025 15:33:26 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM On 19/11/2025 13:22, Matthias B?sken wrote: > MBaesken left a comment (openjdk/jdk#28319) > >> I remember s390 used to strip unneeded stuff, and it was very hard to debug anything. > > What exactly was hard to debug? > Did you use (fast)debug or product binaries ? > I do not remember issues like this on s390 but I can ask my (ex)colleagues who dealt more with s390 . It was hard to debug hotspot. Helpers such as pp(), back_trace(), and pfl() were missing. I think it was a release build, but of course you sometimes have to debug release builds. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553349390 From aph at openjdk.org Wed Nov 19 15:39:10 2025 From: aph at openjdk.org (Andrew Haley) Date: Wed, 19 Nov 2025 15:39:10 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: <9IgIs95wIgZ7ph5S69JEqYoKqitRnmg9pptrqzVCGkk=.5477177e-9402-498f-b858-876061977821@github.com> On Wed, 19 Nov 2025 15:03:33 GMT, Matthias Baesken wrote: > Btw on Linux s390x it is the `linktime-gc` , but from what I see this can be disabled by configure if you don't like it Yes, it can. Thankfully I don't usually need to debug hotspot in production s390 systems. I do, however, need to debug AArch64 on MacOS. This is a Very Bad Idea, and should not be dome. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553368265 From aartemov at openjdk.org Wed Nov 19 16:04:51 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Wed, 19 Nov 2025 16:04:51 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v13] In-Reply-To: References: Message-ID: > Hi, please consider the following changes: > > If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: > > The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. > > This can happen in two places where the successor could be suspended: > 1: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 > > 2: > https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 > > The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. > > The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. > > Tests are added for both scenarios. > > Tested in tiers 1 - 7. Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: 8366659: Refactored tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27040/files - new: https://git.openjdk.org/jdk/pull/27040/files/8c82d39c..08b481cd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=11-12 Stats: 388 lines in 5 files changed: 112 ins; 255 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/27040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040 PR: https://git.openjdk.org/jdk/pull/27040 From aartemov at openjdk.org Wed Nov 19 16:04:55 2025 From: aartemov at openjdk.org (Anton Artemov) Date: Wed, 19 Nov 2025 16:04:55 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 04:55:05 GMT, Serguei Spitsyn wrote: >> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8366659: Added bool arg to notify_contended_enter > > Thank you for refactoring the test into several tests which share a common part. It is nice! > May I ask you about more refactoring? I'll inline my comments with the refactoring suggestions. > @sspitsyn the proposed changes do have an effect on the order of jvmti events posted. For instance, in the timed-out case: > > Master branch, events posted: wait -> waited -> contended enter -> contended entered This PR: events posted: wait -> contended enter -> contended entered -> waited > > I have checked the specs, and it is not really clear: is (re)entering the OM considered to be a part of `wait` or not? @sspitsyn could you please comment on the order of events and possible issues we can get if the order is changed? > test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait1.java line 218: > >> 216: >> 217: return 0; >> 218: } > > Nit: Launch of `Waiter` and `Resumer`, some testing steps and test shutdown are identical for all 3 tests. So, they can be factored out into separate functions located in the base file. Thanks, I have applied a bit more refactoring, trying to move common stuff into the base test class. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3553429559 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2542591879 From mbaesken at openjdk.org Wed Nov 19 16:35:03 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 19 Nov 2025 16:35:03 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM Seems like we should fix the elimination of those debug helpers ; but those are only in the jvm lib. The situation in other libs is different. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553637974 From cjplummer at openjdk.org Wed Nov 19 16:46:32 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 16:46:32 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> <4OIhZOkrBIfui3Hu5nfgmDklI_tL32E53tEJHq_CNJs=.59b581d7-0bad-42bb-aba3-347b06e952b5@github.com> Message-ID: On Wed, 19 Nov 2025 15:20:31 GMT, Matthias Baesken wrote: > There seem to be attributes for this kind of use case in clang, e.g. retain > https://reviews.llvm.org/D97447 > https://clang.llvm.org/docs/AttributeReference.html#retain > Should we add this to 'class Metadata' ? > If we can do it with attributes or something similar (and without changing lots of code locations) it sounds better to me than adjusting the coding. > 'Pseudo dead' stuff that is used from external tools (so it is not really 'dead' in practise) should be somehow marked to assist the tools. > There is also an attribute 'used' that looks similar. I tried the following but it didn't work. Perhaps I don't have the syntax right: --- a/src/hotspot/share/oops/metadata.hpp +++ b/src/hotspot/share/oops/metadata.hpp @@ -30,6 +30,7 @@ #include "utilities/ostream.hpp" // This is the base class for an internal Class related metadata +#pragma retain Metadata class Metadata : public MetaspaceObj { // Debugging hook to check that the metadata has not been deleted. NOT_PRODUCT(int _valid;) Note `retain` and `used` are listed under function attributes. They probably don't apply to data. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553656342 From cjplummer at openjdk.org Wed Nov 19 17:30:21 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 17:30:21 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM The following is how you declare a reference to the vtable: extern "C" void* _ZTV8Metadata[]; If you then reference _ZTV8Metadata from somewhere in a way that does not get dead stripped, that seems to fix the problem. The latter part is definitely very hacky. It would be nice to get a pragma working to keep the symbol from being deadstripped. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553874175 From sspitsyn at openjdk.org Wed Nov 19 18:12:12 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 19 Nov 2025 18:12:12 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v13] In-Reply-To: References: Message-ID: <0LholCkfab5s73jB3elCViYiI2xdxjvCV-qjfXz7v4c=.837deadf-cfff-4b29-97bc-f859fbf9578b@github.com> On Wed, 19 Nov 2025 16:04:51 GMT, Anton Artemov wrote: >> Hi, please consider the following changes: >> >> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible: >> >> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM. >> >> This can happen in two places where the successor could be suspended: >> 1: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897 >> >> 2: >> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149 >> >> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. >> >> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again. The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events. >> >> Tests are added for both scenarios. >> >> Tested in tiers 1 - 7. > > Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: > > 8366659: Refactored tests. Thank you for update! test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait1.java line 141: > 139: > 140: > 141: Nit: unneeded empty lines test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait2.java line 156: > 154: > 155: > 156: Nit: unneeded empty lines test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait3.java line 166: > 164: > 165: > 166: Nit: unneeded empty lines ------------- PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3484035013 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2543018144 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2543018979 PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2543019514 From cjplummer at openjdk.org Wed Nov 19 18:57:14 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 18:57:14 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken wrote: > The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols. > Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) : > (before -> after setting the option) > > 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib > 264K -> 248K images/jdk/lib/libjavajpeg.dylib > 152K -> 132K images/jdk/lib/libjli.dylib > 388K -> 296K images/jdk/lib/liblcms.dylib > 164K -> 128K images/jdk/lib/libzip.dylib > > > and libjvm : > > 20M -> 18M images/jdk/lib/server/libjvm.dylib > 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM This seems to work: extern void* _ZTV8Metadata[]; __attribute__((used)) void* foo() { return _ZTV8Metadata[0]; } You can put this anywhere since it does not reference any hotspot types. It just needs to be linked in with libjvm. Note I tried putting the "used" attribute on _ZTV8Metadata and getting rid of the foo() part, but I got the following warning and the vtable was dead stripped: `warning: 'used' attribute ignored on a non-definition declaration [-Wignored-attributes]` ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3554180419 From pchilanomate at openjdk.org Wed Nov 19 19:06:34 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 19 Nov 2025 19:06:34 GMT Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes without JVMTI agent [v2] In-Reply-To: References: Message-ID: > When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes. > > This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes: > > - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. An alternative that avoids the extra fence would be to place extra overhead on the thread requesting to disable transitions (e.g. by usi ng a safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so I believe this approach is simpler. > > - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`. > > - The code was previously structured in terms of mount and unmount cases, and a... Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: Add fixes to DumpThreadsWithEliminatedLock.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28361/files - new: https://git.openjdk.org/jdk/pull/28361/files/70f96a7d..976486cd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=00-01 Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28361.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361 PR: https://git.openjdk.org/jdk/pull/28361 From pchilanomate at openjdk.org Wed Nov 19 19:06:37 2025 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 19 Nov 2025 19:06:37 GMT Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes without JVMTI agent [v2] In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 13:50:44 GMT, Alan Bateman wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Add fixes to DumpThreadsWithEliminatedLock.java > > src/java.base/share/classes/java/lang/VirtualThread.java line 1390: > >> 1388: } >> 1389: >> 1390: // -- JVM TI support -- > > We'll need to update is comment as it no longer only for JVMTI. > > This might be a good place for a block comment to define "transitions" covering the changing of thread identity the continuation mount/unmount, and how the notification to the VM support JVMTI and handshakes. Maybe I could contribute a block comment to include here? That would be great. > src/java.base/share/native/libjava/VirtualThread.c line 38: > >> 36: { "startFinalTransition", "()V", (void *)&JVM_VirtualThreadEnd }, >> 37: { "startTransition", "(Z)V", (void *)&JVM_VirtualThreadStartTransition }, >> 38: { "endTransition", "(Z)V", (void *)&JVM_VirtualThreadEndTransition }, > > I wonder if JVM_VirtualThreadStart and JVM_VirtualThreadEnd should be renamed to have EndFirstTransition and StartFinalTransaction in the names so it's easy to follow through from the Java code down to MountUnmountDisabler::start_transition/end_transition. How about removing these methods and just have an extra boolean parameter in `start/endTransition`? https://github.com/pchilano/jdk/compare/JDK-8364343...pchilano:jdk:startEndTransitionsOnly > test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreadsWhenParking.java line 94: > >> 92: }); >> 93: } >> 94: // wait for all virtual threads to start so all have a non-empty stack > > This reminds me the loom repo has a small update to to the DumpThreadsWithEliminatedLock.java test to ensure that the virtual thread starts execution before doing the thread dump. This was noticed with test-repeat runs of the new test to ensure it was stable. Added the fixes to `DumpThreadsWithEliminatedLock.java` from the loom repo. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2543217770 PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2543212884 PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2543215701 From sspitsyn at openjdk.org Wed Nov 19 19:11:02 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 19 Nov 2025 19:11:02 GMT Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension request [v12] In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 04:55:05 GMT, Serguei Spitsyn wrote: >> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8366659: Added bool arg to notify_contended_enter > > Thank you for refactoring the test into several tests which share a common part. It is nice! > May I ask you about more refactoring? I'll inline my comments with the refactoring suggestions. > @sspitsyn the proposed changes do have an effect on the order of jvmti events posted. For instance, in the timed-out case: > Master branch, events posted: wait -> waited -> contended enter -> contended entered > This PR: events posted: wait -> contended enter -> contended entered -> waited > > I have checked the specs, and it is not really clear: is (re)entering the OM considered to be a part of wait or not? I also do not see anything in the specs (JLS, JVMS and JVMTI) but I feel it is better to keep the original order if possible. It is going to be an impact/change on the thread state: https://docs.oracle.com/en/java/javase/25/docs/specs/jvmti.html#GetThreadState AFAIU, with this change new combinations of thread state bits will be observable: `JVMTI_THREAD_STATE_WAITING` + `JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER` + (`JVMTI_THREAD_STATE_WAITING_INDEFINITELY` | `JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT`) Also, it is a change in behavior with a compatibility risk involved. So, a CSR will be needed for this change. I'm not sure yet if we need to consult with the JCK team on this if no JCK tests are failed. What mach5 tests did you run? In this case, it is more safe to run mach5 tiers 1-6. @dholmes-ora may have some concerns here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3554220528 From aph at openjdk.org Wed Nov 19 19:11:02 2025 From: aph at openjdk.org (Andrew Haley) Date: Wed, 19 Nov 2025 19:11:02 GMT Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size In-Reply-To: References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com> Message-ID: On Wed, 19 Nov 2025 16:31:58 GMT, Matthias Baesken wrote: > Seems like we should fix the elimination of those debug helpers ; but those are only in the jvm lib. The situation in other libs is different. Maybe, but it's not just the specific debug helpers. There are many functions in hotspot, and the maintenance programmer (in the case of Mac/AArch64, that's often me) will frequently type stuff like `print a->size()`. Linker options that strip "unused" code in binaries have been available for decades, and we haven't much used such options because they're a pain. Debugging on MacOS/AArch64 is a pain as it is, without making it worse. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3554226232 From cjplummer at openjdk.org Wed Nov 19 20:36:05 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 19 Nov 2025 20:36:05 GMT Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java failing [v2] In-Reply-To: References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com> Message-ID: <0TxBLi0V1trfnojqXWHqzvI6CNA1DNPDU3-QVB2UtOU=.a49a0a74-69da-4710-92b2-cca833a392d5@github.com> On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga wrote: >> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack. >> >> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms. >> >> Big thanks to @pchilano for your help! > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Update for Linux PPC64 and RISC-V stderr: [Exception in thread "main" java.lang.RuntimeException: VM.initialize() was not yet called at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.getVM(VM.java:576) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.generateJavaThreadList(BsdDebuggerLocal.java:248) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:285) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:638) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:624) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:378) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:343) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:157) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.attachDebugger(CLHSDB.java:211) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:70) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:45) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:285) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507) VM.initialize() is not triggered until after HotSpotAgent.setupDebugger() returns: private void go() { setupDebugger(); setupVM(); } ------------- PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3554527760 From macarte at openjdk.org Wed Nov 19 22:40:54 2025 From: macarte at openjdk.org (Mat Carter) Date: Wed, 19 Nov 2025 22:40:54 GMT Subject: RFR: 8369736 - Add management interface for AOT cache creation [v8] In-Reply-To: <8XzXNt3iOeijZtZWB_zdMoWLPadJkgEbmaoqZQjEH1A=.a9fca7c1-9e42-4209-b21f-08af5554d344@github.com> References: <3DZMFG5pUixBip4O18gylfQpcCOTFxcwwVTWahRMBYo=.c9cb089e-6031-4b77-bb4a-775ed6cac818@github.com> <8XzXNt3iOeijZtZWB_zdMoWLPadJkgEbmaoqZQjEH1A=.a9fca7c1-9e42-4209-b21f-08af5554d344@github.com> Message-ID: On Mon, 3 Nov 2025 11:01:56 GMT, Alan Bateman wrote: >> I also removed the nested {@code ..} from within the as that also caused an issue > > Good. You can move the example to a snippet too and that will allow the `
` tags to go away.

In the latest CSR the code snippet was removed

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2543782660

From macarte at openjdk.org  Wed Nov 19 22:50:02 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 19 Nov 2025 22:50:02 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 14 Nov 2025 18:03:30 GMT, Vladimir Kozlov  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Document use of DiagnosticCommand
>
> src/hotspot/share/services/diagnosticCommand.cpp line 996:
> 
>> 994:     output()->print_cr("Error! Not a recording run");
>> 995:     return;
>> 996:   }
> 
> First, is `output()` directed to VM's tty or somewhere else?
> 
> Second, I think you need to be more verbose in error. Maybe:
> 
> Error: AOT recording is not initiated. VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing.

There are two cases:

1) When using jcmd the output is piped back from the VM to the jcmd process which in turn outputs the message to tty
2) When invoked using the DiagnosticCommandBean the output is piped back to the bean itself and returned as a string from the invoke method

These two cases are demonstrated in the included tests

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2543798637

From lmesnik at openjdk.org  Wed Nov 19 22:57:48 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Wed, 19 Nov 2025 22:57:48 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
Message-ID: 

On Wed, 19 Nov 2025 16:04:51 GMT, Anton Artemov  wrote:

>> Hi, please consider the following changes:
>> 
>> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
>> 
>> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
>> 
>> This can happen in two places where the successor could be suspended: 
>> 1:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
>> 
>> 2:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
>> 
>> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
>> 
>> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
>> 
>> Tests are added for both scenarios. 
>> 
>> Tested in tiers 1 - 7.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8366659: Refactored tests.

Changes requested by lmesnik (Reviewer).

test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWaitWorker.java line 42:

> 40: 
> 41:     public void run() {
> 42:         SuspendWithObjectMonitorWait1.logDebug("thread running");

SuspendWithObjectMonitorWaitBase instead of SuspendWithObjectMonitorWait1 here.
There are a lot such places in this file.

-------------

PR Review: https://git.openjdk.org/jdk/pull/27040#pullrequestreview-3484952328
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2543738637

From macarte at openjdk.org  Wed Nov 19 22:58:09 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 19 Nov 2025 22:58:09 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Wed, 19 Nov 2025 22:46:32 GMT, Mat Carter  wrote:

>> src/hotspot/share/services/diagnosticCommand.cpp line 996:
>> 
>>> 994:     output()->print_cr("Error! Not a recording run");
>>> 995:     return;
>>> 996:   }
>> 
>> First, is `output()` directed to VM's tty or somewhere else?
>> 
>> Second, I think you need to be more verbose in error. Maybe:
>> 
>> Error: AOT recording is not initiated. VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing.
>
> There are two cases:
> 
> 1) When using jcmd the output is piped back from the VM to the jcmd process which in turn outputs the message to tty
> 2) When invoked using the DiagnosticCommandBean the output is piped back to the bean itself and returned as a string from the invoke method
> 
> These two cases are demonstrated in the included tests

Updated the message, following convention and not including "Error! .."

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2543812881

From macarte at openjdk.org  Wed Nov 19 23:06:00 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 19 Nov 2025 23:06:00 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 14 Nov 2025 18:12:04 GMT, Vladimir Kozlov  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Document use of DiagnosticCommand
>
> src/hotspot/share/services/diagnosticCommand.cpp line 1000:
> 
>> 998:   if (!AOTMetaspace::is_recording_preimage_static_archive()) {
>> 999:     output()->print_cr("Error! Not recording");
>> 1000:     return;
> 
> This check is confusing because your error message is cryptic.
> Actually I think you don't need any message here - it is not error. Use comment instead:
> 
>   // The other thread already initiated end of recording.

I've changed the message to be less cryptic, but the message should still be returned to whoever invoked the command

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2543825605

From ysuenaga at openjdk.org  Thu Nov 20 00:07:45 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Thu, 20 Nov 2025 00:07:45 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v2]
In-Reply-To: 
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
 
Message-ID: 

On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga  wrote:

>> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack.
>> 
>> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms.
>> 
>> Big thanks to @pchilano for your help!
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update for Linux PPC64 and RISC-V

Ok, I confirmed `VM.initialize()` would be called at the end of `setupVM()`. So I updated a patch for `BsdDebuggerLocal` to initialize thread list in lazily. Can you try it again? Sorry for the trouble.


diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
index 10f6881d010..891ebc91f49 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,9 @@
 package sun.jvm.hotspot.debugger.bsd;

 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.stream.IntStream;

 import sun.jvm.hotspot.debugger.Address;
 import sun.jvm.hotspot.debugger.DebuggerBase;
@@ -75,10 +77,11 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
     // CDebugger support
     private BsdCDebugger cdbg;

-    // threadList and loadObjectList are filled by attach0 method
-    private List threadList;
+    // loadObjectList are filled by attach0 method
     private List loadObjectList;

+    private List javaThreadList;
+
     // called by native method lookupByAddress0
     private ClosestSymbol createClosestSymbol(String name, long offset) {
        return new ClosestSymbol(name, offset);
@@ -241,10 +244,21 @@ private void findABIVersion() throws DebuggerException {
         }
     }

+    private void fillJavaThreadList() {
+      // TODO: thread list on macOS is now supported for corefile only.
+      if (!isCore && isDarwin) {
+          javaThreadList = Collections.emptyList();
+      } else {
+          Threads threads = VM.getVM().getThreads();
+          javaThreadList =  IntStream.range(0, threads.getNumberOfThreads())
+                            .mapToObj(threads::getJavaThreadAt)
+                            .toList();
+      }
+    }
+
     /** From the Debugger interface via JVMDebugger */
     public synchronized void attach(int processID) throws DebuggerException {
         checkAttached();
-        threadList = new ArrayList<>();
         loadObjectList = new ArrayList<>();
         class AttachTask implements WorkerThreadTask {
            int pid;
@@ -264,7 +278,6 @@ public void doit(BsdDebuggerLocal debugger) {
     /** From the Debugger interface via JVMDebugger */
     public synchronized void attach(String execName, String coreName) {
         checkAttached();
-        threadList = new ArrayList<>();
         loadObjectList = new ArrayList<>();
         attach0(execName, coreName);
         attached = true;
@@ -278,7 +291,7 @@ public synchronized boolean detach() {
             return false;
         }

-        threadList = null;
+        javaThreadList = null;
         loadObjectList = null;

         if (isCore) {
@@ -492,7 +505,12 @@ public Address newAddress(long value) {
     /** From the BsdCDebugger interface */
     public List getThreadList() {
       requireAttach();
-      return threadList;
+      if (javaThreadList == null) {
+        fillJavaThreadList();
+      }
+      return javaThreadList.stream()
+                           .map(JavaThread::getThreadProxy)
+                           .toList();
     }

     /** From the BsdCDebugger interface */
@@ -561,21 +579,19 @@ public void doit(BsdDebuggerLocal debugger) {
     /** this functions used for core file reading and called from native attach0,
         it returns an array of long integers as
         [thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for
-        all java threads recorded in Threads. Also adds the ThreadProxy to threadList */
+        all java threads recorded in Threads. */
     public long[] getJavaThreadsInfo() {
         requireAttach();
-        Threads threads = VM.getVM().getThreads();
-        int len = threads.getNumberOfThreads();
-        long[] result = new long[len * 3];    // triple
+        if (javaThreadList == null) {
+            fillJavaThreadList();
+        }
+        long[] result = new long[javaThreadList.size() * 3];    // triple
         long beg, end;
         int i = 0;
-        for (int k = 0; k < threads.getNumberOfThreads(); k++) {
-            JavaThread t = threads.getJavaThreadAt(k);
+        for (var t : javaThreadList) {
             end = t.getStackBaseValue();
             beg = end - t.getStackSize();
-            BsdThread bsdt = (BsdThread)t.getThreadProxy();
-            long uid = bsdt.getUniqueThreadId();
-            if (threadList != null) threadList.add(bsdt);
+            long uid = ((BsdThread)t.getThreadProxy()).getUniqueThreadId();
             result[i] = uid;
             result[i + 1] = beg;
             result[i + 2] = end;

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3555136250

From macarte at openjdk.org  Thu Nov 20 00:46:28 2025
From: macarte at openjdk.org (Mat Carter)
Date: Thu, 20 Nov 2025 00:46:28 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3]
In-Reply-To: 
References: 
 
 
Message-ID: <60ObxggVqKu_dERxlWG1qDSXlvdxTfSFC-iFjpABKi8=.a6add8d8-9dc6-4275-956c-0f6137b0f5a0@github.com>

On Fri, 14 Nov 2025 18:25:03 GMT, Vladimir Kozlov  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Document use of DiagnosticCommand
>
> src/hotspot/share/services/diagnosticCommand.cpp line 1007:
> 
>> 1005:     output()->print_cr("Recording ended successfully");
>> 1006:     return;
>> 1007:   }
> 
> I think this should be reversed and message replaced with comment.
> 
> if (AOTMetaspace::is_recording_preimage_static_archive()) {
>     // Other thread already dumped archive.
>     return;
> }
> output()->print_cr("AOT recording ended successfully");

I switched the order, but the error condition stands:  we attempted to stop the recording, but the VM believes the recording is still continuing

Please note that the flag indicates that the recording is stopping/stopped but the cache may not have been dumped yet

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2543974788

From cjplummer at openjdk.org  Thu Nov 20 01:17:22 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 20 Nov 2025 01:17:22 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v2]
In-Reply-To: 
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
 
Message-ID: 

On Thu, 13 Nov 2025 12:53:50 GMT, Yasumasa Suenaga  wrote:

>> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack.
>> 
>> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms.
>> 
>> Big thanks to @pchilano for your help!
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update for Linux PPC64 and RISC-V

It's passing now.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3555309204

From ysuenaga at openjdk.org  Thu Nov 20 01:25:45 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Thu, 20 Nov 2025 01:25:45 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v3]
In-Reply-To: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
Message-ID: 

> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack.
> 
> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms.
> 
> Big thanks to @pchilano for your help!

Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:

  Fix for macOS

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28284/files
  - new: https://git.openjdk.org/jdk/pull/28284/files/dfd947ab..bb2fe02f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28284&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28284&range=01-02

  Stats: 38 lines in 1 file changed: 22 ins; 6 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/28284.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28284/head:pull/28284

PR: https://git.openjdk.org/jdk/pull/28284

From ysuenaga at openjdk.org  Thu Nov 20 01:25:47 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Thu, 20 Nov 2025 01:25:47 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v2]
In-Reply-To: 
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
 
 
Message-ID: 

On Thu, 20 Nov 2025 01:13:41 GMT, Chris Plummer  wrote:

>> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update for Linux PPC64 and RISC-V
>
> It's passing now.

@plummercj Thanks a lot! I pushed the change to this PR.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3555318145

From sspitsyn at openjdk.org  Thu Nov 20 02:31:46 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 02:31:46 GMT
Subject: RFR: 6960970: Debugger very slow during stepping
Message-ID: 

This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.

This fix is to avoid enabling the `interp-only` mode for threads when `FramePop` events are enabled with JVMTI `SetEventNotificationMode`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` in the function `InterpreterRuntime::frequency_counter_overflow_inner()`. Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
The other details will be provided in the first PR request comment.
It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).

Testing:
 - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
 - submitted mach5 tiers 1-6

-------------

Commit messages:
 - 6960970: Debugger very slow during stepping

Changes: https://git.openjdk.org/jdk/pull/28407/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-6960970
  Stats: 282 lines in 21 files changed: 200 ins; 57 del; 25 mod
  Patch: https://git.openjdk.org/jdk/pull/28407.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28407/head:pull/28407

PR: https://git.openjdk.org/jdk/pull/28407

From sspitsyn at openjdk.org  Thu Nov 20 04:45:24 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 04:45:24 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v2]
In-Reply-To: 
References: 
Message-ID: 

> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
> 
> This fix is to avoid enabling the `interp-only` mode for threads when `FramePop` events are enabled with JVMTI `SetEventNotificationMode`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` in the function `InterpreterRuntime::frequency_counter_overflow_inner()`. Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
> The other details will be provided in the first PR request comment.
> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
> 
> Testing:
>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>  - submitted mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  cleanup: removed an old code fragment in frame.cpp

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28407/files
  - new: https://git.openjdk.org/jdk/pull/28407/files/d31aefb6..b3cffe5a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=00-01

  Stats: 14 lines in 1 file changed: 0 ins; 14 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28407.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28407/head:pull/28407

PR: https://git.openjdk.org/jdk/pull/28407

From sspitsyn at openjdk.org  Thu Nov 20 04:53:52 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 04:53:52 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 04:45:24 GMT, Serguei Spitsyn  wrote:

>> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
>> 
>> This fix is to avoid enabling the `interp-only` mode for threads when `FramePop` events are enabled with JVMTI `SetEventNotificationMode`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` in the function `InterpreterRuntime::frequency_counter_overflow_inner()`. Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
>> The other details will be provided in the first PR request comment.
>> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
>> 
>> Testing:
>>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>>  - submitted mach5 tiers 1-6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cleanup: removed an old code fragment in frame.cpp

Change details:
 - platform-dependent `interp_masm*.cpp` and `zero/bytecodeInterpreter.cpp`:
    removed `interp-only` mode check before call to `InterpreterRuntime::post_method_exit()`
 - `interpreterRuntime.cpp`: disallow OSR for frames marked for `FramePop` event notification
 - `jvmtiEnvBase.cpp`:
   - added frame deoptimization logic to JVMTI `NotifyFramePop` implementation
   - added `check_and_clear_vthread_pending_deopts()` calls to JVMTI `ClearAllFramePops` implementation
 - `jvmtiEnvThreadState.cpp`: removed undesired check `!jvmti_thread_state()->is_interp_only_mode()` from `JvmtiEnvThreadState::is_frame_pop()` function
 - `jvmtiEventController.cpp`:
    - `JvmtiEventControllerPrivate::recompute_thread_enabled()`: removed `ets->has_frame_pops()` check when the `interp-only` node is enabled
 - `jvmtiExport.?pp`: 
   - introduced new function `has_frame_pop_for_top_frame()` used to disallow `OSR` for target frame
   - `JvmtiExport::post_method_exit()`: replaced `state->is_interp_only_mode()` check with `current_frame.is_interpreted_frame()`
 - `jvmtiThreadState.?pp`:
   - implementation of `process_vthread_pending_deopts()`logics
   - `JvmtiThreadState::process_pending_interp_only()`: added `MutexLocker mu(JvmtiThreadState_lock)`
   - `JvmtiThreadState::update_for_pop_top_frame()`: removed `is_interp_only_mode()` check
 - `frame.cpp`:
    - fix provided by Patricio (Thank you!): an assert specific to continuation heap frames is fixed
 - `serviceability/jvmti/events/NotifyFramePopStressTest`: minor tweak to help with debugging
 - `serviceability/jvmti/vthread/ThreadStateTest`: added code to provide extra test coverage from JVMTI `FramePop` events

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28407#issuecomment-3555778224

From dholmes at openjdk.org  Thu Nov 20 05:42:02 2025
From: dholmes at openjdk.org (David Holmes)
Date: Thu, 20 Nov 2025 05:42:02 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 19 Nov 2025 22:55:34 GMT, Leonid Mesnik  wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366659: Refactored tests.
>
> Changes requested by lmesnik (Reviewer).

@lmesnik are the JVMTI thread state transitions performed in the event posting code? If so the different order, and thus different states, would be a concern. That said we have noticed that only the timeout case seems to operate in a way that the monitor reentry can post contended_enter and contended_entered events, which seems very odd in itself. Though I will also note that the way the suspension code drops and then re-acquires the monitor, any contended_enter* events could get posted multiple times which would also be surprising.

Maintaining the event order is problematic as, with the fix to the deadlock issue, we only allow suspension during reentry, and that would mean the `monitor_waited` event would be posted whilst the thread is still suspended. To be clear(er) in the old code we would do:

wait -> suspend if needed -> resumed -> post monitor_waited -> renter monitor

whereas the new code, if we kept the placement of the event,  would do

wait -> post monitor_waited -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor

and what the proposed code actually does is

wait -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor -> post monitor_waited 


Given the lack of specificity in the JVM TI spec around these different events I think any assumptions in a TCK test could be challenged, but it would still be a change in behaviour.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3555943800

From sspitsyn at openjdk.org  Thu Nov 20 07:58:01 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 07:58:01 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v2]
In-Reply-To: 
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
Message-ID: <-AtmLhh2MCQH75PIec18-BOItl1VubNNIMlaYKUGH0g=.d8dc72ff-663f-4023-876a-fd921d7972b0@github.com>

On Tue, 18 Nov 2025 21:51:26 GMT, Chris Plummer  wrote:

>> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
>> 
>> This PR focuses on purging virtual thread ThreadNodes in two places:
>> 
>> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
>> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
>> 
>> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
>> 
>> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
>> 
>> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
>> 
>> Tested by running all tier2, tier5, and tier6 CI svc tests.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   comment typo

Looks good. Posted one nit suggestion though.

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 610:

> 608:         !node->popFrameProceed &&
> 609:         !node->popFrameThread &&
> 610:         node->pendingStop == NULL)

It is tricky to verify this list of checks is complete. :)

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28211#pullrequestreview-3486187361
PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2544741007

From sspitsyn at openjdk.org  Thu Nov 20 07:58:01 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 07:58:01 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v2]
In-Reply-To: <7gBK0x7oqxFNv50kwhyx9kbGZQD6hMxsawxRJY7-h0A=.8ff3fe4c-ebc4-49be-b2dc-3c3ea63bd027@github.com>
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
 <7gBK0x7oqxFNv50kwhyx9kbGZQD6hMxsawxRJY7-h0A=.8ff3fe4c-ebc4-49be-b2dc-3c3ea63bd027@github.com>
Message-ID: <7Ccv6kwEBezTRevXJqOzFSECANVxMlW8kTv5xt3xkPA=.eae80baa-beaf-4769-b235-4e83e8a327c3@github.com>

On Tue, 18 Nov 2025 04:59:56 GMT, Chris Plummer  wrote:

>> src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 1399:
>> 
>>> 1397:     if (node == NULL) {
>>> 1398:         node = findThread(&otherThreads, thread);
>>> 1399:     }
>> 
>> Q: Could you explain a little bit why this change is needed? Do we need an update of the comment above?
>
> You need to call findRunningThread() to get the ThreadNode created if there isn't already one. findThread() does not create the ThreadNode like findRunningThread() does, so after my changes to free up ThreadNodes, findThread() was returning NULL, which causes a lot of problems here.
> 
> You then need to add the findThread(&otherThreads, thread) call because this is normally done by findThread() but is purposefully not done by findRunningThread(). otherThreads hold threads that have been created but not yet started. It's kind of rare that threads every end up on the list. It means the debugger somehow got hold of a ThreadReferences (such as through a local var) and then called a ThreadReference API with it. The usual way it works is when an event finally comes in on the thread, that is when it gets moved from otherThreads to runningThreads or runningVThreads.

Okay, thanks! It would be nice to add a short comment with a couple of sentences to explain this.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2544734427

From jsjolen at openjdk.org  Thu Nov 20 08:36:02 2025
From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=)
Date: Thu, 20 Nov 2025 08:36:02 GMT
Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v18]
In-Reply-To: 
References: 
Message-ID: 

> Hi,
> 
> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`.
> 
> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately.
> 
> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc.
> 
> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement.
> 
> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again.

Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision:

  IDE doesn't help you with VM structs!

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27198/files
  - new: https://git.openjdk.org/jdk/pull/27198/files/3686fc34..b6fe0bd7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=17
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27198&range=16-17

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27198.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27198/head:pull/27198

PR: https://git.openjdk.org/jdk/pull/27198

From aph at openjdk.org  Thu Nov 20 09:44:45 2025
From: aph at openjdk.org (Andrew Haley)
Date: Thu, 20 Nov 2025 09:44:45 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
Message-ID: 

On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken  wrote:

> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

On further consideration, I remembered that many of the helpers are debug-only, so that shouldn't be a problem. Maybe if we only do this on non-PRODUCT builds it's be OK, but it would require very careful thought and analysis.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3556915717

From aartemov at openjdk.org  Thu Nov 20 09:54:31 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 09:54:31 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v14]
In-Reply-To: 
References: 
Message-ID: 

> Hi, please consider the following changes:
> 
> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
> 
> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
> 
> This can happen in two places where the successor could be suspended: 
> 1:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
> 
> 2:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
> 
> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
> 
> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
> 
> Tests are added for both scenarios. 
> 
> Tested in tiers 1 - 7.

Anton Artemov has updated the pull request incrementally with two additional commits since the last revision:

 - 8366659: Fixed tests.
 - 8366659: Fixed tests.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27040/files
  - new: https://git.openjdk.org/jdk/pull/27040/files/08b481cd..5fe2d506

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=13
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=12-13

  Stats: 46 lines in 5 files changed: 0 ins; 12 del; 34 mod
  Patch: https://git.openjdk.org/jdk/pull/27040.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040

PR: https://git.openjdk.org/jdk/pull/27040

From aartemov at openjdk.org  Thu Nov 20 09:54:34 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 09:54:34 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 19 Nov 2025 22:55:34 GMT, Leonid Mesnik  wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366659: Refactored tests.
>
> Changes requested by lmesnik (Reviewer).

> @lmesnik are the JVMTI thread state transitions performed in the event posting code? If so the different order, and thus different states, would be a concern. That said we have noticed that only the timeout case seems to operate in a way that the monitor reentry can post contended_enter and contended_entered events, which seems very odd in itself. Though I will also note that the way the suspension code drops and then re-acquires the monitor, any contended_enter* events could get posted multiple times which would also be surprising.

I think this comment was supposed to be addressed to @sspitsyn

> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWaitWorker.java line 42:
> 
>> 40: 
>> 41:     public void run() {
>> 42:         SuspendWithObjectMonitorWait1.logDebug("thread running");
> 
> SuspendWithObjectMonitorWaitBase instead of SuspendWithObjectMonitorWait1 here.
> There are a lot such places in this file.

Thanks for spotting this! Yes, `SuspendWithObjectMonitorWaitWorker` used to live in the same file as the original test and I forgot to update the names. Fixed now.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3556945962
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2545160721

From aartemov at openjdk.org  Thu Nov 20 09:54:38 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 09:54:38 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: <0LholCkfab5s73jB3elCViYiI2xdxjvCV-qjfXz7v4c=.837deadf-cfff-4b29-97bc-f859fbf9578b@github.com>
References: 
 
 <0LholCkfab5s73jB3elCViYiI2xdxjvCV-qjfXz7v4c=.837deadf-cfff-4b29-97bc-f859fbf9578b@github.com>
Message-ID: 

On Wed, 19 Nov 2025 17:50:56 GMT, Serguei Spitsyn  wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366659: Refactored tests.
>
> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait1.java line 141:
> 
>> 139: 
>> 140: 
>> 141: 
> 
> Nit: unneeded empty lines

Addressed in the latest commit.

> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait2.java line 156:
> 
>> 154: 
>> 155: 
>> 156: 
> 
> Nit: unneeded empty lines

Addressed in the latest commit.

> test/hotspot/jtreg/serviceability/jvmti/SuspendWithObjectMonitorWait/SuspendWithObjectMonitorWait3.java line 166:
> 
>> 164: 
>> 165: 
>> 166: 
> 
> Nit: unneeded empty lines

Addressed in the latest commit.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2545178592
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2545178219
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2545178072

From aartemov at openjdk.org  Thu Nov 20 10:42:35 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 10:42:35 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v15]
In-Reply-To: 
References: 
Message-ID: 

> Hi, please consider the following changes:
> 
> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
> 
> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
> 
> This can happen in two places where the successor could be suspended: 
> 1:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
> 
> 2:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
> 
> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
> 
> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
> 
> Tests are added for both scenarios. 
> 
> Tested in tiers 1 - 7.

Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits:

 - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock
 - 8366659: Fixed tests.
 - 8366659: Fixed tests.
 - 8366659: Refactored tests.
 - 8366659: Added bool arg to notify_contended_enter
 - 8366659: Refactored the big test into 3 smaller tests.
 - 8366659: Addressed reviewer's comments.
 - 8366659: Addressed reviewer's comments.
 - 8366659: Addressed reviewer's comments.
 - Merge remote-tracking branch 'origin/master' into JDK-8366659-OM-wait-suspend-deadlock
 - ... and 21 more: https://git.openjdk.org/jdk/compare/ad38a125...9356cd9f

-------------

Changes: https://git.openjdk.org/jdk/pull/27040/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=14
  Stats: 1238 lines in 9 files changed: 803 ins; 415 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/27040.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040

PR: https://git.openjdk.org/jdk/pull/27040

From mbaesken at openjdk.org  Thu Nov 20 14:39:57 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 14:39:57 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 09:42:41 GMT, Andrew Haley  wrote:

> On further consideration, I remembered that many of the helpers are debug-only, so that shouldn't be a problem

Thanks for looking into it.  I can disable the dead_strip switch for the debug-builds, so it would not eliminate these helpers.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3558388446

From mbaesken at openjdk.org  Thu Nov 20 14:42:28 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 14:42:28 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Wed, 19 Nov 2025 18:53:34 GMT, Chris Plummer  wrote:

> This seems to work:
> 
> ```
> extern void* _ZTV8Metadata[];
> 
> __attribute__((used))
>  void* foo() {
>   return _ZTV8Metadata[0];
> }
> ```
> 
> You can put this anywhere since it does not reference any hotspot types. It just needs to be linked in with libjvm. Note I tried putting the "used" attribute on _ZTV8Metadata and getting rid of the foo() part, but I got the following warning and the vtable was dead stripped:
> 
> `warning: 'used' attribute ignored on a non-definition declaration [-Wignored-attributes]`


Thanks for the testing and providing the workaround.  Too bad   that the 'retain' and 'used' are only function attributes, this makes things a bit harder.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3558408585

From mbaesken at openjdk.org  Thu Nov 20 14:57:12 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 14:57:12 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v2]
In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
Message-ID: 

> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  _ZTV8Metadata should not be eliminated

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28319/files
  - new: https://git.openjdk.org/jdk/pull/28319/files/1c5a43f4..07251ffe

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=00-01

  Stats: 10 lines in 1 file changed: 10 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28319/head:pull/28319

PR: https://git.openjdk.org/jdk/pull/28319

From aartemov at openjdk.org  Thu Nov 20 15:17:28 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 15:17:28 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v16]
In-Reply-To: 
References: 
Message-ID: 

> Hi, please consider the following changes:
> 
> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
> 
> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
> 
> This can happen in two places where the successor could be suspended: 
> 1:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
> 
> 2:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
> 
> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
> 
> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
> 
> Tests are added for both scenarios. 
> 
> Tested in tiers 1 - 7.

Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:

  8366659: Refactoring.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27040/files
  - new: https://git.openjdk.org/jdk/pull/27040/files/9356cd9f..301999cb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=15
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=14-15

  Stats: 74 lines in 6 files changed: 41 ins; 28 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/27040.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040

PR: https://git.openjdk.org/jdk/pull/27040

From aartemov at openjdk.org  Thu Nov 20 15:31:10 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 15:31:10 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
Message-ID: 

> Hi, please consider the following changes:
> 
> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
> 
> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
> 
> This can happen in two places where the successor could be suspended: 
> 1:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
> 
> 2:
> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
> 
> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
> 
> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
> 
> Tests are added for both scenarios. 
> 
> Tested in tiers 1 - 7.

Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:

  8366659: Fixed whitespace error.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27040/files
  - new: https://git.openjdk.org/jdk/pull/27040/files/301999cb..322fc0e5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=16
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27040&range=15-16

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/27040.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27040/head:pull/27040

PR: https://git.openjdk.org/jdk/pull/27040

From aartemov at openjdk.org  Thu Nov 20 15:31:11 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Thu, 20 Nov 2025 15:31:11 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
 
 
Message-ID: <_-5I-bhvp2aJb6ki9uBaAjYYRBi6EKQVrD4QQHj4Mv4=.8f3da38f-5397-4c86-ad1d-c9bd65b677ed@github.com>

On Thu, 20 Nov 2025 05:38:21 GMT, David Holmes  wrote:

> Maintaining the event order is problematic as, with the fix to the deadlock issue, we only allow suspension during reentry, and that would mean the `monitor_waited` event would be posted whilst the thread is still suspended. To be clear(er) in the old code we would do:
> 
> ```
> wait -> suspend if needed -> resumed -> post monitor_waited -> renter monitor
> ```
> 
> whereas the new code, if we kept the placement of the event, would do
> 
> ```
> wait -> post monitor_waited -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor
> ```
> 
> and what the proposed code actually does is
> 
> ```
> wait -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor -> post monitor_waited 
> ```
> 
> Given the lack of specificity in the JVM TI spec around these different events I think any assumptions in a TCK test could be challenged, but it would still be a change in behaviour.

@dholmes-ora I have done a bit of refactoring and introduced a private method `post_waited_event()`, which we can call in different places depending on the scenario. 

For instance, for the timed-out case, the sequence of events is now unchanged, i.e.:
`wait -> waited -> contended enter -> contended entered`

For notified case, using your extended notation, it is now behaving like this: 
`wait  -> reenter monitor -> suspend if needed and drop monitor -> resumed -> post monitor_waited -> reenter monitor`

I think this is what we eventually want. @sspitsyn could you confirm/refute that it does not change thread state bits? 
The JVMTI tests pass, the extended testing is in progress.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3558649501

From aph at openjdk.org  Thu Nov 20 15:54:55 2025
From: aph at openjdk.org (Andrew Haley)
Date: Thu, 20 Nov 2025 15:54:55 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
 
Message-ID: 

On Thu, 20 Nov 2025 14:36:31 GMT, Matthias Baesken  wrote:

> > On further consideration, I remembered that many of the helpers are debug-only, so that shouldn't be a problem
> 
> Thanks for looking into it. I can disable the dead_strip switch for the debug-builds, so it would not eliminate these helpers.

Right, but we'll need to make sure we don't remove the non-debug ones. We don't want to exclude stuff in `src/hotspot/share/utilities/debug.cpp` or explicit helpers in the back ends.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3558785722

From mbaesken at openjdk.org  Thu Nov 20 16:00:30 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 16:00:30 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v3]
In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
Message-ID: 

> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  Fix Windows issues

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28319/files
  - new: https://git.openjdk.org/jdk/pull/28319/files/07251ffe..b41966b8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=01-02

  Stats: 4 lines in 1 file changed: 2 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28319/head:pull/28319

PR: https://git.openjdk.org/jdk/pull/28319

From macarte at openjdk.org  Thu Nov 20 16:00:52 2025
From: macarte at openjdk.org (Mat Carter)
Date: Thu, 20 Nov 2025 16:00:52 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v4]
In-Reply-To: 
References: 
Message-ID: 

> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The command will report back to the user one of the following messages depending on the state of the JVM:
> 
> - Error! Not a recording run
> - Error! Not recording
> - Recording ended successfully
> - Error! Failed to end recording
> 
> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
> 
> - Recording ended successfully
> - Error! Not recording
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:

 - Merge branch 'master' into JDK-8370203
 - Updates based on feedback.  Method name changes; clearer output; commnets on implemenation; remove redundant logic
 - Document use of DiagnosticCommand
 - Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording
 - Switched line endings to unix style LF
 - Removed timing functionality as it's not needed yet
 - Sort headers correctly
 - 8370203 - Adding JCmd AOT.end_recording

-------------

Changes: https://git.openjdk.org/jdk/pull/27965/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=03
  Stats: 288 lines in 6 files changed: 288 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/27965.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965

PR: https://git.openjdk.org/jdk/pull/27965

From macarte at openjdk.org  Thu Nov 20 16:22:29 2025
From: macarte at openjdk.org (Mat Carter)
Date: Thu, 20 Nov 2025 16:22:29 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
Message-ID: 

> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The command will report back to the user one of the following messages depending on the state of the JVM:
> 
> - Error! Not a recording run
> - Error! Not recording
> - Recording ended successfully
> - Error! Failed to end recording
> 
> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
> 
> - Recording ended successfully
> - Error! Not recording
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request incrementally with two additional commits since the last revision:

 - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
 - Corrected placement of assert and logic test

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27965/files
  - new: https://git.openjdk.org/jdk/pull/27965/files/0ac132b6..f1f5d77d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=03-04

  Stats: 11 lines in 1 file changed: 1 ins; 2 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/27965.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965

PR: https://git.openjdk.org/jdk/pull/27965

From mbaesken at openjdk.org  Thu Nov 20 16:31:25 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 16:31:25 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v3]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 16:00:30 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix Windows issues

Interestingly,  we seem to rely already on the 'used' attribute in the OpenJDK codebase at some places, see
https://github.com/search?q=repo%3Aopenjdk%2Fjdk%20ATTRIBUTE_USED&type=code

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3558965415

From macarte at openjdk.org  Thu Nov 20 16:33:41 2025
From: macarte at openjdk.org (Mat Carter)
Date: Thu, 20 Nov 2025 16:33:41 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 14 Nov 2025 12:58:33 GMT, Kevin Walls  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Document use of DiagnosticCommand
>
> src/hotspot/share/services/diagnosticCommand.cpp line 991:
> 
>> 989: }
>> 990: 
>> 991: #if INCLUDE_CDS
> 
> A simple style nit-pick:  Error!
> The JVM doesn't really dramatize problems like that.  It tells you there was an error, and calmly describes the problem after a colon. "Error: " 8-)
> 
> (There are some "Error!" exclamations in java.xml and one has got into jdk.jfr, but they are unusual.)
> 
> You can tell me that nit-picking is NOT hyphenated if you like.

Thank you, we've removed the "!" from "Error: Failed to end recording" and also removed the "Error! " prefix from the other outputs that weren't internal errors

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2546768475

From mbaesken at openjdk.org  Thu Nov 20 16:44:08 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Thu, 20 Nov 2025 16:44:08 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v3]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 16:00:30 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix Windows issues

For the Apple linker there seem to be also a way to mark some sections with `S_ATTR_NO_DEAD_STRIP` to avoid the dead strip operation
https://maskray.me/blog/2021-02-28-linker-garbage-collection
'Sections with the S_ATTR_NO_DEAD_STRIP flag'
But I am not sure how to do this in the HS code directly.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3559017189

From cjplummer at openjdk.org  Thu Nov 20 17:23:47 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 20 Nov 2025 17:23:47 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
 
 
Message-ID: 

On Thu, 20 Nov 2025 15:51:55 GMT, Andrew Haley  wrote:

> > > On further consideration, I remembered that many of the helpers are debug-only, so that shouldn't be a problem
> > 
> > 
> > Thanks for looking into it. I can disable the dead_strip switch for the debug-builds, so it would not eliminate these helpers.
> 
> Right, but we'll need to make sure we don't remove the non-debug ones. We don't want to exclude stuff in `src/hotspot/share/utilities/debug.cpp` or explicit helpers in the back ends.

Most of the debug.cpp helpers are in product builds now. I think only pns() and pns2() are left out of product builds.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3559202033

From kvn at openjdk.org  Thu Nov 20 19:49:03 2025
From: kvn at openjdk.org (Vladimir Kozlov)
Date: Thu, 20 Nov 2025 19:49:03 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
Message-ID: <74lT8czpnsYK5yL46LqHFZFq7HCaJRtOb_lplgxkaPc=.8305a9e3-8125-4922-b7b5-3c112452516f@github.com>

On Thu, 20 Nov 2025 16:22:29 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>  - Corrected placement of assert and logic test

Looks like you merged your other Mbeans PR changes into this. Which is wrong.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3559758757

From cjplummer at openjdk.org  Thu Nov 20 20:00:14 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 20 Nov 2025 20:00:14 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v2]
In-Reply-To: <-AtmLhh2MCQH75PIec18-BOItl1VubNNIMlaYKUGH0g=.d8dc72ff-663f-4023-876a-fd921d7972b0@github.com>
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
 <-AtmLhh2MCQH75PIec18-BOItl1VubNNIMlaYKUGH0g=.d8dc72ff-663f-4023-876a-fd921d7972b0@github.com>
Message-ID: <6h_-TMFn8OgiAKud9ON7bt1HxJa3TtG7ml0xe0qa_Tc=.c24b5511-417c-48e8-bb47-98bc8780fef7@github.com>

On Thu, 20 Nov 2025 07:55:08 GMT, Serguei Spitsyn  wrote:

> It is tricky to verify this list of checks is complete. :)

Yes. I did an audit of all the fields. Combined with the testing, I'm pretty certain this is accurate. Eventually I'll be calling this code from more places to be even more aggressive about disposing of ThreadNodes, so that will also help uncover bugs here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2547495170

From cjplummer at openjdk.org  Thu Nov 20 20:12:11 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 20 Nov 2025 20:12:11 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v3]
In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
Message-ID: 

> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
> 
> This PR focuses on purging virtual thread ThreadNodes in two places:
> 
> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
> 
> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
> 
> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
> 
> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
> 
> Tested by running all tier2, tier5, and tier6 CI svc tests.

Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:

  improve comment

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28211/files
  - new: https://git.openjdk.org/jdk/pull/28211/files/49a358c5..8d397580

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=01-02

  Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28211.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28211/head:pull/28211

PR: https://git.openjdk.org/jdk/pull/28211

From cjplummer at openjdk.org  Thu Nov 20 20:22:06 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 20 Nov 2025 20:22:06 GMT
Subject: RFR: 8372294: Fix Malformed problem list entry in
 ProblemList-jvmti-stress-agent.txt
Message-ID: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>

ProblemList-jvmti-stress-agent.txt fails to pass verification because it uses a tab character instead of spaces. 

I'd like to push this as a trivial change.

-------------

Commit messages:
 - get rid of tab char

Changes: https://git.openjdk.org/jdk/pull/28441/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28441&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372294
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28441.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28441/head:pull/28441

PR: https://git.openjdk.org/jdk/pull/28441

From pchilanomate at openjdk.org  Thu Nov 20 20:52:05 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Thu, 20 Nov 2025 20:52:05 GMT
Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes
 without JVMTI agent [v3]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable tra
 nsitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and unm...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  Add Alan's comment in VirtualThread

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/976486cd..205ae77b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=01-02

  Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Thu Nov 20 20:55:22 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Thu, 20 Nov 2025 20:55:22 GMT
Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes
 without JVMTI agent [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 19 Nov 2025 19:03:13 GMT, Patricio Chilano Mateo  wrote:

>> src/java.base/share/classes/java/lang/VirtualThread.java line 1390:
>> 
>>> 1388:     }
>>> 1389: 
>>> 1390:     // -- JVM TI support --
>> 
>> We'll need to update is comment as it no longer only for JVMTI. 
>> 
>> This might be a good place for a block comment to define "transitions" covering the changing of thread identity the continuation mount/unmount, and how the notification to the VM support JVMTI and handshakes.  Maybe I could contribute a block comment to include here?
>
> That would be great.

Thanks, added the suggested comment.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547640337

From macarte at openjdk.org  Thu Nov 20 22:11:20 2025
From: macarte at openjdk.org (Mat Carter)
Date: Thu, 20 Nov 2025 22:11:20 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: <74lT8czpnsYK5yL46LqHFZFq7HCaJRtOb_lplgxkaPc=.8305a9e3-8125-4922-b7b5-3c112452516f@github.com>
References: 
 
 <74lT8czpnsYK5yL46LqHFZFq7HCaJRtOb_lplgxkaPc=.8305a9e3-8125-4922-b7b5-3c112452516f@github.com>
Message-ID: 

On Thu, 20 Nov 2025 19:45:22 GMT, Vladimir Kozlov  wrote:

> Looks like you merged your other Mbeans PR changes into this. Which is wrong.

I resolved a conflict with Ioi's change from yesterday, but I don't see any HotSpotAOTCacheMXBean code.  Is there a specific commit you can reference?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3560266811

From dholmes at openjdk.org  Thu Nov 20 22:16:18 2025
From: dholmes at openjdk.org (David Holmes)
Date: Thu, 20 Nov 2025 22:16:18 GMT
Subject: RFR: 8364343: ThreadSnapshotFactory::get_thread_snapshot() crashes
 without JVMTI agent [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 20:52:05 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add Alan's comment in VirtualThread

As this involves a fairly significant design change I suggest updating the JBS issue to have a more informative title e.g. "Virtual Thread transition management needs to be independent of JVM TI"

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28361#issuecomment-3560304232

From pchilanomate at openjdk.org  Thu Nov 20 23:10:48 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Thu, 20 Nov 2025 23:10:48 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  Rename VM methods for endFirstTransition/startFinalTransition

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/205ae77b..10534b33

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=02-03

  Stats: 20 lines in 8 files changed: 0 ins; 0 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Thu Nov 20 23:10:49 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Thu, 20 Nov 2025 23:10:49 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 20 Nov 2025 22:14:15 GMT, David Holmes  wrote:

> As this involves a fairly significant design change I suggest updating the JBS issue to have a more informative title e.g. "Virtual Thread transition management needs to be independent of JVM TI"
>
Yes, that's better. Updated.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28361#issuecomment-3560533185

From pchilanomate at openjdk.org  Thu Nov 20 23:10:52 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Thu, 20 Nov 2025 23:10:52 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 19 Nov 2025 19:01:18 GMT, Patricio Chilano Mateo  wrote:

>> src/java.base/share/native/libjava/VirtualThread.c line 38:
>> 
>>> 36:     { "startFinalTransition",     "()V",  (void *)&JVM_VirtualThreadEnd },
>>> 37:     { "startTransition",          "(Z)V", (void *)&JVM_VirtualThreadStartTransition },
>>> 38:     { "endTransition",            "(Z)V", (void *)&JVM_VirtualThreadEndTransition },
>> 
>> I wonder if JVM_VirtualThreadStart and JVM_VirtualThreadEnd should be renamed to have EndFirstTransition and StartFinalTransaction in the names so it's easy to follow through from the Java code down to MountUnmountDisabler::start_transition/end_transition.
>
> How about removing these methods and just have an extra boolean parameter in `start/endTransition`?
> https://github.com/pchilano/jdk/compare/JDK-8364343...pchilano:jdk:startEndTransitionsOnly

I renamed the methods as suggested. I remembered that we separated ThreadStart/ThreadEnd in 8306028 for future improvements related to JVMTI. Not sure if that?s still relevant but in any case probably better to leave that discussion for a separate bug.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547987864

From sspitsyn at openjdk.org  Thu Nov 20 23:12:18 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 23:12:18 GMT
Subject: RFR: 8372294: Fix Malformed problem list entry in
 ProblemList-jvmti-stress-agent.txt
In-Reply-To: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
References: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
Message-ID: 

On Thu, 20 Nov 2025 20:14:10 GMT, Chris Plummer  wrote:

> ProblemList-jvmti-stress-agent.txt fails to pass verification because it uses a tab character instead of spaces. 
> 
> I'd like to push this as a trivial change.

Good and trivial.

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28441#pullrequestreview-3490456587

From sspitsyn at openjdk.org  Thu Nov 20 23:17:36 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 23:17:36 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v3]
In-Reply-To: 
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 20:12:11 GMT, Chris Plummer  wrote:

>> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
>> 
>> This PR focuses on purging virtual thread ThreadNodes in two places:
>> 
>> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
>> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
>> 
>> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
>> 
>> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
>> 
>> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
>> 
>> Tested by running all tier2, tier5, and tier6 CI svc tests.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   improve comment

Still looks good. Thank you for updating comments.

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28211#pullrequestreview-3490477704

From kvn at openjdk.org  Thu Nov 20 23:31:19 2025
From: kvn at openjdk.org (Vladimir Kozlov)
Date: Thu, 20 Nov 2025 23:31:19 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 16:22:29 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>  - Corrected placement of assert and logic test

I was confused by this Github warning "This pull request contains merges that bring in commits not present in the target repository. "

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3560622271

From vlivanov at openjdk.org  Thu Nov 20 23:36:43 2025
From: vlivanov at openjdk.org (Vladimir Ivanov)
Date: Thu, 20 Nov 2025 23:36:43 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v3]
In-Reply-To: 
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
 
Message-ID: <_C1_-yzeixcKbR2NfmnM4MEl3InsR6cTTzmoT-vMSBY=.032aae46-e951-4c76-91e6-fc7a8fe8b73c@github.com>

On Wed, 19 Nov 2025 12:34:30 GMT, Coleen Phillimore  wrote:

>> ArrayKlass doesn't set AccessFlags so don't look for them there.  See CR for details.
>> Fixed SA and jvmci.  @iwanowww Can you check that I changed C2 correctly (we talked about this in August).
>> Tested with tier1-4.  5-7 in progress.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert a couple more InstanceKlass::casts also to get GHA to restart.

src/hotspot/share/opto/compile.cpp line 1729:

> 1727:       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
> 1728:         alias_type(idx)->set_rewritable(false);
> 1729:       if (flat->isa_instklassptr() && flat->offset() == in_bytes(InstanceKlass::access_flags_offset()))

I'd place the check separately. Otherwise, looks good. 

diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
index 6babc13e1b3..9215c0fc03f 100644
--- a/src/hotspot/share/opto/compile.cpp
+++ b/src/hotspot/share/opto/compile.cpp
@@ -1726,8 +1726,6 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
       }
       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
         alias_type(idx)->set_rewritable(false);
-      if (flat->offset() == in_bytes(Klass::access_flags_offset()))
-        alias_type(idx)->set_rewritable(false);
       if (flat->offset() == in_bytes(Klass::misc_flags_offset()))
         alias_type(idx)->set_rewritable(false);
       if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
@@ -1735,6 +1733,11 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
       if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
         alias_type(idx)->set_rewritable(false);
     }
+    if (flat->isa_instklassptr()) {
+      if (flat->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
+        alias_type(idx)->set_rewritable(false);
+      }
+    }
     // %%% (We would like to finalize JavaThread::threadObj_offset(),
     // but the base pointer type is not distinctive enough to identify
     // references into JavaThread.)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2548046511

From kvn at openjdk.org  Thu Nov 20 23:43:58 2025
From: kvn at openjdk.org (Vladimir Kozlov)
Date: Thu, 20 Nov 2025 23:43:58 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 16:22:29 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>  - Corrected placement of assert and logic test

Looks good now.

`KAT9180` is not related to your changes. It is new test added today.

-------------

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27965#pullrequestreview-3490547075
PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3560659510

From duke at openjdk.org  Thu Nov 20 23:56:48 2025
From: duke at openjdk.org (Ruben)
Date: Thu, 20 Nov 2025 23:56:48 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v4]
In-Reply-To: 
References: 
Message-ID: 

> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
> 
> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
> 
> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.

Ruben has updated the pull request incrementally with one additional commit since the last revision:

  Refine `first_check_size` definitions

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28192/files
  - new: https://git.openjdk.org/jdk/pull/28192/files/3a014376..00ea0e14

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28192&range=02-03

  Stats: 5 lines in 5 files changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/28192.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28192/head:pull/28192

PR: https://git.openjdk.org/jdk/pull/28192

From sspitsyn at openjdk.org  Thu Nov 20 23:58:41 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Thu, 20 Nov 2025 23:58:41 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Thu, 20 Nov 2025 05:38:21 GMT, David Holmes  wrote:

>> Changes requested by lmesnik (Reviewer).
>
> @lmesnik are the JVMTI thread state transitions performed in the event posting code? If so the different order, and thus different states, would be a concern. That said we have noticed that only the timeout case seems to operate in a way that the monitor reentry can post contended_enter and contended_entered events, which seems very odd in itself. Though I will also note that the way the suspension code drops and then re-acquires the monitor, any contended_enter* events could get posted multiple times which would also be surprising.
> 
> Maintaining the event order is problematic as, with the fix to the deadlock issue, we only allow suspension during reentry, and that would mean the `monitor_waited` event would be posted whilst the thread is still suspended. To be clear(er) in the old code we would do:
> 
> wait -> suspend if needed -> resumed -> post monitor_waited -> renter monitor
> 
> whereas the new code, if we kept the placement of the event,  would do
> 
> wait -> post monitor_waited -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor
> 
> and what the proposed code actually does is
> 
> wait -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor -> post monitor_waited 
> 
> 
> Given the lack of specificity in the JVM TI spec around these different events I think any assumptions in a TCK test could be challenged, but it would still be a change in behaviour.

@dholmes-ora David, thank you for your input!

> @dholmes-ora I have done a bit of refactoring and introduced a private method post_waited_event(), which we can call in different places depending on the scenario.

I like the refactoring.

> For instance, for the timed-out case, the sequence of events is now unchanged, i.e.:
> `wait -> waited -> contended enter -> contended entered`
> 
> For the notified case, using your extended notation, it is now behaving like this:
> `wait  -> reenter monitor -> suspend if needed and drop monitor -> resumed -> post monitor_waited -> reenter monitor`

My understanding is that we need both timed-out and notified cases to do the same as David suggested above:
  `wait -> post monitor_waited -> reenter monitor -> suspend if needed and drop monitor -> resumed -> reenter monitor`
It would give us two advantages:
 - timed-out and notified cases are unified
 - avoid incompatibility risk, e.g.:
   - no new combinations of JVMTI thread state bits are introduced
   - the object monitor events order is kept same as was before (is it true?)

Is there a problem to make it unified?

> I think this is what we eventually want. @sspitsyn could you confirm/refute that it does not change thread state bits?

As I see, this still introduces new combinations of thread state bits for the notified case.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3560695036

From duke at openjdk.org  Fri Nov 21 00:02:37 2025
From: duke at openjdk.org (Ruben)
Date: Fri, 21 Nov 2025 00:02:37 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2
In-Reply-To: 
References: 
 <-h6G9ajUWQwDRcUMOtyI_YCUCkXz3pzRggJk_UaxM-0=.a8c772aa-2f09-48c0-9cfb-17e624393eb0@github.com>
 
 
Message-ID: 

On Wed, 19 Nov 2025 04:28:04 GMT, Dean Long  wrote:

>>> However, I still have not identified a way to ensure the deopt handler stub ends at a page boundary in a unit test.
>> 
>> The latest update implements an alternative way to detect the failure early during testing - via the newly added assertion in the `emit_deopt_handler`.
>> 
>> @adinn, @dean-long, @TheRealMDoerr, would it be possible for you to review the latest version of the PR?
>> 
>> Is there any additional testing you would recommend to perform before this can be integrated?
>
>> Is there any additional testing you would recommend to perform before this can be integrated?
> 
> Oracle likes to make sure the final version passes in our CI.  I got burned last time testing an earlier version and not the final version.

Thank you for the reviews, @dean-long, @adinn, @TheRealMDoerr.
@dean-long, I've updated the patch according to your suggestions - also applied the same to other `nativeInst_*` files except `nativeInst_x86.hpp` as the instruction size is not fixed in this case.

> the final version passes in our CI

If this version of the patch looks suitable, would it be possible to start the CI testing please?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3560702086

From sspitsyn at openjdk.org  Fri Nov 21 00:25:04 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 00:25:04 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v13]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 19 Nov 2025 22:55:34 GMT, Leonid Mesnik  wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366659: Refactored tests.
>
> Changes requested by lmesnik (Reviewer).

> @lmesnik are the JVMTI thread state transitions performed in the event posting code? If so the different order, and thus different states, would be a concern.

Yes, JVMTI event posting code performs thread state transitions. But I was talking about the JVMTI thread state bits specified here: https://docs.oracle.com/en/java/javase/25/docs/specs/jvmti.html#GetThreadState

> That said we have noticed that only the timeout case seems to operate in a way that the monitor reentry can post contended_enter and contended_entered events, which seems very odd in itself.

Right. We have this oddity.

> Though I will also note that the way the suspension code drops and then re-acquires the monitor, any contended_enter* events could get posted multiple times which would also be surprising.

Right. There have to be some ways to fix it. Most likely we already have a bug against this issue.


> Maintaining the event order is problematic as, with the fix to the deadlock issue, we only allow suspension during reentry, and that would mean the monitor_waited event would be posted whilst the thread is still suspended.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3560750605

From kvn at openjdk.org  Fri Nov 21 00:50:23 2025
From: kvn at openjdk.org (Vladimir Kozlov)
Date: Fri, 21 Nov 2025 00:50:23 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
Message-ID: <0sF4opLAcZ44ZcCa2Kj5pn88ytM7OasvOMHs3LDvwY8=.839b8cf8-c63d-40f1-a660-a938e0d919e0@github.com>

On Thu, 20 Nov 2025 23:40:33 GMT, Vladimir Kozlov  wrote:

> `KAT9180` is not related to your changes. It is new test added today.

I mean `KAT9180` test failure in GHA is not related to your changes.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3560825050

From dholmes at openjdk.org  Fri Nov 21 01:00:58 2025
From: dholmes at openjdk.org (David Holmes)
Date: Fri, 21 Nov 2025 01:00:58 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:10:48 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename VM methods for endFirstTransition/startFinalTransition

Hi Patricio, this is another significant piece of work. I have taken an initial pass through trying to digest the main parts - can't comment on the C2 code or the Java side. I have made a few minor comments/suggestions.

Thanks

src/hotspot/share/prims/jvm.cpp line 3668:

> 3666:   if (!DoJVMTIVirtualThreadTransitions) {
> 3667:     assert(!JvmtiExport::can_support_virtual_threads(), "sanity check");
> 3668:     return;

Does this not still need checking somewhere?

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 162:

> 160:   // be executed once we go back to Java. If this is an unmount, the handshake that the
> 161:   // disabler executed against this carrier thread already provided the needed synchronization.
> 162:   // This matches the release fence in xx_enable_for_one()/xx_enable_for_all().

Subtle. Do we have comments where the fences are to ensure people realize the fence is serving this purpose?

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 277:

> 275: 
> 276:   // Start of the critical region. Prevent future memory
> 277:   // operations to be ordered before we read the transition flag.

Does this refer to `java_lang_Thread::is_in_VTMS_transition(_vthread())`? If so perhaps that should internally perform the `load_acquire`?

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 278:

> 276:   // Start of the critical region. Prevent future memory
> 277:   // operations to be ordered before we read the transition flag.
> 278:   // This matches the release fence in end_transition().

Suggestion:

  // This pairs with the release fence in end_transition().

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 307:

> 305:   // Block while some mount/unmount transitions are in progress.
> 306:   // Debug version fails and prints diagnostic information.
> 307:   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {

This looks very odd, having an assignment in the loop condition check and no actual loop-update expression.

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 316:

> 314:   // operations to be ordered before we read the transition flags.
> 315:   // This matches the release fence in end_transition().
> 316:   OrderAccess::acquire();

Surely the use of the iterator already provides the necessary ordering guarantee here as well. ?

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 327:

> 325:   // End of the critical section. Prevent previous memory operations to
> 326:   // be ordered after we clear the clear the disable transition flag.
> 327:   // This matches the equivalent acquire fence in start_transition().

Suggestion:

  // This pairs with the acquire in start_transition().

I just realized you are using "fence" to describe release and acquire memory barrier semantics. Given we have an operation `fence` I find this confusing for the reader - especially when we also have a `release_store_fence` operation which might be confused with "release fence".

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 370:

> 368:   assert(VTMSTransition_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint(), "Must be locked");
> 369:   assert(_global_start_transition_disable_count >= 0, "");
> 370:   AtomicAccess::store(&_global_start_transition_disable_count, _global_start_transition_disable_count + 1);

Suggestion:

  AtomicAccess::inc(&_global_start_transition_disable_count);

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 376:

> 374:   assert(VTMSTransition_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint(), "Must be locked");
> 375:   assert(_global_start_transition_disable_count > 0, "");
> 376:   AtomicAccess::store(&_global_start_transition_disable_count, _global_start_transition_disable_count - 1);

Suggestion:

  AtomicAccess::dec(&_global_start_transition_disable_count);

src/hotspot/share/runtime/mountUnmountDisabler.hpp line 52:

> 50:   // parameter is_SR: suspender or resumer
> 51:   MountUnmountDisabler(bool exlusive = false);
> 52:   MountUnmountDisabler(oop thread_oop);

What does the comment mean here?

-------------

PR Review: https://git.openjdk.org/jdk/pull/28361#pullrequestreview-3490207826
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547887801
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548145054
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548157390
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548150552
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548160373
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548161340
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548168223
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548169846
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548170787
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548174392

From dholmes at openjdk.org  Fri Nov 21 01:01:00 2025
From: dholmes at openjdk.org (David Holmes)
Date: Fri, 21 Nov 2025 01:01:00 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 20:52:05 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add Alan's comment in VirtualThread

src/hotspot/share/classfile/javaClasses.cpp line 1757:

> 1755:   jint* addr = java_thread->field_addr(_VTMS_transition_disable_count_offset);
> 1756:   int val = AtomicAccess::load(addr);
> 1757:   AtomicAccess::store(addr, val + 1);

Suggestion:

  AtomicAccess::inc(addr);

src/hotspot/share/classfile/javaClasses.cpp line 1764:

> 1762:   jint* addr = java_thread->field_addr(_VTMS_transition_disable_count_offset);
> 1763:   int val = AtomicAccess::load(addr);
> 1764:   AtomicAccess::store(addr, val - 1);

Suggestion:

  AtomicAccess::dec(addr);

src/hotspot/share/opto/runtime.hpp line 740:

> 738:     return vthread_transition_Type();
> 739:   }
> 740: 

I do not know C2 but this looks really strange - 4 different functions all return the same thing. ???

src/hotspot/share/runtime/handshake.cpp line 374:

> 372:     JavaThread* target = java_lang_Thread::thread(carrier_thread);
> 373:     assert(target != nullptr, "");
> 374:     // Technically there is need for a ThreadsListHandle since the target

Suggestion:

    // Technically there is no need for a ThreadsListHandle since the target

?

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 147:

> 145:       MonitorLocker ml(VTMSTransition_lock);
> 146:       while (is_start_transition_disabled(current, vth())) {
> 147:         ml.wait(200);

I see a lot of timed-waits throughout this code. Is that because we poll rather than synchronizing properly? All this potential busy-waiting is surely going to cause performance glitches.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547864726
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547863852
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547884313
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547900707
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2547963241

From lmesnik at openjdk.org  Fri Nov 21 00:59:52 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Fri, 21 Nov 2025 00:59:52 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 16:22:29 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>  - Corrected placement of assert and logic test

Changes requested by lmesnik (Reviewer).

src/hotspot/share/cds/aotMetaspace.cpp line 1062:

> 1060: bool AOTMetaspace::preimage_static_archive_dumped() {
> 1061:   assert(CDSConfig::is_dumping_preimage_static_archive(), "Required");
> 1062:   return _preimage_static_archive_dumped == 1;

Should it be  AtomicAccess::load(&_preimage_static_archive_dumped) here?

test/hotspot/jtreg/runtime/cds/appcds/aotCache/DiagnosticCommandMBeanTest.java line 98:

> 96:                     out.shouldContain("Failed to stop recording");
> 97:                 }
> 98:                 out.shouldNotContain("IOException occurred!");

The 'IOException occurred!' is never printed. While there are a lot of other exception print and not checked.

Also makes sense to check exit status.

test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 31:

> 29:  * @summary Sanity test for Jcmd AOT.end_recording command
> 30:  * @library /test/lib
> 31:  * @build JcmdAOTEndRecordingTest

No need to build test explicitly, jtreg does it by itself.

test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 57:

> 55:             try {
> 56:                 OutputAnalyzer output = ProcessTools.executeProcess(jcmd.getCommand());
> 57:                 output.shouldContain("AOT.end_recording is unsupported");

A little bit confused.  The check doesn't match test description.

-------------

PR Review: https://git.openjdk.org/jdk/pull/27965#pullrequestreview-3490649441
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2548182449
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2548168094
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2548140140
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2548148536

From dholmes at openjdk.org  Fri Nov 21 01:04:59 2025
From: dholmes at openjdk.org (David Holmes)
Date: Fri, 21 Nov 2025 01:04:59 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:35:38 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename VM methods for endFirstTransition/startFinalTransition
>
> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 162:
> 
>> 160:   // be executed once we go back to Java. If this is an unmount, the handshake that the
>> 161:   // disabler executed against this carrier thread already provided the needed synchronization.
>> 162:   // This matches the release fence in xx_enable_for_one()/xx_enable_for_all().
> 
> Subtle. Do we have comments where the fences are to ensure people realize the fence is serving this purpose?

I also forgot to suggest a wording change: say "pairs with" rather than "matches". Reading back through I realize now I have misunderstood many of these comments.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2548189421

From dholmes at openjdk.org  Fri Nov 21 01:26:21 2025
From: dholmes at openjdk.org (David Holmes)
Date: Fri, 21 Nov 2025 01:26:21 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:10:48 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename VM methods for endFirstTransition/startFinalTransition

> we follow the classic Dekker pattern for the required synchronization. 

My understanding is that Dekker requires a "full fence" between the accesses, not just ordering memory barriers.  The two variables involved must be published to all readers for the algorithm to work.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28361#issuecomment-3560918527

From amenkov at openjdk.org  Fri Nov 21 02:29:26 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Fri, 21 Nov 2025 02:29:26 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v3]
In-Reply-To: 
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 20:12:11 GMT, Chris Plummer  wrote:

>> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
>> 
>> This PR focuses on purging virtual thread ThreadNodes in two places:
>> 
>> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
>> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
>> 
>> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
>> 
>> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
>> 
>> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
>> 
>> Tested by running all tier2, tier5, and tier6 CI svc tests.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   improve comment

Looks good to me.
Added some minor notes

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 582:

> 580:         /*
> 581:          * Although at first it might seem that a non-zero suspendCount would require
> 582:          * keeping the node, we don't have too if node->suspendCount == suspendAllCount,

Suggestion:

         * keeping the node, we don't have to if node->suspendCount == suspendAllCount,

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 592:

> 590:     }
> 591: 
> 592:     // All of the following conditions must pass if we are to free this node. Note

Suggestion:

    // All of the following conditions must be met to free this node. Note

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 628:

> 626: 
> 627:     ThreadList *list = &runningVThreads;
> 628:     ThreadNode *node = list->first;

Suggestion:

    ThreadNode *node = runningVThreads.first;

-------------

PR Review: https://git.openjdk.org/jdk/pull/28211#pullrequestreview-3490828800
PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2548270211
PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2548280293
PR Review Comment: https://git.openjdk.org/jdk/pull/28211#discussion_r2548283759

From lmesnik at openjdk.org  Fri Nov 21 03:12:45 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Fri, 21 Nov 2025 03:12:45 GMT
Subject: RFR: 8372294: Fix Malformed problem list entry in
 ProblemList-jvmti-stress-agent.txt
In-Reply-To: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
References: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
Message-ID: 

On Thu, 20 Nov 2025 20:14:10 GMT, Chris Plummer  wrote:

> ProblemList-jvmti-stress-agent.txt fails to pass verification because it uses a tab character instead of spaces. 
> 
> I'd like to push this as a trivial change.

Marked as reviewed by lmesnik (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28441#pullrequestreview-3491010790

From cjplummer at openjdk.org  Fri Nov 21 06:31:56 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Fri, 21 Nov 2025 06:31:56 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v4]
In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
Message-ID: 

> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
> 
> This PR focuses on purging virtual thread ThreadNodes in two places:
> 
> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
> 
> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
> 
> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
> 
> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
> 
> Tested by running all tier2, tier5, and tier6 CI svc tests.

Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:

  fix comments. use runningVThreads.first

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28211/files
  - new: https://git.openjdk.org/jdk/pull/28211/files/8d397580..072e7720

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28211&range=02-03

  Stats: 6 lines in 1 file changed: 0 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/28211.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28211/head:pull/28211

PR: https://git.openjdk.org/jdk/pull/28211

From sspitsyn at openjdk.org  Fri Nov 21 07:29:44 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 07:29:44 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
 
Message-ID: <0Q_8lJFi3PoCAyh_JkV0qnTox-2Z8qajHHUQHUjyJ7k=.ede07dbf-498e-4ff4-981a-7cd636d1e9a8@github.com>

On Thu, 20 Nov 2025 15:31:10 GMT, Anton Artemov  wrote:

>> Hi, please consider the following changes:
>> 
>> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
>> 
>> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
>> 
>> This can happen in two places where the successor could be suspended: 
>> 1:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
>> 
>> 2:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
>> 
>> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
>> 
>> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
>> 
>> Tests are added for both scenarios. 
>> 
>> Tested in tiers 1 - 7.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8366659: Fixed whitespace error.

I'm reading this bug description in JBS:

> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible in two cases:
> 
> 1) The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and then exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
> 
> 2) The race between suspension and retry: the thread could reacquire the OM and complete the wait() code in full, but then on return to Java it will be suspended while holding the OM.

I'm not sure the described scenarios above are real deadlocks. The debugger has to be careful with threads suspension and can behave differently. For instance, it can suspend all threads, so no thread can progress with entering OM's. We do not consider it to be a deadlock, right?
In a case just a single thread is being suspended by the debugger, other threads can depend on the suspended thread. But we do not consider it to be a deadlock. It is because everything should come to normal after the debugger resumes the suspended thread.
So, could you, please, explain a little bit more on the deadlocks above? How the described in the bug scenarios are different from just listed ones? Do I miss anything?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3561786718

From duke at openjdk.org  Fri Nov 21 07:46:22 2025
From: duke at openjdk.org (=?UTF-8?B?SmVhbi1Ob8OrbA==?= Rouvignac)
Date: Fri, 21 Nov 2025 07:46:22 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v2]
In-Reply-To: 
References: 
 
Message-ID: <-6UQvhvzWxm9r6rtvS4EjiVn-to2xAa64MJi-9_-zss=.fe61f491-31d9-4e75-932a-8e9a9f6a45d1@github.com>

On Thu, 20 Nov 2025 04:45:24 GMT, Serguei Spitsyn  wrote:

>> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
>> 
>> This fix is to avoid enabling the `interp-only` mode for threads when `FramePop` events are enabled with JVMTI `SetEventNotificationMode`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` in the function `InterpreterRuntime::frequency_counter_overflow_inner()`. Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
>> The other details will be provided in the first PR request comment.
>> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
>> 
>> Testing:
>>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>>  - submitted mach5 tiers 1-6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cleanup: removed an old code fragment in frame.cpp

test/jdk/com/sun/jdi/EATests.java line 3068:

> 3066:         // frame[4]: EATestsTarget.main(java.lang.String[])
> 3067: 
> 3068:         env.stepOverLine(thread); // needed to keep target thread interp-only, so dontinline_brkpt_iret is not inligned

inligned => inlined

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28407#discussion_r2548831869

From sspitsyn at openjdk.org  Fri Nov 21 08:00:32 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 08:00:32 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
 
Message-ID: <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>

On Thu, 20 Nov 2025 15:31:10 GMT, Anton Artemov  wrote:

>> Hi, please consider the following changes:
>> 
>> If suspension is allowed when a thread is re-entering an object monitor (OM), then a deadlock is possible:
>> 
>> The waiting thread is made to be a successor and is unparked. Upon a suspension request, the thread will suspend itself whilst clearing the successor. The OM will be left unlocked (not grabbed by any thread), while the other threads are parked until a thread grabs the OM and the exits it. The suspended thread is on the entry-list and can be selected as a successor again. None of other threads can be woken up to grab the OM until the suspended thread has been resumed and successfully releases the OM.
>> 
>> This can happen in two places where the successor could be suspended: 
>> 1:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1897
>> 
>> 2:
>> https://github.com/openjdk/jdk/blob/6322aaba63b235cb6c73d23a932210af318404ec/src/hotspot/share/runtime/objectMonitor.cpp#L1149
>> 
>> The issues are addressed by not allowing suspension in case 1, and by handling the suspension request at a later stage, after the thread has grabbed the OM in `reenter_internal()` in case 2. In case of a suspension request, the thread exits the OM and enters it again once resumed. 
>> 
>> The JVMTI `waited` event posting (2nd one) is postponed until the suspended thread is resumed and has entered the OM again.  The `enter` to the OM (in case `ExitOnSuspend` did exit) is done without posting any events.
>> 
>> Tests are added for both scenarios. 
>> 
>> Tested in tiers 1 - 7.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8366659: Fixed whitespace error.

I'm looking at the  two new tests scenarios. They look non-real and very artificial because the application plays a role of the debugger at the same time and constructs the artificial deadlocks. The threads sync on an application lock, one of them suspends and another resumes the target thread. These deadlocks are impossible to have with any normal debugger which is decoupled from application it is debugging.
Sorry for saying it but it feels like there is no sense to fix this artificial issue.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3561858635

From mbaesken at openjdk.org  Fri Nov 21 08:33:24 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Fri, 21 Nov 2025 08:33:24 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
 
Message-ID: 

On Wed, 19 Nov 2025 13:05:24 GMT, Matthias Baesken  wrote:

> As usual, maybe it is possible to split this patch between hotspot and the libraries?

Maybe we should for now limit the dead_strip  to the JDK native libs ?

This would avoid the trouble with the HS debug helpers coding and the  serviceability agent  (but in the long run we have this trouble also with linktime-gc and probably LTO which can be enabled by OpenJDK configure, not only with this macOS-linker related flag this PR is about ).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3561953592

From aartemov at openjdk.org  Fri Nov 21 09:15:40 2025
From: aartemov at openjdk.org (Anton Artemov)
Date: Fri, 21 Nov 2025 09:15:40 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>
References: 
 
 <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>
Message-ID: 

On Fri, 21 Nov 2025 07:56:29 GMT, Serguei Spitsyn  wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8366659: Fixed whitespace error.
>
> I'm looking at the  two new tests scenarios. They look non-real and very artificial because the application plays a role of the debugger at the same time and constructs the artificial deadlocks. The threads sync on an application lock, one of them suspends and another resumes the target thread. These deadlocks are impossible to have with any normal debugger which is decoupled from application it is debugging.
> Sorry for saying it but it feels like there is no sense to fix this artificial issue.

Thanks @sspitsyn for diving into the issue. 

With that definition of the deadlock and suspension logic I agree that it might not be a problem at all. With this being said, is the existing test `SuspendWithObjectMonitorWait` demonstrating a real-world scenario? @dcubed-ojdk, what do you think?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3562088599

From mdoerr at openjdk.org  Fri Nov 21 09:33:24 2025
From: mdoerr at openjdk.org (Martin Doerr)
Date: Fri, 21 Nov 2025 09:33:24 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:56:48 GMT, Ruben  wrote:

>> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
>> 
>> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
>> 
>> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
>
> Ruben has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refine `first_check_size` definitions

Still good.

-------------

Marked as reviewed by mdoerr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28192#pullrequestreview-3491889191

From alanb at openjdk.org  Fri Nov 21 11:35:57 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Fri, 21 Nov 2025 11:35:57 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 13 Nov 2025 19:55:24 GMT, Mat Carter  wrote:

>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>> 
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>> 
>> TRUE
>> FALSE
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove single whitespace

I went through the plumbing to check the registration with the platform MBeanServer and everything looks okay (and consistent with how the other JDK-specific management interfaces are setup and registered).

src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java line 97:

> 95:    * successfully; {@code false} otherwise.
> 96:    */
> 97:    public boolean endRecording();

Minor nit is that we usually use 4-space rather than 2-space indent in the java sources. You might want to check the /** .. */ comments in a few of the files as they are misaligned in a few places.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28010#issuecomment-3562626766
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549470742

From sspitsyn at openjdk.org  Fri Nov 21 11:42:24 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 11:42:24 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
 
 <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>
 
Message-ID: 

On Fri, 21 Nov 2025 09:11:52 GMT, Anton Artemov  wrote:

> is the existing test SuspendWithObjectMonitorWait demonstrating a real-world scenario?

It does not look as such. There could be some motivation to write it however, e.g. checking some invariants. At least, it seems this test does not enforce any strict rules on the OM implementation and JVMTI events + suspend/resume. :)
New tests do not allow for OM implementation to put `MonitorWaited` event notification at a right spot. Otherwise, I would not object against them.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3562647847

From alanb at openjdk.org  Fri Nov 21 12:04:29 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Fri, 21 Nov 2025 12:04:29 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 13 Nov 2025 19:55:24 GMT, Mat Carter  wrote:

>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>> 
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>> 
>> TRUE
>> FALSE
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove single whitespace

test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 31:

> 29:  * @requires vm.cds.write.archived.java.heap
> 30:  * @library /test/jdk/lib/testlibrary /test/lib
> 31:  *          /test/hotspot/jtreg/runtime/cds/appcds/aotCache/test-classes

Is test-classes used?

test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 45:

> 43: import jdk.test.lib.process.OutputAnalyzer;
> 44: 
> 45: public class HotSpotAOTCacheMXBeanTest {

In addition to testing the endRecording operation, we also need to test both the direct and indirect access to the MXBean. The test currently obtains a proxy with newPlatformMXBeanProxy (good) but the direct access with ManagementFactory.getPlatformMXBean is not tested right now.

Another thing to test is that getObjectName returns the expected object name.

test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 92:

> 90:                 }
> 91:                 out.shouldNotContain("HotSpotAOTCacheMXBean is not available");
> 92:                 out.shouldNotContain("IOException occurred!");

Have you considering have the child terminate with an exception so the exit status is non-0. If you get a success status then the output should have the expected strings. A non-0 would failure, and the test fails.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549496991
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549513596
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549518555

From coleenp at openjdk.org  Fri Nov 21 14:09:55 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Fri, 21 Nov 2025 14:09:55 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v3]
In-Reply-To: <_C1_-yzeixcKbR2NfmnM4MEl3InsR6cTTzmoT-vMSBY=.032aae46-e951-4c76-91e6-fc7a8fe8b73c@github.com>
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
 
 <_C1_-yzeixcKbR2NfmnM4MEl3InsR6cTTzmoT-vMSBY=.032aae46-e951-4c76-91e6-fc7a8fe8b73c@github.com>
Message-ID: <_1-urAH6nhGRC5fXZnBvC60QvUAA7KA3ekz5sRD9MpQ=.edd7e8df-5459-4b89-a02d-5da88ce76c59@github.com>

On Thu, 20 Nov 2025 23:33:30 GMT, Vladimir Ivanov  wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revert a couple more InstanceKlass::casts also to get GHA to restart.
>
> src/hotspot/share/opto/compile.cpp line 1729:
> 
>> 1727:       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
>> 1728:         alias_type(idx)->set_rewritable(false);
>> 1729:       if (flat->isa_instklassptr() && flat->offset() == in_bytes(InstanceKlass::access_flags_offset()))
> 
> I'd place the check separately. Otherwise, looks good. 
> 
> diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
> index 6babc13e1b3..9215c0fc03f 100644
> --- a/src/hotspot/share/opto/compile.cpp
> +++ b/src/hotspot/share/opto/compile.cpp
> @@ -1726,8 +1726,6 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
>        }
>        if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
>          alias_type(idx)->set_rewritable(false);
> -      if (flat->offset() == in_bytes(Klass::access_flags_offset()))
> -        alias_type(idx)->set_rewritable(false);
>        if (flat->offset() == in_bytes(Klass::misc_flags_offset()))
>          alias_type(idx)->set_rewritable(false);
>        if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
> @@ -1735,6 +1733,11 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
>        if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
>          alias_type(idx)->set_rewritable(false);
>      }
> +    if (flat->isa_instklassptr()) {
> +      if (flat->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
> +        alias_type(idx)->set_rewritable(false);
> +      }
> +    }
>      // %%% (We would like to finalize JavaThread::threadObj_offset(),
>      // but the base pointer type is not distinctive enough to identify
>      // references into JavaThread.)

Yes that looks better. There aren't enough {} in that bit of code but I won't add more to existing code.  Thanks for your help with the C2 code.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2549873241

From coleenp at openjdk.org  Fri Nov 21 14:53:03 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Fri, 21 Nov 2025 14:53:03 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v4]
In-Reply-To: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
Message-ID: 

> ArrayKlass doesn't set AccessFlags so don't look for them there.  See CR for details.
> Fixed SA and jvmci.  @iwanowww Can you check that I changed C2 correctly (we talked about this in August).
> Tested with tier1-4.  5-7 in progress.

Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:

  Reformatting compile.cpp

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28371/files
  - new: https://git.openjdk.org/jdk/pull/28371/files/1060463b..06d6a186

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28371&range=02-03

  Stats: 8 lines in 1 file changed: 6 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28371.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28371/head:pull/28371

PR: https://git.openjdk.org/jdk/pull/28371

From cjplummer at openjdk.org  Fri Nov 21 17:32:56 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Fri, 21 Nov 2025 17:32:56 GMT
Subject: Integrated: 8372294: Fix Malformed problem list entry in
 ProblemList-jvmti-stress-agent.txt
In-Reply-To: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
References: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
Message-ID: 

On Thu, 20 Nov 2025 20:14:10 GMT, Chris Plummer  wrote:

> ProblemList-jvmti-stress-agent.txt fails to pass verification because it uses a tab character instead of spaces. 
> 
> I'd like to push this as a trivial change.

This pull request has now been integrated.

Changeset: e4b583ab
Author:    Chris Plummer 
URL:       https://git.openjdk.org/jdk/commit/e4b583ab708eadd526d5cc0c03129a7970e05320
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8372294: Fix Malformed problem list entry in ProblemList-jvmti-stress-agent.txt

Reviewed-by: sspitsyn, lmesnik

-------------

PR: https://git.openjdk.org/jdk/pull/28441

From cjplummer at openjdk.org  Fri Nov 21 17:32:56 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Fri, 21 Nov 2025 17:32:56 GMT
Subject: RFR: 8372294: Fix Malformed problem list entry in
 ProblemList-jvmti-stress-agent.txt
In-Reply-To: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
References: <4dv7jK8fdPgbRDz_3v2wqd9XmHTtpp0T4QSujRYNu6I=.e3f6bec2-f09c-4899-af29-222b06e072bf@github.com>
Message-ID: 

On Thu, 20 Nov 2025 20:14:10 GMT, Chris Plummer  wrote:

> ProblemList-jvmti-stress-agent.txt fails to pass verification because it uses a tab character instead of spaces. 
> 
> I'd like to push this as a trivial change.

Thank you for the reviews Serguei and Leonid!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28441#issuecomment-3563985673

From amenkov at openjdk.org  Fri Nov 21 18:12:12 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Fri, 21 Nov 2025 18:12:12 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v4]
In-Reply-To: 
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
Message-ID: 

On Fri, 21 Nov 2025 06:31:56 GMT, Chris Plummer  wrote:

>> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
>> 
>> This PR focuses on purging virtual thread ThreadNodes in two places:
>> 
>> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
>> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
>> 
>> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
>> 
>> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
>> 
>> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
>> 
>> Tested by running all tier2, tier5, and tier6 CI svc tests.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix comments. use runningVThreads.first

Marked as reviewed by amenkov (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28211#pullrequestreview-3493860094

From macarte at openjdk.org  Fri Nov 21 18:41:45 2025
From: macarte at openjdk.org (Mat Carter)
Date: Fri, 21 Nov 2025 18:41:45 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:37:23 GMT, Leonid Mesnik  wrote:

>> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>>  - Corrected placement of assert and logic test
>
> test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 57:
> 
>> 55:             try {
>> 56:                 OutputAnalyzer output = ProcessTools.executeProcess(jcmd.getCommand());
>> 57:                 output.shouldContain("AOT.end_recording is unsupported");
> 
> A little bit confused.  The check doesn't match test description.

This test uses Lingered apps (enabling the jcmd connection), however the test framework here doesn't support creating the AOT cache - so I simply check that the connection works and the diagnostic command returns the expected value when you aren't recording a cache

I'm trying to create an additional test that allows jcmd to end training on an AOT recording, but there's some issues merging the jcmd test support and the aot test support;  I will make it clearer in this test about this limitation

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550648445

From cjplummer at openjdk.org  Fri Nov 21 18:46:36 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Fri, 21 Nov 2025 18:46:36 GMT
Subject: RFR: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes [v4]
In-Reply-To: 
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
 
Message-ID: 

On Fri, 21 Nov 2025 06:31:56 GMT, Chris Plummer  wrote:

>> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
>> 
>> This PR focuses on purging virtual thread ThreadNodes in two places:
>> 
>> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
>> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
>> 
>> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
>> 
>> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
>> 
>> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
>> 
>> Tested by running all tier2, tier5, and tier6 CI svc tests.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix comments. use runningVThreads.first

Thank you for the reviews Alex and Serguei!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28211#issuecomment-3564212768

From macarte at openjdk.org  Fri Nov 21 18:47:21 2025
From: macarte at openjdk.org (Mat Carter)
Date: Fri, 21 Nov 2025 18:47:21 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:32:48 GMT, Leonid Mesnik  wrote:

>> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>>  - Corrected placement of assert and logic test
>
> test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 31:
> 
>> 29:  * @summary Sanity test for Jcmd AOT.end_recording command
>> 30:  * @library /test/lib
>> 31:  * @build JcmdAOTEndRecordingTest
> 
> No need to build test explicitly, jtreg does it by itself.

Thank you, I did not know that (copied another test as a template) - I've removed the build step in the header of both tests

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550662386

From cjplummer at openjdk.org  Fri Nov 21 18:49:37 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Fri, 21 Nov 2025 18:49:37 GMT
Subject: Integrated: 8282441: [LOOM] The debug agent should attempt to free
 vthread ThreadNodes
In-Reply-To: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
References: <3Bj6ezlCUOeiv7OUJsRO2j4krWIeqrnwsIFWZVeBxSk=.0529cb73-de78-4f10-ac7f-420063557d6e@github.com>
Message-ID: 

On Mon, 10 Nov 2025 03:15:06 GMT, Chris Plummer  wrote:

> This is first of what will probably be 3 PRs to improve virtual thread ThreadNode handling in the debug agent, with a goal of improving performance and reducing footprint.
> 
> This PR focuses on purging virtual thread ThreadNodes in two places:
> 
> 1. Freeing the ThreadNode after handling a THREAD_START event for a virtual thread.
> 2. Doing a "GC" of virtual thread ThreadNodes just before doing a "suspend all"
> 
> At some point in the future I want to attempt to free the ThreadNodes after performing ThreadReference related commands, which will result in the creation of a ThreadNode if not already created. Another area is in handleReportEventCompositeCommand() when the thread is not null and we are using the SUSPEND_NONE policy. This will get more ThreadNodes freed immediately after handling an event.
> 
> Part of the challenge with this PR is that there are many places in the debug agent that expect a ThreadNode to already have been created for the virtual thread, but now it is common that they have not. The main way this has been addressed is by having findRunningThread() create the ThreadNode if it does not already exist.
> 
> At some point in the future I will probably add logic to only "GC" ThreadNodes after the number reaches some threshold, but right now I want to free them very aggressively so we'll catch any bugs where there debug agent expects a ThreadNode to exist, but possibly now it might not.
> 
> Tested by running all tier2, tier5, and tier6 CI svc tests.

This pull request has now been integrated.

Changeset: 2b5cd14e
Author:    Chris Plummer 
URL:       https://git.openjdk.org/jdk/commit/2b5cd14ea5c571e0d55df8293e49b9a0db521a46
Stats:     244 lines in 1 file changed: 187 ins; 39 del; 18 mod

8282441: [LOOM] The debug agent should attempt to free vthread ThreadNodes

Reviewed-by: amenkov, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/28211

From macarte at openjdk.org  Fri Nov 21 18:56:57 2025
From: macarte at openjdk.org (Mat Carter)
Date: Fri, 21 Nov 2025 18:56:57 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:56:46 GMT, Leonid Mesnik  wrote:

>> Mat Carter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8370203' of https://github.com/macarte/jdk into JDK-8370203
>>  - Corrected placement of assert and logic test
>
> src/hotspot/share/cds/aotMetaspace.cpp line 1062:
> 
>> 1060: bool AOTMetaspace::preimage_static_archive_dumped() {
>> 1061:   assert(CDSConfig::is_dumping_preimage_static_archive(), "Required");
>> 1062:   return _preimage_static_archive_dumped == 1;
> 
> Should it be  AtomicAccess::load(&_preimage_static_archive_dumped) here?

Andrew brought this up also; I'll add but should it be AtomicAccess::load or AtomicAccess::load_acquire?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550681782

From macarte at openjdk.org  Fri Nov 21 19:12:25 2025
From: macarte at openjdk.org (Mat Carter)
Date: Fri, 21 Nov 2025 19:12:25 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: <73mIYRuGWI0kSUKqXQdb7MPjZqXwM9s4-EuZw6qeiWo=.8814d782-f332-4033-b43b-7317a82c8650@github.com>
References: 
 
 <73mIYRuGWI0kSUKqXQdb7MPjZqXwM9s4-EuZw6qeiWo=.8814d782-f332-4033-b43b-7317a82c8650@github.com>
Message-ID: 

On Tue, 28 Oct 2025 16:57:43 GMT, Mat Carter  wrote:

>> src/hotspot/share/cds/aotMetaspace.cpp line 963:
>> 
>>> 961: bool AOTMetaspace::is_recording_preimage_static_archive() {
>>> 962:   if (CDSConfig::is_dumping_preimage_static_archive()) {
>>> 963:       return _preimage_static_archive_dumped == 0;
>> 
>> Do we need to use an acquiring load here? i.e. can the read here and the cmpxchg below happen in different threads?
>> n.b. I'm not just thinking about the behaviour when this patch makes the DCmd available but also what happens when we supplement it with the MXBean interface to end recordings.
>
> I think it's okay, as ending the recording is controlled by the cmpxchg, even if two threads think the recording is still going on, only one call to end the recording will work, and if the threads both check whether the recording has completed they will both see that it has (regardless of which thread 'won')

Andrew I'm going to add the AtomicAccess::load_acquire, or would AtomicAccess::load be enough

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2550719327

From sspitsyn at openjdk.org  Fri Nov 21 19:45:04 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 19:45:04 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v3]
In-Reply-To: 
References: 
Message-ID: 

> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
> 
> This fix is to avoid enabling the `interp-only` mode for threads when `FramePop` events are enabled with JVMTI `SetEventNotificationMode`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` in the function `InterpreterRuntime::frequency_counter_overflow_inner()`. Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
> The other details will be provided in the first PR request comment.
> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
> 
> Testing:
>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>  - submitted mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  review: fix typo in a EATests.java comment

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28407/files
  - new: https://git.openjdk.org/jdk/pull/28407/files/b3cffe5a..5989906c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28407.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28407/head:pull/28407

PR: https://git.openjdk.org/jdk/pull/28407

From sspitsyn at openjdk.org  Fri Nov 21 19:45:08 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Fri, 21 Nov 2025 19:45:08 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v2]
In-Reply-To: <-6UQvhvzWxm9r6rtvS4EjiVn-to2xAa64MJi-9_-zss=.fe61f491-31d9-4e75-932a-8e9a9f6a45d1@github.com>
References: 
 
 <-6UQvhvzWxm9r6rtvS4EjiVn-to2xAa64MJi-9_-zss=.fe61f491-31d9-4e75-932a-8e9a9f6a45d1@github.com>
Message-ID: 

On Fri, 21 Nov 2025 07:43:04 GMT, Jean-No?l Rouvignac  wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   cleanup: removed an old code fragment in frame.cpp
>
> test/jdk/com/sun/jdi/EATests.java line 3068:
> 
>> 3066:         // frame[4]: EATestsTarget.main(java.lang.String[])
>> 3067: 
>> 3068:         env.stepOverLine(thread); // needed to keep target thread interp-only, so dontinline_brkpt_iret is not inligned
> 
> inligned => inlined

Thank you catching it! Fixed now.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28407#discussion_r2550785711

From mdonovan at openjdk.org  Fri Nov 21 19:51:57 2025
From: mdonovan at openjdk.org (Matthew Donovan)
Date: Fri, 21 Nov 2025 19:51:57 GMT
Subject: RFR: 8353738: Update TLS unit tests to not use certificates with
 MD5 signatures [v5]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 13 Nov 2025 13:49:55 GMT, Daniel Jeli?ski  wrote:

>> Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   changed line wrapping
>
> test/jdk/javax/net/ssl/HttpsURLConnection/CriticalSubjectAltName.java line 36:
> 
>> 34:  * @library /test/lib
>> 35:  * @modules java.base/sun.security.x509 java.base/sun.security.util
>> 36:  * @run main/othervm CriticalSubjectAltName TLSv1.2 MD5withRSA
> 
> as far as I could tell, this test doesn't verify any functionality that would require a specific key type, it's simply using MD5 because that was the popular choice in 2008. Do we need to keep using MD5, or can we make it use whatever key type is the default?

It was suggested to keep test cases for TLS 1.2/MD5 as well as updating for TLS 1.3. If the TLS 1.2/MD5 isn't adding anything here I can remove it.

> test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java line 1:
> 
>> 1: /*
> 
> This might be preexisting, but this file is identical to `test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java` now. Can we remove one?

I compared the two files from before I updated IPIdentities and they are identical. I removed IPIdentities.java

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2550794961
PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2550797069

From mdonovan at openjdk.org  Fri Nov 21 19:51:58 2025
From: mdonovan at openjdk.org (Matthew Donovan)
Date: Fri, 21 Nov 2025 19:51:58 GMT
Subject: RFR: 8353738: Update TLS unit tests to not use certificates with
 MD5 signatures [v5]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Fri, 14 Nov 2025 10:04:07 GMT, Daniel Fuchs  wrote:

>> test/jdk/sun/net/www/protocol/https/HttpsURLConnection/IdentitiesBase.java line 104:
>> 
>>> 102:                         CertificateBuilder.KeyUsage.KEY_ENCIPHERMENT)
>>> 103:                 .addBasicConstraintsExt(false, false, -1)
>>> 104:                 .addExtension(CertificateBuilder.createIPSubjectAltNameExt(true, "127.0.0.1"))
>> 
>> I assume you verified that the DNSIdentities customization overwrites the SAN configured here, but I'd feel more confident if this line were moved to customizeServerCert in IPIdentities
>
> If there is an alternative SAN for IPv4 loopback address there should be one for the IPv6 loopback too.

> I assume you verified that the DNSIdentities customization overwrites the SAN configured here, but I'd feel more confident if this line were moved to customizeServerCert in IPIdentities

Yes, they are overwritten, extensions are stored as a Map between extention id and the extension.

> If there is an alternative SAN for IPv4 loopback address there should be one for the IPv6 loopback too.

I added the IPV6 loopback.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27342#discussion_r2550800219

From dlong at openjdk.org  Fri Nov 21 19:57:58 2025
From: dlong at openjdk.org (Dean Long)
Date: Fri, 21 Nov 2025 19:57:58 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:56:48 GMT, Ruben  wrote:

>> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
>> 
>> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
>> 
>> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
>
> Ruben has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refine `first_check_size` definitions

CI testing results are good.

-------------

Marked as reviewed by dlong (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28192#pullrequestreview-3494168899

From mdonovan at openjdk.org  Fri Nov 21 20:14:53 2025
From: mdonovan at openjdk.org (Matthew Donovan)
Date: Fri, 21 Nov 2025 20:14:53 GMT
Subject: RFR: 8353738: Update TLS unit tests to not use certificates with
 MD5 signatures [v6]
In-Reply-To: 
References: 
Message-ID: 

> This PR updates tests that were using MD5 certificates. For most of the tests, I added test cases for TLSv1.2/MD5withRSA and TLSv1.3/SHA256withRSA.

Matthew Donovan 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:

 - Updated SAN methods in CertificateBuilder to take multiple names
 - Merge branch 'master' into update-md5-certs
 - removed IPIdentitites.java because it's identical to IPAddressIPIdenties; added IPv6 SAN ext
 - removed unused keystore files, fixed certificate chain
 - Merge branch 'master' into update-md5-certs
 - changed line wrapping
 - removed unnecessary comment and made getSSLContext(...) private
 - changed tests to use SecurityUtils.removeDisabled*Algs methods
 - fixed indents and copyright year
 - Merge branch 'master' into update-md5-certs
 - ... and 1 more: https://git.openjdk.org/jdk/compare/c70734d2...6579bc79

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27342/files
  - new: https://git.openjdk.org/jdk/pull/27342/files/1aaf4247..6579bc79

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27342&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27342&range=04-05

  Stats: 300342 lines in 2569 files changed: 194979 ins; 65676 del; 39687 mod
  Patch: https://git.openjdk.org/jdk/pull/27342.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27342/head:pull/27342

PR: https://git.openjdk.org/jdk/pull/27342

From sspitsyn at openjdk.org  Sat Nov 22 09:00:49 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Sat, 22 Nov 2025 09:00:49 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
Message-ID: <6WDKeD8iQTXDPhR0ohPvA6KVufW0uXHBmyZ5oOWfYWI=.44d63e7f-fbdb-47b6-8b36-f0d0cb35fb91@github.com>

On Thu, 20 Nov 2025 23:10:48 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename VM methods for endFirstTransition/startFinalTransition

src/hotspot/share/runtime/javaThread.cpp line 1173:

> 1171: bool JavaThread::java_suspend(bool register_vthread_SR) {
> 1172: #if INCLUDE_JVMTI
> 1173:   // Suspending a JavaThread in VTMS transition or disabling VTMS transitions can cause deadlocks.

Q: I wonder if the `#if INCLUDE_JVMTI` and `#endif` can be removed here.

src/hotspot/share/runtime/mountUnmountDisabler.cpp line 126:

> 124:          || global_start_transition_disable_count() > base_disable_count
> 125:          JVMTI_ONLY(|| (JvmtiVTSuspender::is_vthread_suspended(java_lang_Thread::thread_id(vthread)) || thread->is_suspended()));
> 126: }

I like this approach with the JVMTIStartTransition and JVMTIEndTransition helper classes. It is a nice way to decouple the JVMTI part of the protocol. Introducing the `is_start_transition_disabled()` function was also long desired. Also, I like the functions `start_transition()` and `end_transition()` became pretty simple and clean!

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2552502964
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2552624330

From sspitsyn at openjdk.org  Sat Nov 22 09:00:50 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Sat, 22 Nov 2025 09:00:50 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 20 Nov 2025 22:55:35 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add Alan's comment in VirtualThread
>
> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 147:
> 
>> 145:       MonitorLocker ml(VTMSTransition_lock);
>> 146:       while (is_start_transition_disabled(current, vth())) {
>> 147:         ml.wait(200);
> 
> I see a lot of timed-waits throughout this code. Is that because we poll rather than synchronizing properly? All this potential busy-waiting is surely going to cause performance glitches.

The timeouts are for reliability purposes only. Technically, they are not needed and can be removed after this code becomes stable. The `wait()` calls are inside while loop which rechecks the loop-ending conditions.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2552610777

From sspitsyn at openjdk.org  Sat Nov 22 09:00:52 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Sat, 22 Nov 2025 09:00:52 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:52:05 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename VM methods for endFirstTransition/startFinalTransition
>
> src/hotspot/share/runtime/mountUnmountDisabler.hpp line 52:
> 
>> 50:   // parameter is_SR: suspender or resumer
>> 51:   MountUnmountDisabler(bool exlusive = false);
>> 52:   MountUnmountDisabler(oop thread_oop);
> 
> What does the comment mean here?

This comment is stale now and must be removed. The parameter `is_SR` is being replaced with the `exclusive`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2552577039

From sspitsyn at openjdk.org  Sat Nov 22 09:15:49 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Sat, 22 Nov 2025 09:15:49 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:10:48 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename VM methods for endFirstTransition/startFinalTransition

I've completed my first pass trough this update, and it looks pretty solid in general.
I'm going to make another pass next week.

src/hotspot/share/prims/jvm.cpp line 3682:

> 3680: JVM_ENTRY(void, JVM_VirtualThreadEndTransition(JNIEnv* env, jobject vthread, jboolean is_mount))
> 3681:   oop vt = JNIHandles::resolve_external_guard(vthread);
> 3682:   MountUnmountDisabler::end_transition(thread, vt, is_mount, false /*is_thread_start*/);

The `JVM_VirtualThread*` functions have been nicely simplified.

-------------

PR Review: https://git.openjdk.org/jdk/pull/28361#pullrequestreview-3496249775
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2552682664

From duke at openjdk.org  Sun Nov 23 17:56:48 2025
From: duke at openjdk.org (duke)
Date: Sun, 23 Nov 2025 17:56:48 GMT
Subject: Withdrawn: 8358890: VM option -XX:AllowRedefinitionToAddDeleteMethods
 should be obsoleted then expired
In-Reply-To: 
References: 
Message-ID: 

On Thu, 10 Jul 2025 01:12:11 GMT, Serguei Spitsyn  wrote:

> The VM option -XX:AllowRedefinitionToAddDeleteMethods was added in JDK 13 as a temporary backward compatibility flag under JDK-8192936 and was immediately marked as Deprecate. The fix is to obsolete this option in JDK 26 and expire in JDK 27.
> 
> TBD: Need to submit a related CSR.
> 
> There are two concerns which may require some negotiation with the Runtime (@coleenp @dcubed-ojdk @dholmes-ora) and SQE (@lmesnik) teams:
>  - Class redefinition/retransformation can impact lambda expressions which are supported with private methods
>  - Many tests depend on this VM option and are being removed. I'm not sure if it is okay to completely remove those e may want another way to handle this (e.g. problem-listing the impacted tests for now).
>  
> Testing:
>  - mach5 tiers 1-6 are good
>  - may need to run mach5 tiers > 6

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/26232

From dholmes at openjdk.org  Mon Nov 24 01:34:33 2025
From: dholmes at openjdk.org (David Holmes)
Date: Mon, 24 Nov 2025 01:34:33 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
 
 <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>
 
 
Message-ID: 

On Fri, 21 Nov 2025 11:38:49 GMT, Serguei Spitsyn  wrote:

>> Thanks @sspitsyn for diving into the issue. 
>> 
>> With that definition of the deadlock and suspension logic I agree that it might not be a problem at all. With this being said, is the existing test `SuspendWithObjectMonitorWait` demonstrating a real-world scenario? @dcubed-ojdk, what do you think?
>
>> is the existing test SuspendWithObjectMonitorWait demonstrating a real-world scenario?
> 
> It does not look as such. There could be some motivation to write it however, e.g. checking some invariants. At least, it seems this test does not enforce any strict rules on the OM implementation and JVMTI events + suspend/resume. :)
> New tests do not allow for OM implementation to put `MonitorWaited` event notification at a right spot. Otherwise, I would not object against them.

@sspitsyn  so your position is that it is okay for suspension to cause something to break as long as resuming the suspended thread then fixes things? Does it matter how much time passes?

We have had a lot of discussion about this outside the PR and some of us at least feel there is a distinction between suspending a thread that clearly holds an application level resource (like a monitor) which then prevents other threads from continuing, versus suspending a thread holding a VM internal "resource" that prevents other threads from continuing. The design of JVM TI thread suspension actively tries to minimise the ability to hold any internal VM resource whilst suspended, and the current problem seems a variant of that. If we suspend a thread that has not yet acquired a monitor, and inspection of the monitor would show it is not owned, then it seems a bug if other threads trying to acquire that monitor can not make progress.

Agreed the tests are completely artificial but there is no way to test this other than to do that.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3568649410

From duke at openjdk.org  Mon Nov 24 09:45:02 2025
From: duke at openjdk.org (Ruben)
Date: Mon, 24 Nov 2025 09:45:02 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 23:56:48 GMT, Ruben  wrote:

>> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
>> 
>> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
>> 
>> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
>
> Ruben has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refine `first_check_size` definitions

Thank you both. I am planning to submit the `/integrate` request in a few hours.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3569791332

From sspitsyn at openjdk.org  Mon Nov 24 10:24:17 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Mon, 24 Nov 2025 10:24:17 GMT
Subject: RFR: 8366659: ObjectMonitor::wait() can deadlock with a suspension
 request [v17]
In-Reply-To: 
References: 
 
 <1IG8jMnDDdRMkB8jSwlkmKv3RgOxry32boypwj5YT60=.fca53e75-4e30-4448-872a-8bec61076c43@github.com>
 
 
Message-ID: 

On Fri, 21 Nov 2025 11:38:49 GMT, Serguei Spitsyn  wrote:

>> Thanks @sspitsyn for diving into the issue. 
>> 
>> With that definition of the deadlock and suspension logic I agree that it might not be a problem at all. With this being said, is the existing test `SuspendWithObjectMonitorWait` demonstrating a real-world scenario? @dcubed-ojdk, what do you think?
>
>> is the existing test SuspendWithObjectMonitorWait demonstrating a real-world scenario?
> 
> It does not look as such. There could be some motivation to write it however, e.g. checking some invariants. At least, it seems this test does not enforce any strict rules on the OM implementation and JVMTI events + suspend/resume. :)
> New tests do not allow for OM implementation to put `MonitorWaited` event notification at a right spot. Otherwise, I would not object against them.

> @sspitsyn so your position is that it is okay for suspension to cause something to break as long as resuming the suspended thread then fixes things? Does it matter how much time passes?

Suspend/Resume is a debugging feature and normally used in a debugging session and expected to cause a slow down. 
Also, it is known to be somewhat risky to use. So, my answer is yes. Slow down time does not matter much as it depends on a suspension time.

> We have had a lot of discussion about this outside the PR and some of us at least feel there is a distinction between suspending a thread that clearly holds an application level resource (like a monitor) which then prevents other threads from continuing, versus suspending a thread holding a VM internal "resource" that prevents other threads from continuing.

Agreed

> The design of JVM TI thread suspension actively tries to minimise the ability to hold any internal VM resource whilst suspended, and the current problem seems a variant of that. If we suspend a thread that has not yet acquired a monitor, and inspection of the monitor would show it is not owned, then it seems a bug if other threads trying to acquire that monitor can not make progress.

You, most likely right that the current problem is a variant of that. But I disagree to qualify this issue as a deadlock.
The thread was picked as a successor and then suspended. It feels like it has to be qualified same as a thread owns the monitor and suspended. The issue is that the OM real state and the JVMTI state bits do to reflect this.
I feel that changing the order of JVMTI OM events and giving up the symmetry between `timed-wait` and `notified-wait` is risky and may cause more problems than this bug is trying to solve. I'm thinking if there is a way the tread could give up
being the OM successor.

> Agreed the tests are completely artificial but there is no way to test this other than to do that.

Agree with this. But the deadlock is in the new tests, not in the OM implementation. And yes, constructing a deadlock was needed to demonstrate the problem. It is confusing. :)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27040#issuecomment-3569971399

From adinn at openjdk.org  Mon Nov 24 10:33:30 2025
From: adinn at openjdk.org (Andrew Dinn)
Date: Mon, 24 Nov 2025 10:33:30 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Fri, 21 Nov 2025 18:53:17 GMT, Mat Carter  wrote:

>> src/hotspot/share/cds/aotMetaspace.cpp line 1062:
>> 
>>> 1060: bool AOTMetaspace::preimage_static_archive_dumped() {
>>> 1061:   assert(CDSConfig::is_dumping_preimage_static_archive(), "Required");
>>> 1062:   return _preimage_static_archive_dumped == 1;
>> 
>> Should it be  AtomicAccess::load(&_preimage_static_archive_dumped) here?
>
> Andrew brought this up also; I'll add but should it be AtomicAccess::load or AtomicAccess::load_acquire?

Just in case this might be called from a different thread to the one which is executing the `cmpxchg` you should really be using `AtomicAccess::load_acquire(&_preimage_static_archive_dumped)` here
You also need acquire-release semantics for the comparison below which you get as the default from your current use of `cmpxchg` below.

    if (AtomicAccess::cmpxchg(&_preimage_static_archive_dumped, 0, 1) != 0) {

Depending on the implementation that might be more heavyweight than you really need. e.g. given that the change is idempotent you could rely on a bare `xchg` with acq_rel semantics

    if (AtomicAccess::xchg(&_preimage_static_archive_dumped, 1, atomic_memory_order::memory_order_acq_rel) != 0) {

However, it's not going to matter very much since these are low-frequency operations.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2555662830

From djelinski at openjdk.org  Mon Nov 24 12:23:31 2025
From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=)
Date: Mon, 24 Nov 2025 12:23:31 GMT
Subject: RFR: 8353738: Update TLS unit tests to not use certificates with
 MD5 signatures [v6]
In-Reply-To: 
References: 
 
Message-ID: <8bHfiZThBv6oNAn_y-trnWR-LqxZRAXgDdHEbdtOQ4E=.7527f68f-9a7a-4140-b4fb-2bdb0e2573fd@github.com>

On Fri, 21 Nov 2025 20:14:53 GMT, Matthew Donovan  wrote:

>> This PR updates tests that were using MD5 certificates. For most of the tests, I added test cases for TLSv1.2/MD5withRSA and TLSv1.3/SHA256withRSA.
>
> Matthew Donovan 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:
> 
>  - Updated SAN methods in CertificateBuilder to take multiple names
>  - Merge branch 'master' into update-md5-certs
>  - removed IPIdentitites.java because it's identical to IPAddressIPIdenties; added IPv6 SAN ext
>  - removed unused keystore files, fixed certificate chain
>  - Merge branch 'master' into update-md5-certs
>  - changed line wrapping
>  - removed unnecessary comment and made getSSLContext(...) private
>  - changed tests to use SecurityUtils.removeDisabled*Algs methods
>  - fixed indents and copyright year
>  - Merge branch 'master' into update-md5-certs
>  - ... and 1 more: https://git.openjdk.org/jdk/compare/904578e0...6579bc79

Please convert the IPAddressDNSIdentities test as well. It's expecting a handshake failure, but now it's passing for the wrong reasons. Other than that, LGTM.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27342#issuecomment-3570521948

From mbaesken at openjdk.org  Mon Nov 24 14:53:33 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Mon, 24 Nov 2025 14:53:33 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v4]
In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
Message-ID: 

> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  Set the -dead_strip linker option only for the JDK libs

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28319/files
  - new: https://git.openjdk.org/jdk/pull/28319/files/b41966b8..b63b9ca8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=02-03

  Stats: 13 lines in 2 files changed: 2 ins; 10 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28319/head:pull/28319

PR: https://git.openjdk.org/jdk/pull/28319

From mbaesken at openjdk.org  Mon Nov 24 15:01:56 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Mon, 24 Nov 2025 15:01:56 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
 
 
Message-ID: 

On Fri, 21 Nov 2025 08:27:51 GMT, Matthias Baesken  wrote:

> Maybe we should for now limit the dead_strip to the JDK native libs ?

Done; additionally I set the dead_strip flag only for release builds (for (fast)debug builds we most likely are totally fine with larger binaries and debuginfo files) .

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3571211348

From duke at openjdk.org  Mon Nov 24 16:50:40 2025
From: duke at openjdk.org (duke)
Date: Mon, 24 Nov 2025 16:50:40 GMT
Subject: RFR: 8371458: [REDO] Remove exception handler stub code in C2 [v4]
In-Reply-To: 
References: 
 
Message-ID: <9kFgZAXhct0uyRPPomMDRX4VXd2Xd2GhosMyIuDb4qM=.d6caf7cd-8360-4aef-90ee-0029c12f0f32@github.com>

On Thu, 20 Nov 2025 23:56:48 GMT, Ruben  wrote:

>> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
>> 
>> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
>> 
>> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
>
> Ruben has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refine `first_check_size` definitions

@ruben-arm 
Your change (at version 00ea0e143da03016531e301db673b1893cf9be64) is now ready to be sponsored by a Committer.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28192#issuecomment-3571760781

From duke at openjdk.org  Mon Nov 24 17:02:07 2025
From: duke at openjdk.org (Ruben)
Date: Mon, 24 Nov 2025 17:02:07 GMT
Subject: Integrated: 8371458: [REDO] Remove exception handler stub code in C2
In-Reply-To: 
References: 
Message-ID: <4DuLwlcmvr3XcIxJnZPbuDumV2OiLwGZzM3N-zkS5-E=.16a23abc-f041-4321-8638-ee18429573c2@github.com>

On Fri, 7 Nov 2025 11:07:40 GMT, Ruben  wrote:

> The original fix [JDK-8365047](https://bugs.openjdk.org/browse/JDK-8365047) was backed out by [JDK-8371388](https://bugs.openjdk.org/browse/JDK-8371388), this is the REDO.
> 
> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
> 
> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.

This pull request has now been integrated.

Changeset: 21772600
Author:    Ruben Ayrapetyan 
Committer: Martin Doerr 
URL:       https://git.openjdk.org/jdk/commit/217726009492af5a1143c98b97cc39b580850c5d
Stats:     640 lines in 46 files changed: 334 ins; 218 del; 88 mod

8371458: [REDO] Remove exception handler stub code in C2

Co-authored-by: Martin Doerr 
Reviewed-by: mdoerr, dlong

-------------

PR: https://git.openjdk.org/jdk/pull/28192

From mdonovan at openjdk.org  Mon Nov 24 17:22:39 2025
From: mdonovan at openjdk.org (Matthew Donovan)
Date: Mon, 24 Nov 2025 17:22:39 GMT
Subject: RFR: 8353738: Update TLS unit tests to not use certificates with
 MD5 signatures [v7]
In-Reply-To: 
References: 
Message-ID: 

> This PR updates tests that were using MD5 certificates. For most of the tests, I added test cases for TLSv1.2/MD5withRSA and TLSv1.3/SHA256withRSA.

Matthew Donovan 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 13 additional commits since the last revision:

 - Updated IPAddressDNSIdentities and confirmed test fails for correct reason
 - Merge branch 'master' into update-md5-certs
 - Updated SAN methods in CertificateBuilder to take multiple names
 - Merge branch 'master' into update-md5-certs
 - removed IPIdentitites.java because it's identical to IPAddressIPIdenties; added IPv6 SAN ext
 - removed unused keystore files, fixed certificate chain
 - Merge branch 'master' into update-md5-certs
 - changed line wrapping
 - removed unnecessary comment and made getSSLContext(...) private
 - changed tests to use SecurityUtils.removeDisabled*Algs methods
 - ... and 3 more: https://git.openjdk.org/jdk/compare/cd9e5e5a...ea9c2dce

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27342/files
  - new: https://git.openjdk.org/jdk/pull/27342/files/6579bc79..ea9c2dce

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27342&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27342&range=05-06

  Stats: 1138 lines in 16 files changed: 412 ins; 630 del; 96 mod
  Patch: https://git.openjdk.org/jdk/pull/27342.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27342/head:pull/27342

PR: https://git.openjdk.org/jdk/pull/27342

From coleenp at openjdk.org  Mon Nov 24 19:04:42 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Mon, 24 Nov 2025 19:04:42 GMT
Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v18]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 08:36:02 GMT, Johan Sj?len  wrote:

>> Hi,
>> 
>> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`.
>> 
>> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately.
>> 
>> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc.
>> 
>> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement.
>> 
>> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again.
>
> Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision:
> 
>   IDE doesn't help you with VM structs!

Looks good!  This is great work.

-------------

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27198#pullrequestreview-3501798483

From dfuchs at openjdk.org  Mon Nov 24 19:29:15 2025
From: dfuchs at openjdk.org (Daniel Fuchs)
Date: Mon, 24 Nov 2025 19:29:15 GMT
Subject: RFR: 8370691: Add new Float16Vector type and enable
 intrinsification of vector operations supported by auto-vectorizer [v3]
In-Reply-To: <15AReOBUAseO-BiCWHW7N-OSOcknDc0Box3c90cXRZU=.5d7341db-94ea-4cdf-b3cd-fabe414dd88d@github.com>
References: 
 
 
 
 
 <15AReOBUAseO-BiCWHW7N-OSOcknDc0Box3c90cXRZU=.5d7341db-94ea-4cdf-b3cd-fabe414dd88d@github.com>
Message-ID: <_SMDMjDoXuDI_Sujt62HD_YewzTQQlvqMSkpffJKq3A=.64a03981-30d1-48e5-a767-d4121c617296@github.com>

On Thu, 13 Nov 2025 09:27:02 GMT, Jatin Bhateja  wrote:

>>> > > Some quick comments.
>>> > > We should be consistent in the naming, and rename `Halfloat*` to `Float16*`.
>>> > 
>>> > 
>>> > I concur, especially since there are multiple 16-bit floating-point formats in use including the IEEE 754 float16 as well as bfloat16.
>>> 
>>> There are nomenclature issues that I am facing. Currently, all the Float16 concrete classes use the Halffloat prefix i.e., Halffloat64Vector, Halffloat128Vector; converting these to Float16 looks a little confusing, i.e., Float1664Vector, Float16128Vector, etc Kindly suggest a better name to represent these classes.
>> 
>> Maybe we move the shape to the end e.g., `Float16Vector128`, `IntVector128`, `IntVectorMax`?
>
>> > > > Some quick comments.
>> > > > We should be consistent in the naming, and rename `Halfloat*` to `Float16*`.
>> > > 
>> > > 
>> > > I concur, especially since there are multiple 16-bit floating-point formats in use including the IEEE 754 float16 as well as bfloat16.
>> > 
>> > 
>> > There are nomenclature issues that I am facing. Currently, all the Float16 concrete classes use the Halffloat prefix i.e., Halffloat64Vector, Halffloat128Vector; converting these to Float16 looks a little confusing, i.e., Float1664Vector, Float16128Vector, etc Kindly suggest a better name to represent these classes.
>> 
>> Maybe we move the shape to the end e.g., `Float16Vector128`, `IntVector128`, `IntVectorMax`?
> 
> This looks good, since all these are concrete vector classes not exposed to users.

@jatin-bhateja it looks like you should be merging latest changes from master; Some changes shown in the diff obviously do not belong to this fix:
https://github.com/openjdk/jdk/pull/28002/files#diff-7798f606ce2bbf96fd99999c8c0ef9a4bb0455c128dd7e1249dea8db23d35402
Hopefully merging latest changes from master will make them go away?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28002#issuecomment-3571013379

From jbhateja at openjdk.org  Mon Nov 24 19:29:14 2025
From: jbhateja at openjdk.org (Jatin Bhateja)
Date: Mon, 24 Nov 2025 19:29:14 GMT
Subject: RFR: 8370691: Add new Float16Vector type and enable
 intrinsification of vector operations supported by auto-vectorizer [v3]
In-Reply-To: 
References: 
Message-ID: <6ma1bZs5YmEe_PtNmR69pVoJ_YAWy5fUQrsnnk8nH9M=.0594b623-f494-4af3-8e1c-f88120c53aca@github.com>

> Add a new  Float16lVector type and corresponding concrete vector classes, in addition to existing primitive vector types, maintaining operation parity with the FloatVector type.
> - Add necessary inline expander support.
>    - Enable intrinsification for a few vector operations, namely ADD/SUB/MUL/DIV/MAX/MIN/FMA.
> - Use existing Float16 vector IR and backend support.
> - Extended the existing VectorAPI JTREG test suite for the newly added Float16Vector operations.
>  
> The idea here is to first be at par with Float16 auto-vectorization support before intrinsifying new operations (conversions, reduction, etc).
> 
> The following are the performance numbers for some of the selected Float16Vector benchmarking kernels compared to equivalent auto-vectorized Float16OperationsBenchmark kernels.
> 
> image
> 
> Initial RFP[1] was floated on the panama-dev mailing list.
> 
> Kindly review the draft PR and share your feedback.
> 
> Best Regards,
> Jatin
> 
> [1] https://mail.openjdk.org/pipermail/panama-dev/2025-August/021100.html

Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:

 - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8370691
 - Cleanups
 - Adding support for custom basic  type T_FLOAT16, passing BasicType lane types to inline expander entries
 - Cleaning up interface as per review suggestions
 - Some cleanups
 - Fix some JTREG failures
 - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8370691
 - Revamped JTreg test generation and bug fixes
 - Cleanups
 - Removing redundant warmup constraint
 - ... and 5 more: https://git.openjdk.org/jdk/compare/8bafc2f0...f34d324f

-------------

Changes: https://git.openjdk.org/jdk/pull/28002/files
  Webrev: Webrev is not available because diff is too large
  Stats: 509516 lines in 232 files changed: 281237 ins; 226539 del; 1740 mod
  Patch: https://git.openjdk.org/jdk/pull/28002.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28002/head:pull/28002

PR: https://git.openjdk.org/jdk/pull/28002

From jbhateja at openjdk.org  Mon Nov 24 19:29:17 2025
From: jbhateja at openjdk.org (Jatin Bhateja)
Date: Mon, 24 Nov 2025 19:29:17 GMT
Subject: RFR: 8370691: Add new Float16Vector type and enable
 intrinsification of vector operations supported by auto-vectorizer [v3]
In-Reply-To: 
References: 
 
 
 
 
 
 <8hStIcvp252Ik7raxZL5BvFKKkXTflorjyOD9Cyakvc=.c5d1b302-5c49-46b1-91ba-2feda2e6a746@github.com>
 
Message-ID: 

On Thu, 13 Nov 2025 19:47:52 GMT, Paul Sandoz  wrote:

>>> The basic type codes are declared and shared across Java and HotSpot - it's used in `LaneType`. Can we pass a single argument that is the basic type instead of two arguments. HotSpot should know from the basic type what the carrier class and also what the operation type without it being explicitly told, since presumably it knew the inverse - the basic type from the element class.
>> 
>> Hi @PaulSandoz, T_HALFFLOAT used in LaneType is mainly used for differentiation of various cache keys used by conversion operation lookups. In principle, we can extend VM to acknowledge this new custom basic type on the lines of T_METADATA / T_ADDRESS; its scope for now will be restricted to VectorSupport. We can gradually expose this to C2 type, such that TypeVect for all Float16 VectorIR uses T_HALFFLOAT as its basic type; currently, we use T_SHORT as the lane type. Let me know if this looks reasonable
>
>> > The basic type codes are declared and shared across Java and HotSpot - it's used in `LaneType`. Can we pass a single argument that is the basic type instead of two arguments. HotSpot should know from the basic type what the carrier class and also what the operation type without it being explicitly told, since presumably it knew the inverse - the basic type from the element class.
>> 
>> Hi @PaulSandoz, T_HALFFLOAT used in LaneType is mainly used for differentiation of various cache keys used by conversion operation lookups. In principle, we can extend VM to acknowledge this new custom basic type on the lines of T_METADATA / T_ADDRESS; its scope for now will be restricted to VectorSupport. We can gradually expose this to C2 type, such that TypeVect for all Float16 VectorIR uses T_HALFFLOAT as its basic type; currently, we use T_SHORT as the lane type. Let me know if this looks reasonable
> 
> I am proposing something simpler, really as a temporary step until `Float16` becomes part of the `java.base` module. IIUC from the basic type we can reliably determine what the two arguments we currently passing are e.g.,  T_HALFFLOAT = { short.class, VECTOR_TYPE_FP16 }. So we don't need to pass two arguments, we can just pass one, the intrinsic can lookup the class and operation type kind.

Hi @PaulSandoz, I have addressed your comments.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28002#issuecomment-3572377706

From vlivanov at openjdk.org  Mon Nov 24 22:59:36 2025
From: vlivanov at openjdk.org (Vladimir Ivanov)
Date: Mon, 24 Nov 2025 22:59:36 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v4]
In-Reply-To: 
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
 
Message-ID: 

On Fri, 21 Nov 2025 14:53:03 GMT, Coleen Phillimore  wrote:

>> ArrayKlass doesn't set AccessFlags so don't look for them there.  See CR for details.
>> Fixed SA and jvmci.  @iwanowww Can you check that I changed C2 correctly (we talked about this in August).
>> Tested with tier1-4.  5-7 in progress.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reformatting compile.cpp

src/hotspot/share/opto/library_call.cpp line 4100:

> 4098:     // Other types can report the actual _super.
> 4099:     // (To verify this code sequence, check the asserts in JVM_IsInterface.)
> 4100:     if (generate_interface_guard(kls, region) != nullptr)

BTW why did you decide to change the order of the checks?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2557971918

From macarte at openjdk.org  Tue Nov 25 00:58:06 2025
From: macarte at openjdk.org (Mat Carter)
Date: Tue, 25 Nov 2025 00:58:06 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v6]
In-Reply-To: 
References: 
Message-ID: 

> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The command will report back to the user one of the following messages depending on the state of the JVM:
> 
> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
> - Recording has already ended.
> - Error: Failed to end recording.
> - Recording ended successfully.
> 
> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
> 
> - Recording ended successfully.
> - Recording has already ended.
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request incrementally with one additional commit since the last revision:

  Added acquire_load and improved tests

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27965/files
  - new: https://git.openjdk.org/jdk/pull/27965/files/f1f5d77d..2223870c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=04-05

  Stats: 30 lines in 3 files changed: 24 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/27965.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965

PR: https://git.openjdk.org/jdk/pull/27965

From macarte at openjdk.org  Tue Nov 25 00:58:12 2025
From: macarte at openjdk.org (Mat Carter)
Date: Tue, 25 Nov 2025 00:58:12 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v5]
In-Reply-To: 
References: 
 
 
 
Message-ID: <2faJMusAYCjby-CJDGEQOkBywiV8yw-pGNqYzlJy2Mg=.48cebdc2-9f95-4e59-a228-e4e0a803fd40@github.com>

On Fri, 21 Nov 2025 18:43:44 GMT, Mat Carter  wrote:

>> test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 31:
>> 
>>> 29:  * @summary Sanity test for Jcmd AOT.end_recording command
>>> 30:  * @library /test/lib
>>> 31:  * @build JcmdAOTEndRecordingTest
>> 
>> No need to build test explicitly, jtreg does it by itself.
>
> Thank you, I did not know that (copied another test as a template) - I've removed the build step in the header of both tests

I tried this and it seemed to work until I modified the test then the app.jar failed to build.

>> test/hotspot/jtreg/runtime/cds/appcds/aotCache/JcmdAOTEndRecordingTest.java line 57:
>> 
>>> 55:             try {
>>> 56:                 OutputAnalyzer output = ProcessTools.executeProcess(jcmd.getCommand());
>>> 57:                 output.shouldContain("AOT.end_recording is unsupported");
>> 
>> A little bit confused.  The check doesn't match test description.
>
> This test uses Lingered apps (enabling the jcmd connection), however the test framework here doesn't support creating the AOT cache - so I simply check that the connection works and the diagnostic command returns the expected value when you aren't recording a cache
> 
> I'm trying to create an additional test that allows jcmd to end training on an AOT recording, but there's some issues merging the jcmd test support and the aot test support;  I will make it clearer in this test about this limitation

Updated the test now, it runs twice, once in training mode and once not.  And checks the appropriate response from the diagnostic command

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2558149696
PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2558153818

From macarte at openjdk.org  Tue Nov 25 01:01:19 2025
From: macarte at openjdk.org (Mat Carter)
Date: Tue, 25 Nov 2025 01:01:19 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
Message-ID: 

> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The command will report back to the user one of the following messages depending on the state of the JVM:
> 
> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
> - Recording has already ended.
> - Error: Failed to end recording.
> - Recording ended successfully.
> 
> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
> 
> - Recording ended successfully.
> - Recording has already ended.
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request incrementally with one additional commit since the last revision:

  Check exit value in tests

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27965/files
  - new: https://git.openjdk.org/jdk/pull/27965/files/2223870c..dae85272

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27965&range=05-06

  Stats: 2 lines in 2 files changed: 2 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/27965.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27965/head:pull/27965

PR: https://git.openjdk.org/jdk/pull/27965

From macarte at openjdk.org  Tue Nov 25 01:04:37 2025
From: macarte at openjdk.org (Mat Carter)
Date: Tue, 25 Nov 2025 01:04:37 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 5 Nov 2025 21:48:41 GMT, Mark Reinhold  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated test based on comments
>
> src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java line 78:
> 
>> 76:        *  specification of the corresponding JVM command-line options, please refer
>> 77:        * to https://openjdk.org/jeps/483 and https://openjdk.org/jeps/514.
>> 78:        *
> 
> Please don't use bare URLs. Change these to
> 
> ... please refer to JEPs 483 and
> 514.

fixed

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2558167839

From dlong at openjdk.org  Tue Nov 25 01:05:01 2025
From: dlong at openjdk.org (Dean Long)
Date: Tue, 25 Nov 2025 01:05:01 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v4]
In-Reply-To: 
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
 
 
Message-ID: 

On Mon, 24 Nov 2025 22:57:18 GMT, Vladimir Ivanov  wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reformatting compile.cpp
>
> src/hotspot/share/opto/library_call.cpp line 4100:
> 
>> 4098:     // Other types can report the actual _super.
>> 4099:     // (To verify this code sequence, check the asserts in JVM_IsInterface.)
>> 4100:     if (generate_interface_guard(kls, region) != nullptr)
> 
> BTW why did you decide to change the order of the checks?

I noticed that too.  It is necessary for correctness now.  It is incorrect and unsafe to use generate_interface_guard() on array after this change, because an array klass is not an InstanceKlass.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2558168496

From vlivanov at openjdk.org  Tue Nov 25 01:28:47 2025
From: vlivanov at openjdk.org (Vladimir Ivanov)
Date: Tue, 25 Nov 2025 01:28:47 GMT
Subject: RFR: 8372098: Move AccessFlags to InstanceKlass [v4]
In-Reply-To: 
References: <4LqPcDIgdyt_jaF-mX4LVsgXzaHDxmDYTFptWYVdVXc=.1b12674f-51a4-4f03-bf99-50245b016051@github.com>
 
 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:17 GMT, Dean Long  wrote:

>> src/hotspot/share/opto/library_call.cpp line 4100:
>> 
>>> 4098:     // Other types can report the actual _super.
>>> 4099:     // (To verify this code sequence, check the asserts in JVM_IsInterface.)
>>> 4100:     if (generate_interface_guard(kls, region) != nullptr)
>> 
>> BTW why did you decide to change the order of the checks?
>
> I noticed that too.  It is necessary for correctness now.  It is incorrect and unsafe to use generate_interface_guard() on array after this change, because an array klass is not an InstanceKlass.

Oh, that's subtle... It deserves a comment at least.

We could also change `LibraryCallKit::generate_interface_guard()` to require `kls` to be of type `TypeInstKlassPtr`, but then we would need a cast before calling it from `LibraryCallKit::inline_native_Class_query()`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2558217038

From cjplummer at openjdk.org  Tue Nov 25 02:48:50 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 02:48:50 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
Message-ID: 

Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.

With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.

Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).

-------------

Commit messages:
 - fix whitespace
 - disable VIRTUAL_THREAD_START adn VIRTUAL_THREAD_END unless needed

Changes: https://git.openjdk.org/jdk/pull/28485/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28485&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371380
  Stats: 328 lines in 7 files changed: 263 ins; 37 del; 28 mod
  Patch: https://git.openjdk.org/jdk/pull/28485.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28485/head:pull/28485

PR: https://git.openjdk.org/jdk/pull/28485

From cjplummer at openjdk.org  Tue Nov 25 02:48:51 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 02:48:51 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
Message-ID: 

On Tue, 25 Nov 2025 02:25:02 GMT, Chris Plummer  wrote:

> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
> 
> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
> 
> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).

The debug agent always enables VIRTUAL_THREAD_START/END. This is very detrimental to performance with apps that create a lot of virtual therads. The flood of events bogs down the debug agent, and also slows down JVMTI which needs to create a jvmtiThreadState for each thread just to deliver the event to the debug agent. 

If the debug agent includevirtualthreads option is not set to 'y' (it is 'n' by default), then it is possible for the debug agent to start up without enabling VIRTUAL_THREAD_START/END events (currently it always enables them). However, they need to be enabled if the debugger creates any ThreadStartRequests or ThreadDeathRequests and do not include the PlatformThreadsOnly filter. Given that by default jdb and mainstream debuggers all seem to add this filter, this is unlikely to be an issue.

The changes in this PR make it so the debug agent no longer automatically enables all VIRTUAL_THREAD_START/END (unless VIRTUAL_THREAD_START=y), and instead only enables them based on to the presence of ThreadStartRequests or ThreadDeathRequests that don't set the PlatformThreadsOnly filter.

Also, for ThreadDeathRequests that don't set the PlatformThreadsOnly filter but do set the thread filter, VIRTUAL_THREAD_END events are only enabled for the thread that is being filtered on. This is important for debuggers (like jdb) that register a ThreadDeathRequest for any ThreadReference the debugger is tracking, and want to stop tracking once the thread exits.

One challenge with these changes was getting the event enabling/disabling right in eventFilter.c. Disabling was especially tricky because when removing an event request, all other event requests (of the same kind) have to be examined to see if any still require the event to be enabled. If there is a filter thread, that also needs to be considered.

The other challenge was dealing with the fact that without VIRTUAL_THREAD_END events, you can end up with terminated threads on the runningVThreads list. There were a few places that had to be special cased to deal with this.

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 1640:

> 1638: 
> 1639:         if (gdata->vthreadsSupported) {
> 1640:             // Now is a good time to garbage collect vthread nodes.

The original comment at one point was true while I was working on the previous PR that introduced it. However, I later added a check for (node->suspendCount == suspendAllCount) to freeUnusedVThreadNode(). If true, then we can free the ThreadNode even though it has a non-zero suspendCount. If the ThreadNode is recreated at some point in the future, it will get suspendAllCount assigned to node->suspendCount.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28485#issuecomment-3573531199
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2558355260

From jbhateja at openjdk.org  Tue Nov 25 09:05:54 2025
From: jbhateja at openjdk.org (Jatin Bhateja)
Date: Tue, 25 Nov 2025 09:05:54 GMT
Subject: RFR: 8370691: Add new Float16Vector type and enable
 intrinsification of vector operations supported by auto-vectorizer [v4]
In-Reply-To: 
References: 
Message-ID: 

> Add a new  Float16lVector type and corresponding concrete vector classes, in addition to existing primitive vector types, maintaining operation parity with the FloatVector type.
> - Add necessary inline expander support.
>    - Enable intrinsification for a few vector operations, namely ADD/SUB/MUL/DIV/MAX/MIN/FMA.
> - Use existing Float16 vector IR and backend support.
> - Extended the existing VectorAPI JTREG test suite for the newly added Float16Vector operations.
>  
> The idea here is to first be at par with Float16 auto-vectorization support before intrinsifying new operations (conversions, reduction, etc).
> 
> The following are the performance numbers for some of the selected Float16Vector benchmarking kernels compared to equivalent auto-vectorized Float16OperationsBenchmark kernels.
> 
> image
> 
> Initial RFP[1] was floated on the panama-dev mailing list.
> 
> Kindly review the draft PR and share your feedback.
> 
> Best Regards,
> Jatin
> 
> [1] https://mail.openjdk.org/pipermail/panama-dev/2025-August/021100.html

Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:

  Fix failing jtreg test in CI

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28002/files
  - new: https://git.openjdk.org/jdk/pull/28002/files/f34d324f..aca6cc5d

Webrevs:
 - full: Webrev is not available because diff is too large
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28002&range=02-03

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28002.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28002/head:pull/28002

PR: https://git.openjdk.org/jdk/pull/28002

From mbaesken at openjdk.org  Tue Nov 25 09:08:30 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Tue, 25 Nov 2025 09:08:30 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v4]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Mon, 24 Nov 2025 14:53:33 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Set the -dead_strip linker option only for the JDK libs

Any comments on the recent version ? 
The dead_strip option seems to the rather similar to the link time gc option we support for gcc currently and offer this configure flag 

make/autoconf/jdk-options.m4


112   UTIL_ARG_ENABLE(NAME: linktime-gc, DEFAULT: $LINKTIME_GC_DEFAULT,
113       DEFAULT_DESC: [auto], RESULT: ENABLE_LINKTIME_GC,
114       DESC: [use link time gc on unused code sections in the JDK build],
115       CHECKING_MSG: [if linker should clean out unused code (linktime-gc)])
116   AC_SUBST(ENABLE_LINKTIME_GC)



Should we also put the dead_strip behind this configure flag and rephrase the description above a little bit , e.g.
`114       DESC: [use link time gc or similar features on unused code sections in the JDK build],`

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3574548509

From sspitsyn at openjdk.org  Tue Nov 25 09:13:57 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Tue, 25 Nov 2025 09:13:57 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
Message-ID: 

On Tue, 25 Nov 2025 02:25:02 GMT, Chris Plummer  wrote:

> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
> 
> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
> 
> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).

src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1444:

> 1442:                 } else {
> 1443:                     error = threadControl_setEventMode(JVMTI_DISABLE, EI_VIRTUAL_THREAD_END, thread);
> 1444:                 }

Q: Why is the `THREAD_START` event disabled globally (for all threads) but the `THREAD_END` event is disabled for specific thread?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2559181531

From sspitsyn at openjdk.org  Tue Nov 25 09:16:06 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Tue, 25 Nov 2025 09:16:06 GMT
Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v18]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 08:36:02 GMT, Johan Sj?len  wrote:

>> Hi,
>> 
>> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`.
>> 
>> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately.
>> 
>> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc.
>> 
>> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement.
>> 
>> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again.
>
> Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision:
> 
>   IDE doesn't help you with VM structs!

Marked as reviewed by sspitsyn (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/27198#pullrequestreview-3504064826

From mbaesken at openjdk.org  Tue Nov 25 09:26:11 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Tue, 25 Nov 2025 09:26:11 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v4]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Mon, 24 Nov 2025 14:53:33 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Set the -dead_strip linker option only for the JDK libs

Here are some current values  (build from last evening 24th Nov.) for JDK native libs where I see a noticeable effect in size reduction with this PR (values in K without `->` with the flag , product build, XCode 15 used)

1216 ->  1188    /jdk/lib/libawt_lwawt.dylib
1348 ->  1036    /jdk/lib/libfontmanager.dylib
636	 ->  620     /jdk/lib/libfreetype.dylib
264  ->  248     /jdk/lib/libjavajpeg.dylib
312	 ->  292     /jdk/lib/libjdwp.dylib
152 -> 132       /jdk/lib/libjli.dylib
388 -> 296       /jdk/lib/liblcms.dylib
500 -> 484     /jdk/lib/libmlib_image.dylib
164 -> 128     /jdk/lib/libzip.dylib

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3574624069

From ysuenaga at openjdk.org  Tue Nov 25 11:45:20 2025
From: ysuenaga at openjdk.org (Yasumasa Suenaga)
Date: Tue, 25 Nov 2025 11:45:20 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v3]
In-Reply-To: 
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
 
Message-ID: 

On Thu, 20 Nov 2025 01:25:45 GMT, Yasumasa Suenaga  wrote:

>> We've fixed mixed mode jstack for the debuggee running with `-Xcomp` in [JDK-8370176](https://bugs.openjdk.org/browse/JDK-8370176), but it was not enough. We need to handle like unifying `CFrame` and `Frame` in stack unwinding as possible, and need to change how to get caller SP/FP from stack.
>> 
>> This PR works fine on both Linux AMD64 and Linux AArch64. All of `hotspot/jtreg/serviceability/sa` tests have been passed on both platforms.
>> 
>> Big thanks to @pchilano for your help!
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix for macOS

PING: could you review this?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3575231530

From kevinw at openjdk.org  Tue Nov 25 12:07:18 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Tue, 25 Nov 2025 12:07:18 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 13 Nov 2025 19:55:24 GMT, Mat Carter  wrote:

>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>> 
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>> 
>> TRUE
>> FALSE
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove single whitespace

src/jdk.management/share/classes/com/sun/management/internal/HotSpotAOTCacheImpl.java line 48:

> 46:     }
> 47: 
> 48:     public boolean endRecording(){

trivial missing space nit (){

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2559745591

From kevinw at openjdk.org  Tue Nov 25 12:13:41 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Tue, 25 Nov 2025 12:13:41 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 13 Nov 2025 19:55:24 GMT, Mat Carter  wrote:

>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>> 
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>> 
>> TRUE
>> FALSE
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove single whitespace

src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java line 192:

> 190:                 HotSpotAOTCacheMXBean impl = this.impl;
> 191:                 if (impl == null) {
> 192:                     this.impl = impl = new HotSpotAOTCacheImpl(ManagementFactoryHelper.getVMManagement());

This assignment is unusual.  Are we trying to avoid a synchronized block? Other nameToMBeanMap() methods are like:
	return Collections.singletonMap(ManagementFactory.MEMORY_MXBEAN_NAME, ManagementFactoryHelper.getMemoryMXBean());
	
..where the ManagementFactoryHelper.getMemoryMXBean() method is synchronized and creates the impl if needed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2559762899

From alanb at openjdk.org  Tue Nov 25 12:26:32 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Tue, 25 Nov 2025 12:26:32 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Tue, 25 Nov 2025 12:10:02 GMT, Kevin Walls  wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove single whitespace
>
> src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java line 192:
> 
>> 190:                 HotSpotAOTCacheMXBean impl = this.impl;
>> 191:                 if (impl == null) {
>> 192:                     this.impl = impl = new HotSpotAOTCacheImpl(ManagementFactoryHelper.getVMManagement());
> 
> This assignment is unusual.  Are we trying to avoid a synchronized block? Other nameToMBeanMap() methods are like:
> 	return Collections.singletonMap(ManagementFactory.MEMORY_MXBEAN_NAME, ManagementFactoryHelper.getMemoryMXBean());
> 	
> ..where the ManagementFactoryHelper.getMemoryMXBean() method is synchronized and creates the impl if needed.

I don't see a correctly issue with this. Maybe in the future we will be able to use LazyConstant here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2559800006

From mbaesken at openjdk.org  Tue Nov 25 13:12:06 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Tue, 25 Nov 2025 13:12:06 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v5]
In-Reply-To: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
Message-ID: 

> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  Use dead_strip on macOS arrch64 AND x86_64

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28319/files
  - new: https://git.openjdk.org/jdk/pull/28319/files/b63b9ca8..c158747f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=03-04

  Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28319/head:pull/28319

PR: https://git.openjdk.org/jdk/pull/28319

From mbaesken at openjdk.org  Tue Nov 25 13:12:08 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Tue, 25 Nov 2025 13:12:08 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v4]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: <5_ovGdYHonxBCe-7ftDT2kErYBHe-8HPv0cwme_2Mj8=.1479051a-0fa5-455f-89c3-1312f2d16017@github.com>

On Mon, 24 Nov 2025 14:53:33 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Set the -dead_strip linker option only for the JDK libs

Now we only set the flag for the JDK native libs, so I enabled it also for macOS x86_64 .

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3575562810

From kevinw at openjdk.org  Tue Nov 25 13:16:15 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Tue, 25 Nov 2025 13:16:15 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

test/hotspot/jtreg/runtime/cds/appcds/aotCache/DiagnosticCommandMBeanTest.java line 152:

> 150:                 System.out.println("Failed to stop recording");
> 151:             }
> 152:         } catch (MBeanException e) {

Can we catch Exception here generally, and print the stacktrace so we can see what happened if there are failures?

Then print the "Exception occurred!" so it's seen by the caller and the test fails.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2559943955

From kevinw at openjdk.org  Tue Nov 25 13:30:23 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Tue, 25 Nov 2025 13:30:23 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

Looking good I think.

A possible general issue is that the AOT implementation of the dumping may write mesages on tty-> but they are not captured by the jcmd.  Not too much of an issue for a training run as presumably the app is being monitored by whoever asks for the endRecording() to happen.  I think the plan for now would be: should the jcmd fail, you check the app output for possibly more detail.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3575650962

From jsjolen at openjdk.org  Tue Nov 25 13:43:31 2025
From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=)
Date: Tue, 25 Nov 2025 13:43:31 GMT
Subject: RFR: 8367656: Refactor Constantpool's operand array into two [v18]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 20 Nov 2025 08:36:02 GMT, Johan Sj?len  wrote:

>> Hi,
>> 
>> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`.
>> 
>> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately.
>> 
>> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc.
>> 
>> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement.
>> 
>> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again.
>
> Johan Sj?len has updated the pull request incrementally with one additional commit since the last revision:
> 
>   IDE doesn't help you with VM structs!

Thank you all for your reviews :-).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27198#issuecomment-3575718289

From jsjolen at openjdk.org  Tue Nov 25 13:46:41 2025
From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=)
Date: Tue, 25 Nov 2025 13:46:41 GMT
Subject: Integrated: 8367656: Refactor Constantpool's operand array into two
In-Reply-To: 
References: 
Message-ID: 

On Wed, 10 Sep 2025 16:19:17 GMT, Johan Sj?len  wrote:

> Hi,
> 
> This is a refactoring of the way that we store the Bootstrap method attribute in the ConstantPool class. We used to have a single `Array` which was divided into a section of `u4` offsets and a section which was the actual data. In this refactoring we make this split more clear, by actually allocating an `Array` to store the offsets in and an `Array` to store the data in. These arrays are then put into a `BSMAttributeEntries` class, which allows us to separate out the API from that of the rest of the `ConstantPool`.
> 
> We had multiple instances of the code knowing the layout of the operands array and using this to do 'clever' ways of copying and inserting data into it. See `ConstantPool::copy_operands` and `ConstantPool::resize_operands`. I felt like we could do things in a simpler way, so I added the `start_/end_extension` protocol and added the `InsertionIterator` for this. See `ClassFileParser::parse_classfile_bootstrap_methods_attribute` for how this works. I put several relevant definitions into the inline file in hopes of encouraging the compiler to optimize these appropriately.
> 
> For the Java SA code, I had to add a `U4Array` class. I also had to fix the vmstructs definitions, etc.
> 
> On the whole, while this code is a bit less terse, I think it's a good API improvement and the underlying implementation of splitting up the operands array is also an improvement.
> 
> Testing: Oracle Tier1-Tier5 has been run succesfully multiple times. Before integration, I will merge with master and run these tiers again.

This pull request has now been integrated.

Changeset: d94c52cc
Author:    Johan Sj?len 
URL:       https://git.openjdk.org/jdk/commit/d94c52ccf2fed3fc66d25a34254c9b581c175fa1
Stats:     895 lines in 12 files changed: 436 ins; 282 del; 177 mod

8367656: Refactor Constantpool's operand array into two

Reviewed-by: coleenp, sspitsyn, dholmes

-------------

PR: https://git.openjdk.org/jdk/pull/27198

From erikj at openjdk.org  Tue Nov 25 14:03:31 2025
From: erikj at openjdk.org (Erik Joelsson)
Date: Tue, 25 Nov 2025 14:03:31 GMT
Subject: RFR: 8371893: [macOS aarch64] use dead_strip linker option to
 reduce binary size [v5]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Tue, 25 Nov 2025 13:12:06 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use dead_strip on macOS arrch64 AND x86_64

Marked as reviewed by erikj (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28319#pullrequestreview-3505215274

From cjplummer at openjdk.org  Tue Nov 25 16:35:50 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 16:35:50 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 09:09:50 GMT, Serguei Spitsyn  wrote:

>> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
>> 
>> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
>> 
>> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).
>
> src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1444:
> 
>> 1442:                 } else {
>> 1443:                     error = threadControl_setEventMode(JVMTI_DISABLE, EI_VIRTUAL_THREAD_END, thread);
>> 1444:                 }
> 
> Q: Why is the `THREAD_START` event disabled globally (for all threads) but the `THREAD_END` event is disabled for specific thread?

THREAD_START can't have a thread filter. THREAD_END can. "thread" == requestThread(node) == the thread filter if there is one, so when disabling THREAD_START it could be an actual thread or it could just be NULL. For THREAD_START "thread" should always be NULL, so I suppose I could have just asserted that and used "thread" as the argument instead of "NULL".

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2560664560

From cjplummer at openjdk.org  Tue Nov 25 17:36:21 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 17:36:21 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
 
Message-ID: 

On Tue, 25 Nov 2025 16:32:11 GMT, Chris Plummer  wrote:

>> src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1444:
>> 
>>> 1442:                 } else {
>>> 1443:                     error = threadControl_setEventMode(JVMTI_DISABLE, EI_VIRTUAL_THREAD_END, thread);
>>> 1444:                 }
>> 
>> Q: Why is the `THREAD_START` event disabled globally (for all threads) but the `THREAD_END` event is disabled for specific thread?
>
> THREAD_START can't have a thread filter. THREAD_END can. "thread" == requestThread(node) == the thread filter if there is one, so when disabling THREAD_START it could be an actual thread or it could just be NULL. For THREAD_START "thread" should always be NULL, so I suppose I could have just asserted that and used "thread" as the argument instead of "NULL".

Actually it appears that JDWP THREAD_START can have a filter but JVMTI THREAD_START does not allow you to set the thread to enable the events on. That means when JDWP THREAD_START events are requested and a thread filter is provided, JVMTI THREAD_START needs to be enabled for all threads. That's actually how it is working now. I tried adding the assert and it was triggered. So that means passing "thread" instead of NULL would sometimes end up passing an actual thread to JVMTI and it would produce a [JVMTI_ERROR_ILLEGAL_ARGUMENT in that case.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2560862724

From lmesnik at openjdk.org  Tue Nov 25 17:41:33 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Tue, 25 Nov 2025 17:41:33 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 =?UTF-8?B?bnNrX2p2bXRpX3NldEZhaWxTdOKApg==?=
Message-ID: 

Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().

I run jvmti tests with different options and probelmlisted the only failing tests.


The previous attempt uncover a lot of problems related to the 
[JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
The events might be generated after VM_DEATH event

-------------

Commit messages:
 - 8352654: [REDO] nsk/jvmti/ tests should fail when nsk_jvmti_setFailStatus() is called

Changes: https://git.openjdk.org/jdk/pull/28404/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28404&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8352654
  Stats: 5 lines in 2 files changed: 5 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28404.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28404/head:pull/28404

PR: https://git.openjdk.org/jdk/pull/28404

From cjplummer at openjdk.org  Tue Nov 25 19:16:36 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 19:16:36 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Tue, 25 Nov 2025 17:33:04 GMT, Chris Plummer  wrote:

>> THREAD_START can't have a thread filter. THREAD_END can. "thread" == requestThread(node) == the thread filter if there is one, so when disabling THREAD_START it could be an actual thread or it could just be NULL. For THREAD_START "thread" should always be NULL, so I suppose I could have just asserted that and used "thread" as the argument instead of "NULL".
>
> Actually it appears that JDWP THREAD_START can have a filter but JVMTI THREAD_START does not allow you to set the thread to enable the events on. That means when JDWP THREAD_START events are requested and a thread filter is provided, JVMTI THREAD_START needs to be enabled for all threads. That's actually how it is working now. I tried adding the assert and it was triggered. So that means passing "thread" instead of NULL would sometimes end up passing an actual thread to JVMTI and it would produce a [JVMTI_ERROR_ILLEGAL_ARGUMENT in that case.

There  is a bug in the call to eventHandlerRestricted_iterator() at line 1436. For VIRTUAL_THREAD_START I should be explicitly passing in NULL for the thread. Otherwise it will consider the thread when deciding if other event handlers are a match to this one, and I don't think we want that. It could lead to disabling VIRTUAL_THREAD_START events when we shouldn't. Seems we don't have any tests for this but I modified an existing test and got a failure. The test creates a ThreadStartRequest with a thread filter and expects that to trigger a ThreadStartEvent for the filter thread. If I create a second ThreadStartRequest with a filter on a different thread, enable it, and then disable it, that ends up disabling all VIRTUAL_THREAD_START events, and the expected event never arrives. Passing NULL fixes the problem.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2561121225

From pchilanomate at openjdk.org  Tue Nov 25 19:58:40 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:40 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
 
Message-ID: <-MtOiSQVDvlQD7sbfeBiqF00_ZN9_aNt3zd2LZLljyo=.eeabb717-359d-4420-89aa-ed1b305beee5@github.com>

On Thu, 20 Nov 2025 22:17:53 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add Alan's comment in VirtualThread
>
> src/hotspot/share/classfile/javaClasses.cpp line 1757:
> 
>> 1755:   jint* addr = java_thread->field_addr(_VTMS_transition_disable_count_offset);
>> 1756:   int val = AtomicAccess::load(addr);
>> 1757:   AtomicAccess::store(addr, val + 1);
> 
> Suggestion:
> 
>   AtomicAccess::inc(addr);

Same here.

> src/hotspot/share/classfile/javaClasses.cpp line 1764:
> 
>> 1762:   jint* addr = java_thread->field_addr(_VTMS_transition_disable_count_offset);
>> 1763:   int val = AtomicAccess::load(addr);
>> 1764:   AtomicAccess::store(addr, val - 1);
> 
> Suggestion:
> 
>   AtomicAccess::dec(addr);

I?d prefer to leave it as a plain store to avoid the unnecessary extra fence.

> src/hotspot/share/opto/runtime.hpp line 740:
> 
>> 738:     return vthread_transition_Type();
>> 739:   }
>> 740: 
> 
> I do not know C2 but this looks really strange - 4 different functions all return the same thing. ???

We need to define them because the `GEN_C2_STUB` macro will look for the type of the C function based on its name (`C2_STUB_TYPEFUNC(name)`), otherwise we get a compilation failure. The four C functions have the same type though so they all return `_vthread_transition_Type`.

> src/hotspot/share/runtime/handshake.cpp line 374:
> 
>> 372:     JavaThread* target = java_lang_Thread::thread(carrier_thread);
>> 373:     assert(target != nullptr, "");
>> 374:     // Technically there is need for a ThreadsListHandle since the target
> 
> Suggestion:
> 
>     // Technically there is no need for a ThreadsListHandle since the target
> 
> ?

Yes, fixed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561198741
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561198549
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561200538
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561202212

From pchilanomate at openjdk.org  Tue Nov 25 19:58:34 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:34 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v5]
In-Reply-To: 
References: 
Message-ID: <8QdmTglMpQwGWG0QeQLbeduPrF1qZkah-9RzQwSOQuY=.fa030def-7674-48e3-bc25-23358009ed87@github.com>

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  David's comments

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/10534b33..b54594c4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=03-04

  Stats: 46 lines in 4 files changed: 18 ins; 1 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Tue Nov 25 19:58:43 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:43 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v5]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 20 Nov 2025 22:26:26 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   David's comments
>
> src/hotspot/share/prims/jvm.cpp line 3668:
> 
>> 3666:   if (!DoJVMTIVirtualThreadTransitions) {
>> 3667:     assert(!JvmtiExport::can_support_virtual_threads(), "sanity check");
>> 3668:     return;
> 
> Does this not still need checking somewhere?

The check for `DoJVMTIVirtualThreadTransitions` was moved to the `JVMTIStartTransition\JVMTIEndTransition` classes, but I guess you refer to the assert: I missed to move it. Added now too.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561201839

From pchilanomate at openjdk.org  Tue Nov 25 19:58:45 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:45 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Sat, 22 Nov 2025 08:37:39 GMT, Serguei Spitsyn  wrote:

>> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 147:
>> 
>>> 145:       MonitorLocker ml(VTMSTransition_lock);
>>> 146:       while (is_start_transition_disabled(current, vth())) {
>>> 147:         ml.wait(200);
>> 
>> I see a lot of timed-waits throughout this code. Is that because we poll rather than synchronizing properly? All this potential busy-waiting is surely going to cause performance glitches.
>
> The timeouts are for reliability purposes only. Technically, they are not needed and can be removed after this code becomes stable. The `wait()` calls are inside while loop which rechecks the loop-ending conditions.

I tried to minimize the changes with respect to the current code so I kept the timed-waits. As Serguei points out we should be able to remove this particular one. As for the ones executed by the disablers, we could make them poll for the transition bits in a loop with backoff, similar to how we do it in safepoint and handshake cases. But I agree with Serguei we should do it in a separate bug once the code is stable.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561204423

From pchilanomate at openjdk.org  Tue Nov 25 19:58:47 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:47 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Fri, 21 Nov 2025 01:01:48 GMT, David Holmes  wrote:

>> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 162:
>> 
>>> 160:   // be executed once we go back to Java. If this is an unmount, the handshake that the
>>> 161:   // disabler executed against this carrier thread already provided the needed synchronization.
>>> 162:   // This matches the release fence in xx_enable_for_one()/xx_enable_for_all().
>> 
>> Subtle. Do we have comments where the fences are to ensure people realize the fence is serving this purpose?
>
> I also forgot to suggest a wording change: say "pairs with" rather than "matches". Reading back through I realize now I have misunderstood many of these comments.

Changed to `pairs with`. I rewrote the comments so hopefully?they are more clear now. I also added a comment in `VirtualThread.mount/unmount` where the memory barriers should be.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561205763

From pchilanomate at openjdk.org  Tue Nov 25 19:58:53 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:58:53 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 00:42:32 GMT, David Holmes  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename VM methods for endFirstTransition/startFinalTransition
>
> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 277:
> 
>> 275: 
>> 276:   // Start of the critical region. Prevent future memory
>> 277:   // operations to be ordered before we read the transition flag.
> 
> Does this refer to `java_lang_Thread::is_in_VTMS_transition(_vthread())`? If so perhaps that should internally perform the `load_acquire`?

Yes, but that would also call for doing the same with `JavaThread::_is_in_VTMS_transition` for the `VTMS_transition_disable_for_all` case, and also have the pairing release stores by the virtual thread in `end_transition` on those same addresses, otherwise it would be confusing. And same with the other side, i.e doing load_acquire by the virtual thread of `_VTMS_transition_disable_count` and `_global_start_transition_disable_count` on `start_transition` and release store by the disabler when enabling transitions again. But I wanted to avoid unnecessary barriers in the virtual thread transition side, so I kept them as plain load/stores with separate memory barriers when necessary.

> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 307:
> 
>> 305:   // Block while some mount/unmount transitions are in progress.
>> 306:   // Debug version fails and prints diagnostic information.
>> 307:   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
> 
> This looks very odd, having an assignment in the loop condition check and no actual loop-update expression.

Yes, from what I see this same construct is used in many places. Seems this is valid because a pointer used in a boolean context evaluates to false if nullptr and true if non-null. :)

> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 316:
> 
>> 314:   // operations to be ordered before we read the transition flags.
>> 315:   // This matches the release fence in end_transition().
>> 316:   OrderAccess::acquire();
> 
> Surely the use of the iterator already provides the necessary ordering guarantee here as well. ?

We still need it because we need to prevent reordering of loads from the critical section with loads of `jt->is_in_VTMS_transition()`.

> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 327:
> 
>> 325:   // End of the critical section. Prevent previous memory operations to
>> 326:   // be ordered after we clear the clear the disable transition flag.
>> 327:   // This matches the equivalent acquire fence in start_transition().
> 
> Suggestion:
> 
>   // This pairs with the acquire in start_transition().
> 
> I just realized you are using "fence" to describe release and acquire memory barrier semantics. Given we have an operation `fence` I find this confusing for the reader - especially when we also have a `release_store_fence` operation which might be confused with "release fence".

Right, I changed it now to use the terms acquire and release barrier respectively.

> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 370:
> 
>> 368:   assert(VTMSTransition_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint(), "Must be locked");
>> 369:   assert(_global_start_transition_disable_count >= 0, "");
>> 370:   AtomicAccess::store(&_global_start_transition_disable_count, _global_start_transition_disable_count + 1);
> 
> Suggestion:
> 
>   AtomicAccess::inc(&_global_start_transition_disable_count);

I?d prefer to leave it as a plain store to avoid the unnecessary extra fence.

> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 376:
> 
>> 374:   assert(VTMSTransition_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint(), "Must be locked");
>> 375:   assert(_global_start_transition_disable_count > 0, "");
>> 376:   AtomicAccess::store(&_global_start_transition_disable_count, _global_start_transition_disable_count - 1);
> 
> Suggestion:
> 
>   AtomicAccess::dec(&_global_start_transition_disable_count);

Same here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561208616
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561210899
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561216984
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561219344
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561219842
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561220292

From pchilanomate at openjdk.org  Tue Nov 25 19:59:38 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 19:59:38 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Fri, 21 Nov 2025 01:23:17 GMT, David Holmes  wrote:

> > we follow the classic Dekker pattern for the required synchronization.
> 
> My understanding is that Dekker requires a "full fence" between the accesses, not just ordering memory barriers. The two variables involved must be published to all readers for the algorithm to work.
>
No need to argue too much about this one because `StoreLoad` is implemented as a full fence so we can easily change it, but from reading the definitions in `OrderAccess` my understanding was that technically it should be enough. The `StoreStore` comment clarifies the meaning of word `completes` (used later in `StoreLoad`) as `the effect on memory of Store1 is made visible to other processors`.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28361#issuecomment-3577347289

From pchilanomate at openjdk.org  Tue Nov 25 20:10:56 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 20:10:56 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v6]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  Remove INCLUDE_JVMTI macro

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/b54594c4..4c598ad4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=04-05

  Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Tue Nov 25 20:11:00 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 20:11:00 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: <6WDKeD8iQTXDPhR0ohPvA6KVufW0uXHBmyZ5oOWfYWI=.44d63e7f-fbdb-47b6-8b36-f0d0cb35fb91@github.com>
References: 
 
 <6WDKeD8iQTXDPhR0ohPvA6KVufW0uXHBmyZ5oOWfYWI=.44d63e7f-fbdb-47b6-8b36-f0d0cb35fb91@github.com>
Message-ID: 

On Sat, 22 Nov 2025 07:52:40 GMT, Serguei Spitsyn  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename VM methods for endFirstTransition/startFinalTransition
>
> src/hotspot/share/runtime/javaThread.cpp line 1173:
> 
>> 1171: bool JavaThread::java_suspend(bool register_vthread_SR) {
>> 1172: #if INCLUDE_JVMTI
>> 1173:   // Suspending a JavaThread in VTMS transition or disabling VTMS transitions can cause deadlocks.
> 
> Q: I wonder if the `#if INCLUDE_JVMTI` and `#endif` can be removed here.

Yes, removed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561254972

From pchilanomate at openjdk.org  Tue Nov 25 20:11:03 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 20:11:03 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Sat, 22 Nov 2025 08:22:34 GMT, Serguei Spitsyn  wrote:

>> src/hotspot/share/runtime/mountUnmountDisabler.hpp line 52:
>> 
>>> 50:   // parameter is_SR: suspender or resumer
>>> 51:   MountUnmountDisabler(bool exlusive = false);
>>> 52:   MountUnmountDisabler(oop thread_oop);
>> 
>> What does the comment mean here?
>
> This comment is stale now and must be removed. The parameter `is_SR` is being replaced with the `exclusive`.

Right, removed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561250374

From amenkov at openjdk.org  Tue Nov 25 20:36:15 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Tue, 25 Nov 2025 20:36:15 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 21 Nov 2025 19:45:04 GMT, Serguei Spitsyn  wrote:

>> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
>> 
>> This fix is to avoid enforcing the `interp-only` execution mode for threads when `FramePop` events are enabled with the JVMTI `SetEventNotificationMode()`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` optimization by the function `InterpreterRuntime::frequency_counter_overflow_inner()`. (Big thanks to @fisk for this suggestion!) Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
>> The other details will be provided in the first PR request comment.
>> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
>> 
>> Testing:
>>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>>  - submitted mach5 tiers 1-6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: fix typo in a EATests.java comment

src/hotspot/share/prims/jvmtiThreadState.cpp line 707:

> 705:   for (int idx = 0; idx  < deopts->length(); idx++) {
> 706:     int frame_number = deopts->at(idx);
> 707:     deopts->remove_at(idx);

The code forward iterates the array removing the entries? it will skip every other element (indexes change after removal)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28407#discussion_r2561326190

From cjplummer at openjdk.org  Tue Nov 25 20:49:53 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Tue, 25 Nov 2025 20:49:53 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
 
 
 
Message-ID: 

On Tue, 25 Nov 2025 19:13:44 GMT, Chris Plummer  wrote:

>> Actually it appears that JDWP THREAD_START can have a filter but JVMTI THREAD_START does not allow you to set the thread to enable the events on. That means when JDWP THREAD_START events are requested and a thread filter is provided, JVMTI THREAD_START needs to be enabled for all threads. That's actually how it is working now. I tried adding the assert and it was triggered. So that means passing "thread" instead of NULL would sometimes end up passing an actual thread to JVMTI and it would produce a [JVMTI_ERROR_ILLEGAL_ARGUMENT in that case.
>
> There  is a bug in the call to eventHandlerRestricted_iterator() at line 1436. For VIRTUAL_THREAD_START I should be explicitly passing in NULL for the thread. Otherwise it will consider the thread when deciding if other event handlers are a match to this one, and I don't think we want that. It could lead to disabling VIRTUAL_THREAD_START events when we shouldn't. Seems we don't have any tests for this but I modified an existing test and got a failure. The test creates a ThreadStartRequest with a thread filter and expects that to trigger a ThreadStartEvent for the filter thread. If I create a second ThreadStartRequest with a filter on a different thread, enable it, and then disable it, that ends up disabling all VIRTUAL_THREAD_START events, and the expected event never arrives. Passing NULL fixes the problem.

Ok, the last problem I pointed out is fixed now. The fix was done in matchHasNoPlatformThreadsOnlyFilter(). I was going to pass NULL for "thread" when ei == EI_THREAD_START, but this turned out not to be enough and changes were also needed in matchHasNoPlatformThreadsOnlyFilter(). Once those changes were in place there was no longer a need to pass NULL for "thread".

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2561360150

From amenkov at openjdk.org  Tue Nov 25 21:20:14 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Tue, 25 Nov 2025 21:20:14 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called
In-Reply-To: 
References: 
Message-ID: 

On Wed, 19 Nov 2025 23:45:36 GMT, Leonid Mesnik  wrote:

> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
> 
> I run jvmti tests with different options and probelmlisted the only failing tests.
> 
> 
> The previous attempt uncover a lot of problems related to the 
> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
> The events might be generated after VM_DEATH event

Need to update copyright yer in agent_tools.cpp
Did you tested it with tiers5-7?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28404#issuecomment-3577626376

From sspitsyn at openjdk.org  Tue Nov 25 22:33:20 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Tue, 25 Nov 2025 22:33:20 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
 
 
 
 
Message-ID: 

On Tue, 25 Nov 2025 20:47:26 GMT, Chris Plummer  wrote:

>> There  is a bug in the call to eventHandlerRestricted_iterator() at line 1436. For VIRTUAL_THREAD_START I should be explicitly passing in NULL for the thread. Otherwise it will consider the thread when deciding if other event handlers are a match to this one, and I don't think we want that. It could lead to disabling VIRTUAL_THREAD_START events when we shouldn't. Seems we don't have any tests for this but I modified an existing test and got a failure. The test creates a ThreadStartRequest with a thread filter and expects that to trigger a ThreadStartEvent for the filter thread. If I create a second ThreadStartRequest with a filter on a different thread, enable it, and then disable it, that ends up disabling all VIRTUAL_THREAD_START events, and the expected event never arrives. Passing NULL fixes the problem.
>
> Ok, the last problem I pointed out is fixed now. The fix was done in matchHasNoPlatformThreadsOnlyFilter(). I was going to pass NULL for "thread" when ei == EI_THREAD_START, but this turned out not to be enough and changes were also needed in matchHasNoPlatformThreadsOnlyFilter(). Once those changes were in place there was no longer a need to pass NULL for "thread".

Sorry, I know that but keep forgetting that `ThreadStart` can not be thread-filtered. :)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2561717917

From vlivanov at openjdk.org  Tue Nov 25 22:40:03 2025
From: vlivanov at openjdk.org (Vladimir Ivanov)
Date: Tue, 25 Nov 2025 22:40:03 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

Looks good.

-------------

Marked as reviewed by vlivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27965#pullrequestreview-3507176880

From sspitsyn at openjdk.org  Tue Nov 25 22:57:29 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Tue, 25 Nov 2025 22:57:29 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v4]
In-Reply-To: 
References: 
Message-ID: 

> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
> 
> This fix is to avoid enforcing the `interp-only` execution mode for threads when `FramePop` events are enabled with the JVMTI `SetEventNotificationMode()`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` optimization by the function `InterpreterRuntime::frequency_counter_overflow_inner()`. (Big thanks to @fisk for this suggestion!) Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
> The other details will be provided in the first PR request comment.
> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
> 
> Testing:
>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>  - submitted mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  review: fix iteration order in process_vthread_pending_deopts as it uses remove_at(idx)

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28407/files
  - new: https://git.openjdk.org/jdk/pull/28407/files/5989906c..1224d1e2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=02-03

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28407.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28407/head:pull/28407

PR: https://git.openjdk.org/jdk/pull/28407

From sspitsyn at openjdk.org  Tue Nov 25 22:57:32 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Tue, 25 Nov 2025 22:57:32 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v3]
In-Reply-To: 
References: 
 
 
Message-ID: <1_e88Ls6a_9rmKaG2GzfU25i0IibBZrWVKILTznSLdI=.ad699183-7c78-4110-9212-7e11bdfa1332@github.com>

On Tue, 25 Nov 2025 20:33:48 GMT, Alex Menkov  wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review: fix typo in a EATests.java comment
>
> src/hotspot/share/prims/jvmtiThreadState.cpp line 707:
> 
>> 705:   for (int idx = 0; idx  < deopts->length(); idx++) {
>> 706:     int frame_number = deopts->at(idx);
>> 707:     deopts->remove_at(idx);
> 
> The code forward iterates the array removing the entries? it will skip every other element (indexes change after removal)

Nice catch, thanks! It is easy to forget about it. Fixed now.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28407#discussion_r2561806700

From pchilanomate at openjdk.org  Tue Nov 25 22:59:59 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Tue, 25 Nov 2025 22:59:59 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v7]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  keep preexisting rebind order for mount

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/4c598ad4..dee2b843

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=05-06

  Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From duke at openjdk.org  Tue Nov 25 23:10:50 2025
From: duke at openjdk.org (duke)
Date: Tue, 25 Nov 2025 23:10:50 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

@macarte 
Your change (at version dae852720f1bb1fba43462e1459bada2fd12ef5d) is now ready to be sponsored by a Committer.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3577970106

From coleenp at openjdk.org  Wed Nov 26 00:01:00 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Wed, 26 Nov 2025 00:01:00 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v7]
In-Reply-To: 
References: 
 
Message-ID: <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>

On Tue, 25 Nov 2025 22:59:59 GMT, Patricio Chilano Mateo  wrote:

>> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
>> 
>> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
>> 
>> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
>> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
>> 
>> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
>> 
>> - The code was previously structured in t...
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   keep preexisting rebind order for mount

First read through, mostly questions and plea for comments.    This is a nice refactoring and cleanup of some very difficult code.  You don't have to do the renaming that I requested now if you don't want to.

src/hotspot/share/classfile/javaClasses.cpp line 1688:

> 1686: int java_lang_Thread::_jvmti_thread_state_offset;
> 1687: int java_lang_Thread::_VTMS_transition_disable_count_offset;
> 1688: int java_lang_Thread::_is_in_VTMS_transition_offset;

Since you're renaming these anyway, can we drop the VTMS part?  Just call it vthread_transition_disable_count_offset and is_in_vthread_transition_offset?  There are other VTMS named things that aren't these flags but they can stay.  Maybe migrate other names at some future point.

src/hotspot/share/opto/library_call.cpp line 3046:

> 3044: }
> 3045: 
> 3046: bool LibraryCallKit::inline_native_vthread_start_transition(address funcAddr, const char* funcName, bool is_final_transition) {

Would it be helpful to add a comment above this to say what this does? This is supposed to match some non-intrinsic code and might be helpful if you referenced that here.

src/hotspot/share/prims/jvm.cpp line 3671:

> 3669: 
> 3670: JVM_ENTRY(void, JVM_VirtualThreadStartFinalTransition(JNIEnv* env, jobject vthread))
> 3671:   oop vt = JNIHandles::resolve_external_guard(vthread);

Why do the opto runtime versions set is_in_VTMTS_transition in both the java.lang.Thread and JavaThread and these don't?

src/hotspot/share/prims/jvmtiEnv.cpp line 1827:

> 1825: JvmtiEnv::ClearAllFramePops(jthread thread) {
> 1826:   ResourceMark rm;
> 1827:   MountUnmountDisabler disabler(thread);

Not for this change but I thought JVMTI had some xml code that generated prefixes for these functions.  This seems like something that could be unified somewhere tbd.

src/hotspot/share/prims/jvmtiEnvBase.cpp line 1772:

> 1770: 
> 1771:   assert(java_thread != nullptr, "sanity check");
> 1772:   assert(!java_thread->is_in_VTMS_transition(), "sanity check");

Why don't you need these asserts anymore?

src/hotspot/share/runtime/javaThread.cpp line 1152:

> 1150: bool JavaThread::is_in_VTMS_transition() const {
> 1151:   return AtomicAccess::load(&_is_in_VTMS_transition);
> 1152: }

Is the JavaThread version always the same as the java_lang_Thread::is_in_VTMS_transition(threadOop()) value?

src/hotspot/share/runtime/mountUnmountDisabler.hpp line 34:

> 32: 
> 33: class MountUnmountDisabler : public AnyObj {
> 34:   static volatile int _global_start_transition_disable_count;

Can you describe this variable - when is it set and why is there a global disabler? What does it mean to have 'n' active disablers?

A comment at the beginning of MountUnmountDisabler to say something of the effect that during virtual thread mounting and unmounting, JVMTI and operations that need to examine thread state need to be disabled.  Or is it the converse?  During JVMTI and operations that examine the state of threads, virtual thread mounting and unmounting must wait until these operations are complete.  This class is for the latter right?

src/hotspot/share/runtime/mutexLocker.cpp line 52:

> 50: Mutex*   JvmtiThreadState_lock        = nullptr;
> 51: Monitor* EscapeBarrier_lock           = nullptr;
> 52: Monitor* VTMSTransition_lock          = nullptr;

oh you could drop the name VTMS and call it VThreadTransitionLock can't you?

-------------

PR Review: https://git.openjdk.org/jdk/pull/28361#pullrequestreview-3507302896
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561864174
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561876549
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561897865
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561904709
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561910057
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561926510
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561943253
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561945493

From coleenp at openjdk.org  Wed Nov 26 00:01:01 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Wed, 26 Nov 2025 00:01:01 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v7]
In-Reply-To: <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
References: 
 
 <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
Message-ID: 

On Tue, 25 Nov 2025 23:32:40 GMT, Coleen Phillimore  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   keep preexisting rebind order for mount
>
> src/hotspot/share/runtime/javaThread.cpp line 1152:
> 
>> 1150: bool JavaThread::is_in_VTMS_transition() const {
>> 1151:   return AtomicAccess::load(&_is_in_VTMS_transition);
>> 1152: }
> 
> Is the JavaThread version always the same as the java_lang_Thread::is_in_VTMS_transition(threadOop()) value?

Why is there the same flag with the same name in both the Java class and C++ JavaThread?  Might be an efficient cache, so something should say that (if true).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561962218

From coleenp at openjdk.org  Wed Nov 26 00:01:03 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Wed, 26 Nov 2025 00:01:03 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: <6WDKeD8iQTXDPhR0ohPvA6KVufW0uXHBmyZ5oOWfYWI=.44d63e7f-fbdb-47b6-8b36-f0d0cb35fb91@github.com>
References: 
 
 <6WDKeD8iQTXDPhR0ohPvA6KVufW0uXHBmyZ5oOWfYWI=.44d63e7f-fbdb-47b6-8b36-f0d0cb35fb91@github.com>
Message-ID: 

On Sat, 22 Nov 2025 08:43:07 GMT, Serguei Spitsyn  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename VM methods for endFirstTransition/startFinalTransition
>
> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 126:
> 
>> 124:          || global_start_transition_disable_count() > base_disable_count
>> 125:          JVMTI_ONLY(|| (JvmtiVTSuspender::is_vthread_suspended(java_lang_Thread::thread_id(vthread)) || thread->is_suspended()));
>> 126: }
> 
> I like this approach with the JVMTIStartTransition and JVMTIEndTransition helper classes. It is a nice way to decouple the JVMTI part of the protocol. Introducing the `is_start_transition_disabled()` function was also long desired. Also, I like the functions `start_transition()` and `end_transition()` became pretty simple and clean!

This is the function that needs a comment why you're testing all these things (and why base_disable_count is one for JVMTI). It's nice as a function that tests all the different values.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561977191

From coleenp at openjdk.org  Wed Nov 26 00:01:06 2025
From: coleenp at openjdk.org (Coleen Phillimore)
Date: Wed, 26 Nov 2025 00:01:06 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: 
References: 
 
 
 
Message-ID: <6kxaoFZTU2CYGKZpONDliyxGikpxbLMaxUtuqENnlq4=.4e48b44a-522f-4568-b4da-96b0184e5afc@github.com>

On Tue, 25 Nov 2025 19:50:06 GMT, Patricio Chilano Mateo  wrote:

>> src/hotspot/share/runtime/mountUnmountDisabler.cpp line 307:
>> 
>>> 305:   // Block while some mount/unmount transitions are in progress.
>>> 306:   // Debug version fails and prints diagnostic information.
>>> 307:   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
>> 
>> This looks very odd, having an assignment in the loop condition check and no actual loop-update expression.
>
> Yes, from what I see this same construct is used in many places. Seems this is valid because a pointer used in a boolean context evaluates to false if nullptr and true if non-null. :)

This could be a simple cleanup of all these occurrences later.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2561991623

From vlivanov at openjdk.org  Wed Nov 26 02:05:03 2025
From: vlivanov at openjdk.org (Vladimir Ivanov)
Date: Wed, 26 Nov 2025 02:05:03 GMT
Subject: RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter  wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

Test results (hs-tier1 - hs-tier4) are clean.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27965#issuecomment-3578502574

From macarte at openjdk.org  Wed Nov 26 02:05:07 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 26 Nov 2025 02:05:07 GMT
Subject: Integrated: 8370203 - Add jcmd AOT.end_recording diagnostic command
In-Reply-To: 
References: 
Message-ID: <4fjwkhgP8pCO4kV1ZVMlwQ5iGkGsuh79xWZG6ltm_wk=.9d410872-f6b7-48d3-8d83-360a61782827@github.com>

On Thu, 23 Oct 2025 23:57:21 GMT, Mat Carter  wrote:

> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The command will report back to the user one of the following messages depending on the state of the JVM:
> 
> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput= are missing
> - Recording has already ended.
> - Error: Failed to end recording.
> - Recording ended successfully.
> 
> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
> 
> - Recording ended successfully.
> - Recording has already ended.
> 
> Passes tier1 on linux (x64) and windows (x64)

This pull request has now been integrated.

Changeset: 65f1ad61
Author:    Mat Carter 
Committer: Vladimir Ivanov 
URL:       https://git.openjdk.org/jdk/commit/65f1ad616977428fcb498479132086777dc929cb
Stats:     312 lines in 6 files changed: 312 ins; 0 del; 0 mod

8370203: Add jcmd AOT.end_recording diagnostic command

Reviewed-by: vlivanov, kvn

-------------

PR: https://git.openjdk.org/jdk/pull/27965

From lmesnik at openjdk.org  Wed Nov 26 04:48:17 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Wed, 26 Nov 2025 04:48:17 GMT
Subject: RFR: 8372552: unhandled oop in the
 JvmtiEventController::set_user_enabled
Message-ID: 

The issue reproduced by running test 
vmTestbase/nsk/jvmti/AttachOnDemand/attach022[1]/TestDescription.java
with `-XX:+CheckUnhandledOops`.

No need to flush object free events during VM init. So it is fine to move it after handling the oop.

Testing with tier1-5.

-------------

Commit messages:
 - fixed handling

Changes: https://git.openjdk.org/jdk/pull/28500/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28500&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372552
  Stats: 10 lines in 1 file changed: 5 ins; 4 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28500.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28500/head:pull/28500

PR: https://git.openjdk.org/jdk/pull/28500

From sspitsyn at openjdk.org  Wed Nov 26 05:05:35 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Wed, 26 Nov 2025 05:05:35 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v5]
In-Reply-To: 
References: 
Message-ID: <5i03hZ66IqItuQfklwFP7CxI-LiKvLJ8iOTSLoIhrbo=.02aa02b4-99f3-49f1-976b-2c89781e9199@github.com>

> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
> 
> This fix is to avoid enforcing the `interp-only` execution mode for threads when `FramePop` events are enabled with the JVMTI `SetEventNotificationMode()`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` optimization by the function `InterpreterRuntime::frequency_counter_overflow_inner()`. (Big thanks to @fisk for this suggestion!) Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
> The other details will be provided in the first PR request comment.
> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
> 
> Testing:
>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>  - submitted mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  review: renamed two functions; FRAME_POP_BIT removed from INTERP_EVENT_BITS

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28407/files
  - new: https://git.openjdk.org/jdk/pull/28407/files/1224d1e2..d82e4efe

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28407&range=03-04

  Stats: 10 lines in 4 files changed: 0 ins; 0 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/28407.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28407/head:pull/28407

PR: https://git.openjdk.org/jdk/pull/28407

From sspitsyn at openjdk.org  Wed Nov 26 05:30:49 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Wed, 26 Nov 2025 05:30:49 GMT
Subject: RFR: 6960970: Debugger very slow during stepping [v5]
In-Reply-To: <5i03hZ66IqItuQfklwFP7CxI-LiKvLJ8iOTSLoIhrbo=.02aa02b4-99f3-49f1-976b-2c89781e9199@github.com>
References: 
 <5i03hZ66IqItuQfklwFP7CxI-LiKvLJ8iOTSLoIhrbo=.02aa02b4-99f3-49f1-976b-2c89781e9199@github.com>
Message-ID: <2fv251w2Pu7JpU4LNTMbqqNKVf2RL7q-_bJv7eiWMOU=.3f57aac0-58dc-4f1d-9e65-d13b448e58b8@github.com>

On Wed, 26 Nov 2025 05:05:35 GMT, Serguei Spitsyn  wrote:

>> This change fixes a long standing performance issue related to the debugger single stepping that is using JVMTI `FramePop` events as a part of step over handling. The performance issue is that the target thread continues its execution in very slow `interp-only` mode in a context of frame marked for `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other method calls recursively upon a return from the frame.
>> 
>> This fix is to avoid enforcing the `interp-only` execution mode for threads when `FramePop` events are enabled with the JVMTI `SetEventNotificationMode()`. Instead, the target frame has been deoptimized and kept interpreted by disabling `OSR` optimization by the function `InterpreterRuntime::frequency_counter_overflow_inner()`. (Big thanks to @fisk for this suggestion!) Additionally, some tweaks are applied in several places where the `java_thread->is_interp_only_mode()` is checked.
>> The other details will be provided in the first PR request comment.
>> It is considered to file a SCR for this update a `FramePop` events do not enforce the `interp-only` mode for a target thread anymore which might break some expectations (the behavior has been changed).
>> 
>> Testing:
>>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide some extra test coverage
>>  - submitted mach5 tiers 1-6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: renamed two functions; FRAME_POP_BIT removed from INTERP_EVENT_BITS

We had a walk through the changes with @alexmenkov , @plummercj and @lmesnik and identified several issues:
 - New function `JvmtiExport::has_frame_pop_for_top_frame()` needs a minor performance tweak
 - The changes in `post_method_exit()` are not as precise and correct as needed:
   - call to `get_jvmti_thread_state()` may create a `JvmtiThreadState` object in a case when it is not needed
   - there can be some unreasonable performance overhead
   - there is a concern about possible incorrect handling of the `cur_stack_depth` (need to double check)
- Need to remove the `FRAME_POP_BIT` from the`INTERP_EVENT_BITS` bit mask (**DONE**)
- Decided to rename a couple of new functions (**DONE**):
   - s/`check_and_clear_vthread_pending_deopts`/`clear_vthread_pending_deopts`/g
   - s/`get_vthread_pending_deopts`/`vthread_pending_deopts`/g
- Need some additional test coverage:
   - for multiple `FramePop` requests handled by `process_vthread_pending_deopts()`
   - a test showing a performance improvement with this PR update

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28407#issuecomment-3579240863

From lmesnik at openjdk.org  Wed Nov 26 07:03:31 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Wed, 26 Nov 2025 07:03:31 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called [v2]
In-Reply-To: 
References: 
Message-ID: 

> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
> 
> I run jvmti tests with different options and probelmlisted the only failing tests.
> 
> 
> The previous attempt uncover a lot of problems related to the 
> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
> The events might be generated after VM_DEATH event

Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:

  copyrightsfixed

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28404/files
  - new: https://git.openjdk.org/jdk/pull/28404/files/e4994574..cc51aef8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28404&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28404&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28404.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28404/head:pull/28404

PR: https://git.openjdk.org/jdk/pull/28404

From lmesnik at openjdk.org  Wed Nov 26 07:03:31 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Wed, 26 Nov 2025 07:03:31 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 21:17:44 GMT, Alex Menkov  wrote:

> Need to update copyright yer in agent_tools.cpp Did you tested it with tiers5-7?

It looks too much overhead to run whole tier5-7 for test fix. So I run nsk/jvmti tests with options from our CI. I grabbed all possible VM flags, hope that I didn't missed anything.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28404#issuecomment-3579640195

From dholmes at openjdk.org  Wed Nov 26 07:32:52 2025
From: dholmes at openjdk.org (David Holmes)
Date: Wed, 26 Nov 2025 07:32:52 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: <-MtOiSQVDvlQD7sbfeBiqF00_ZN9_aNt3zd2LZLljyo=.eeabb717-359d-4420-89aa-ed1b305beee5@github.com>
References: 
 
 
 <-MtOiSQVDvlQD7sbfeBiqF00_ZN9_aNt3zd2LZLljyo=.eeabb717-359d-4420-89aa-ed1b305beee5@github.com>
Message-ID: 

On Tue, 25 Nov 2025 19:45:08 GMT, Patricio Chilano Mateo  wrote:

>> src/hotspot/share/classfile/javaClasses.cpp line 1764:
>> 
>>> 1762:   jint* addr = java_thread->field_addr(_VTMS_transition_disable_count_offset);
>>> 1763:   int val = AtomicAccess::load(addr);
>>> 1764:   AtomicAccess::store(addr, val - 1);
>> 
>> Suggestion:
>> 
>>   AtomicAccess::dec(addr);
>
> I?d prefer to leave it as a plain store to avoid the unnecessary extra fence.

But it isn't then an atomic update.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2563699480

From dholmes at openjdk.org  Wed Nov 26 07:35:49 2025
From: dholmes at openjdk.org (David Holmes)
Date: Wed, 26 Nov 2025 07:35:49 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v4]
In-Reply-To: <6kxaoFZTU2CYGKZpONDliyxGikpxbLMaxUtuqENnlq4=.4e48b44a-522f-4568-b4da-96b0184e5afc@github.com>
References: 
 
 
 
 <6kxaoFZTU2CYGKZpONDliyxGikpxbLMaxUtuqENnlq4=.4e48b44a-522f-4568-b4da-96b0184e5afc@github.com>
Message-ID: 

On Tue, 25 Nov 2025 23:53:40 GMT, Coleen Phillimore  wrote:

>> Yes, from what I see this same construct is used in many places. Seems this is valid because a pointer used in a boolean context evaluates to false if nullptr and true if non-null. :)
>
> This could be a simple cleanup of all these occurrences later.

Yes this is terribly obscure (doing the assignment in the loop condition check - surprised that is even allowed) and also violates the style-guide in relation to implicit booleans. But frankly it is an awful use of a for-loop in my opinion.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2563714065

From mbaesken at openjdk.org  Wed Nov 26 10:08:54 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Wed, 26 Nov 2025 10:08:54 GMT
Subject: RFR: 8371893: [macOS] use dead_strip linker option to reduce
 binary size [v5]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Tue, 25 Nov 2025 13:12:06 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use dead_strip on macOS arrch64 AND x86_64

For macOS x86_64 it works too at least for some of the libs. See the size without and with dead_strip 


1200 -> 1164    /jdk/lib/libawt_lwawt.dylib
1364 -> 1048    /jdk/lib/libfontmanager.dylib
636  -> 632     /jdk/lib/libfreetype.dylib
240  -> 236     /jdk/lib/libjavajpeg.dylib
280  -> 276     jdk/lib/libjdwp.dylib
92   -> 92      /jdk/lib/libjli.dylib
428  -> 320     /jdk/lib/liblcms.dylib
716  -> 688     /jdk/lib/libmlib_image.dylib
60   -> 60      /jdk/lib/libzip.dylib


For some strange reasons, it does not help on libzip and libjli .
But those are smaller anyway compared to aarch64.  (it is a bit surprising that libzip is twice as large on aarch64 !)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3580564402

From serb at openjdk.org  Wed Nov 26 11:03:49 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 26 Nov 2025 11:03:49 GMT
Subject: RFR: 8371893: [macOS] use dead_strip linker option to reduce
 binary size [v5]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: <5xGU22WgiZiCJGUU3G3e1-SAty0aXnjzEbj3nx30y5c=.337ef8d2-e79e-477f-916c-a344079370a9@github.com>

On Tue, 25 Nov 2025 13:12:06 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use dead_strip on macOS arrch64 AND x86_64

I'll run UI the tests for this.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3580783766

From mbaesken at openjdk.org  Wed Nov 26 11:20:52 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Wed, 26 Nov 2025 11:20:52 GMT
Subject: RFR: 8371893: [macOS] use dead_strip linker option to reduce
 binary size [v5]
In-Reply-To: <5xGU22WgiZiCJGUU3G3e1-SAty0aXnjzEbj3nx30y5c=.337ef8d2-e79e-477f-916c-a344079370a9@github.com>
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
 <5xGU22WgiZiCJGUU3G3e1-SAty0aXnjzEbj3nx30y5c=.337ef8d2-e79e-477f-916c-a344079370a9@github.com>
Message-ID: 

On Wed, 26 Nov 2025 11:01:22 GMT, Sergey Bylokhov  wrote:

> I'll run UI the tests for this.

Great, thanks !

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3580838458

From jbhateja at openjdk.org  Wed Nov 26 11:34:11 2025
From: jbhateja at openjdk.org (Jatin Bhateja)
Date: Wed, 26 Nov 2025 11:34:11 GMT
Subject: RFR: 8370691: Add new Float16Vector type and enable
 intrinsification of vector operations supported by auto-vectorizer [v5]
In-Reply-To: 
References: 
Message-ID: 

> Add a new  Float16lVector type and corresponding concrete vector classes, in addition to existing primitive vector types, maintaining operation parity with the FloatVector type.
> - Add necessary inline expander support.
>    - Enable intrinsification for a few vector operations, namely ADD/SUB/MUL/DIV/MAX/MIN/FMA.
> - Use existing Float16 vector IR and backend support.
> - Extended the existing VectorAPI JTREG test suite for the newly added Float16Vector operations.
>  
> The idea here is to first be at par with Float16 auto-vectorization support before intrinsifying new operations (conversions, reduction, etc).
> 
> The following are the performance numbers for some of the selected Float16Vector benchmarking kernels compared to equivalent auto-vectorized Float16OperationsBenchmark kernels.
> 
> image
> 
> Initial RFP[1] was floated on the panama-dev mailing list.
> 
> Kindly review the draft PR and share your feedback.
> 
> Best Regards,
> Jatin
> 
> [1] https://mail.openjdk.org/pipermail/panama-dev/2025-August/021100.html

Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:

  Cleanups

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28002/files
  - new: https://git.openjdk.org/jdk/pull/28002/files/aca6cc5d..756a0d0c

Webrevs:
 - full: Webrev is not available because diff is too large
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28002&range=03-04

  Stats: 26 lines in 9 files changed: 5 ins; 7 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/28002.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28002/head:pull/28002

PR: https://git.openjdk.org/jdk/pull/28002

From kevinw at openjdk.org  Wed Nov 26 12:04:49 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Wed, 26 Nov 2025 12:04:49 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Tue, 25 Nov 2025 12:22:21 GMT, Alan Bateman  wrote:

>> src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java line 192:
>> 
>>> 190:                 HotSpotAOTCacheMXBean impl = this.impl;
>>> 191:                 if (impl == null) {
>>> 192:                     this.impl = impl = new HotSpotAOTCacheImpl(ManagementFactoryHelper.getVMManagement());
>> 
>> This assignment is unusual.  Are we trying to avoid a synchronized block? Other nameToMBeanMap() methods are like:
>> 	return Collections.singletonMap(ManagementFactory.MEMORY_MXBEAN_NAME, ManagementFactoryHelper.getMemoryMXBean());
>> 	
>> ..where the ManagementFactoryHelper.getMemoryMXBean() method is synchronized and creates the impl if needed.
>
> I don't see a correctly issue with this. Maybe in the future we will be able to use LazyConstant here.

Sure, I'm just pointing out that we have a load of existing nameToMBeanMap() methods that do things differently.
OK I now see this one is doing what the new VirtualThreadSchedulerMXBean did.

The others are different: commonly the nameToMBeanMap() methods in PlatformMBeanProviderImpl.java are synchronized, or they call a getXXMXBean() method which is synchronized.

Maybe these old methods don't need to be synchronized, if this all gets done at startup in PlatformMBeanProviderImpl init(), the mbeans will always be created once.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2564720463

From alanb at openjdk.org  Wed Nov 26 12:25:53 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Wed, 26 Nov 2025 12:25:53 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
 
 
 
Message-ID: 

On Wed, 26 Nov 2025 12:01:40 GMT, Kevin Walls  wrote:

>> I don't see a correctness issue with this. Maybe in the future we will be able to use LazyConstant here.
>
> Sure, I'm just pointing out that we have a load of existing nameToMBeanMap() methods that do things differently.
> OK I now see this one is doing what the new VirtualThreadSchedulerMXBean did.
> 
> The others are different: commonly the nameToMBeanMap() methods in PlatformMBeanProviderImpl.java are synchronized, or they call a getXXMXBean() method which is synchronized.
> 
> Maybe these old methods don't need to be synchronized, if this all gets done at startup in PlatformMBeanProviderImpl init(), the mbeans will always be created once.

The older code pre-dates unmodifiable maps (JEP 269), it could be modernized some time.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2564793415

From lucy at openjdk.org  Wed Nov 26 12:42:56 2025
From: lucy at openjdk.org (Lutz Schmidt)
Date: Wed, 26 Nov 2025 12:42:56 GMT
Subject: RFR: 8371893: [macOS] use dead_strip linker option to reduce
 binary size [v5]
In-Reply-To: 
References: <5GKe55IFkJgBmku-Y-X4mcoy0V43x-ZXBzwb7EbwqTU=.23fe4819-b951-4364-a7b5-315e2b6d5824@github.com>
 
Message-ID: 

On Tue, 25 Nov 2025 13:12:06 GMT, Matthias Baesken  wrote:

>> The dead_strip linker option on macOS removes functions and data that are unreachable by the entry point or exported symbols.
>> Setting it can reduce the size of some binaries we generate quite a lot, for example (product build, Xcode 15 is used) :
>> (before -> after setting the option)
>> 
>> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
>> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
>> 152K -> 132K images/jdk/lib/libjli.dylib
>> 388K -> 296K images/jdk/lib/liblcms.dylib
>> 164K -> 128K images/jdk/lib/libzip.dylib
>> 
>> 
>> and libjvm :
>> 
>> 20M -> 18M images/jdk/lib/server/libjvm.dylib
>> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use dead_strip on macOS arrch64 AND x86_64

Looks good, finally. 
Lots of discussion for such a tiny change... :-)

-------------

Marked as reviewed by lucy (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28319#pullrequestreview-3510772202

From kevinw at openjdk.org  Wed Nov 26 12:54:50 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Wed, 26 Nov 2025 12:54:50 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v8]
In-Reply-To: 
References: 
 
 
 
 
 
Message-ID: <9nPLu2Fgp-9WizodN4foJP6NA0IvpQGyghqUI-LlzYI=.6560feb6-3c80-4e87-9e85-8c66de78df02@github.com>

On Wed, 26 Nov 2025 12:23:26 GMT, Alan Bateman  wrote:

>> Sure, I'm just pointing out that we have a load of existing nameToMBeanMap() methods that do things differently.
>> OK I now see this one is doing what the new VirtualThreadSchedulerMXBean did.
>> 
>> The others are different: commonly the nameToMBeanMap() methods in PlatformMBeanProviderImpl.java are synchronized, or they call a getXXMXBean() method which is synchronized.
>> 
>> Maybe these old methods don't need to be synchronized, if this all gets done at startup in PlatformMBeanProviderImpl init(), the mbeans will always be created once.
>
> The older code pre-dates unmodifiable maps (JEP 269), it could be modernized some time.

Thanks yes would be good to do that some time.
It looks like an effort with the older accesors to enforce that they are singletons.  That may not be important for all the mxbeans.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2564893489

From macarte at openjdk.org  Wed Nov 26 16:26:04 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 26 Nov 2025 16:26:04 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v9]
In-Reply-To: 
References: 
Message-ID: 

> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
> 
> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
> 
> TRUE
> FALSE
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:

 - Merge branch 'master' into JDK-8369736
 - Remove single whitespace
 - Incorporate changes from the CSR
 - Revert "Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording"
   Commit was intended for parent branch (that this branch is based on)
   
   This reverts commit bff7cb7408554232c13a57bba10b67a9fd19b811.
 - Adding test to validate using DiagnosticCommand MBean to invoke AOT.end_recording
 - Updated test based on comments
 - Merge branch 'JDK-8369736' of https://github.com/macarte/jdk into JDK-8369736
 - Update src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java
   
   Co-authored-by: Dan Heidinga 
 - Update src/jdk.management/share/classes/jdk/management/HotSpotAOTCacheMXBean.java
   
   Co-authored-by: Dan Heidinga 
 - Wording and format changes
 - ... and 5 more: https://git.openjdk.org/jdk/compare/c028369d...a12bfa03

-------------

Changes: https://git.openjdk.org/jdk/pull/28010/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=08
  Stats: 433 lines in 11 files changed: 338 ins; 0 del; 95 mod
  Patch: https://git.openjdk.org/jdk/pull/28010.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010

PR: https://git.openjdk.org/jdk/pull/28010

From macarte at openjdk.org  Wed Nov 26 20:30:12 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 26 Nov 2025 20:30:12 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v10]
In-Reply-To: 
References: 
Message-ID: <4yg-7y-d9fzKeFZwZm1KNF6xn2tXGk8y8QaUCk6ly0w=.d0a6ba6b-81a6-482c-9af6-fe3584f2de1d@github.com>

> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
> 
> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
> 
> TRUE
> FALSE
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request incrementally with one additional commit since the last revision:

  Incorporate changes to aotMetaspace from dependent commit

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28010/files
  - new: https://git.openjdk.org/jdk/pull/28010/files/a12bfa03..576418a6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=09
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=08-09

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28010.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010

PR: https://git.openjdk.org/jdk/pull/28010

From macarte at openjdk.org  Wed Nov 26 20:35:11 2025
From: macarte at openjdk.org (Mat Carter)
Date: Wed, 26 Nov 2025 20:35:11 GMT
Subject: RFR: 8369736 - Add management interface for AOT cache creation
 [v11]
In-Reply-To: 
References: 
Message-ID: 

> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
> 
> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
> 
> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
> 
> TRUE
> FALSE
> 
> Passes tier1 on linux (x64) and windows (x64)

Mat Carter has updated the pull request incrementally with one additional commit since the last revision:

  Fixed spaces and CRLF

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28010/files
  - new: https://git.openjdk.org/jdk/pull/28010/files/576418a6..0086e0ec

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=10
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28010&range=09-10

  Stats: 93 lines in 2 files changed: 0 ins; 0 del; 93 mod
  Patch: https://git.openjdk.org/jdk/pull/28010.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28010/head:pull/28010

PR: https://git.openjdk.org/jdk/pull/28010

From amenkov at openjdk.org  Wed Nov 26 21:45:46 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Wed, 26 Nov 2025 21:45:46 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called [v2]
In-Reply-To: 
References: 
 
Message-ID: <4LQWpzaYOPCHumgVQTllPpq1KCK5bLqSdNtqGKIwOZ0=.293424ba-427e-4453-a5e7-8955c4c3b5d4@github.com>

On Wed, 26 Nov 2025 07:03:31 GMT, Leonid Mesnik  wrote:

>> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
>> 
>> I run jvmti tests with different options and probelmlisted the only failing tests.
>> 
>> 
>> The previous attempt uncover a lot of problems related to the 
>> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
>> The events might be generated after VM_DEATH event
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   copyrightsfixed

Marked as reviewed by amenkov (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28404#pullrequestreview-3512828661

From sspitsyn at openjdk.org  Wed Nov 26 21:45:47 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Wed, 26 Nov 2025 21:45:47 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Wed, 26 Nov 2025 07:03:31 GMT, Leonid Mesnik  wrote:

>> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
>> 
>> I run jvmti tests with different options and probelmlisted the only failing tests.
>> 
>> 
>> The previous attempt uncover a lot of problems related to the 
>> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
>> The events might be generated after VM_DEATH event
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   copyrightsfixed

> It looks too much overhead to run whole tier5-7 for test fix. I grabbed all possible VM flags, hope that I didn't missed anything.

It feels that it would be more safe to run mach5 tiers 1-6. It is not that big overhead for avoiding risk of regressions, especially at this phase of development.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28404#issuecomment-3583294627

From sspitsyn at openjdk.org  Wed Nov 26 22:09:47 2025
From: sspitsyn at openjdk.org (Serguei Spitsyn)
Date: Wed, 26 Nov 2025 22:09:47 GMT
Subject: RFR: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Wed, 26 Nov 2025 07:03:31 GMT, Leonid Mesnik  wrote:

>> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
>> 
>> I run jvmti tests with different options and probelmlisted the only failing tests.
>> 
>> 
>> The previous attempt uncover a lot of problems related to the 
>> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
>> The events might be generated after VM_DEATH event
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   copyrightsfixed

Marked as reviewed by sspitsyn (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28404#pullrequestreview-3512885811

From lmesnik at openjdk.org  Wed Nov 26 22:19:58 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Wed, 26 Nov 2025 22:19:58 GMT
Subject: Integrated: 8352654: [REDO] nsk/jvmti/ tests should fail when
 nsk_jvmti_setFailStatus() is called
In-Reply-To: 
References: 
Message-ID: <1noWeDrsHZSXJ06X-8-1qsau_9XHcgzl2a_k5rMcfSE=.12968c19-076a-464e-acc2-cd01a0b8c728@github.com>

On Wed, 19 Nov 2025 23:45:36 GMT, Leonid Mesnik  wrote:

> Please review second attempt to fail tests right in the nsk_jvmti_setFailStatus().
> 
> I run jvmti tests with different options and probelmlisted the only failing tests.
> 
> 
> The previous attempt uncover a lot of problems related to the 
> [JDK-8355631](https://bugs.openjdk.org/browse/JDK-8355631)
> The events might be generated after VM_DEATH event

This pull request has now been integrated.

Changeset: 847fbab7
Author:    Leonid Mesnik 
URL:       https://git.openjdk.org/jdk/commit/847fbab7924848e0e88d112db1d5d0b71372d597
Stats:     6 lines in 2 files changed: 5 ins; 0 del; 1 mod

8352654: [REDO] nsk/jvmti/ tests should fail when  nsk_jvmti_setFailStatus() is called

Reviewed-by: amenkov, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/28404

From pchilanomate at openjdk.org  Wed Nov 26 22:34:37 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:34:37 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v8]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision:

 - More changes from Coleen's review
 - Drop VTMS from names

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/dee2b843..623bc518

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=06-07

  Stats: 203 lines in 16 files changed: 41 ins; 0 del; 162 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Wed Nov 26 22:44:17 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:44:17 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v9]
In-Reply-To: 
References: 
Message-ID: 

> When `ThreadSnapshotFactory::get_thread_snapshot()` captures a snapshot of a virtual thread, it uses `JvmtiVTMSTransitionDisabler` class to disable mount/unmount transitions. However, this only works if a JVMTI agent has attached to the VM, otherwise virtual threads don?t honor the disable request. Since this snapshot mechanism is used by `jcmd Thread.dump_to_file` and `HotSpotDiagnosticMXBean` which don?t require a JVMTI agent to be present, getting the snapshot of a virtual thread in such cases can lead to crashes.
> 
> This patch moves the transition-disabling mechanism out of JVMTI and into a new class, `MountUnmountDisabler`. The code has been updated so that transitions can be disabled independently of JVMTI, making JVMTI just one user of the API rather than the owner of the mechanism. Here is a summary of the key changes:
> 
> - Currently when a virtual thread starts a mount/unmount transition we only need to check if `_VTMS_notify_jvmti_events` is set to decide if we need to go to the slow path. With these changes, JVMTI is now only one user of the API, so we instead check the actual transition disabling counters, i.e the per-vthread counter and the global counter. Since these can be set at any time (unlike `_VTMS_notify_jvmti_events` which is only set at startup or during a safepoint in case of late binding agents), we follow the classic Dekker pattern for the required synchronization. That is, the virtual thread sets the ?in transition? bits for the carrier and vthread *before* reading the ?transition disabled? counters. The thread requesting to disable transitions increments the ?transition disabled? counter *before* reading the ?in transition? bits. 
> An alternative that avoids the extra fence in `startTransition` would be to place extra overhead on the thread requesting to disable transitions (e.g. using safepoint, handshake-all, or UseSystemMemoryBarrier). Performance analysis show no difference with current mainline so for now I kept this simpler version.
> 
> - Ending the transition doesn?t need to check if transitions are disabled (equivalent to not need to poll when transitioning from unsafe to safe safepoint state). But we still require to go through the slow path if there is a JVMTI agent present, since we need to check for event posting and JVMTI state rebinding. As such, the end transition follows the same pattern that we have today of only needing to check `_VTMS_notify_jvmti_events`.
> 
> - The code was previously structured in terms of mount and un...

Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:

  missing to initialize _is_disabler_at_start

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28361/files
  - new: https://git.openjdk.org/jdk/pull/28361/files/623bc518..7aa02a46

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28361&range=07-08

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28361/head:pull/28361

PR: https://git.openjdk.org/jdk/pull/28361

From pchilanomate at openjdk.org  Wed Nov 26 22:44:18 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:44:18 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v3]
In-Reply-To: 
References: 
 
 
 <-MtOiSQVDvlQD7sbfeBiqF00_ZN9_aNt3zd2LZLljyo=.eeabb717-359d-4420-89aa-ed1b305beee5@github.com>
 
Message-ID: 

On Wed, 26 Nov 2025 07:29:37 GMT, David Holmes  wrote:

>> I?d prefer to leave it as a plain store to avoid the unnecessary extra fence.
>
> But it isn't then an atomic update.

Only the disablers write to this counter while holding `VThreadTransition_lock` (verified in the assert above). But we still need to use `AtomicAccess` for the store because it can be concurrently read by the virtual thread.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566654448

From amenkov at openjdk.org  Wed Nov 26 22:48:52 2025
From: amenkov at openjdk.org (Alex Menkov)
Date: Wed, 26 Nov 2025 22:48:52 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
Message-ID: 

On Tue, 25 Nov 2025 02:25:02 GMT, Chris Plummer  wrote:

> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
> 
> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
> 
> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).

src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1296:

> 1294: {
> 1295:     jvmtiError error = JVMTI_ERROR_NONE;
> 1296:     int ei = NODE_EI(node);

Suggestion:

    EventIndex ei = NODE_EI(node);

src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1394:

> 1392:     jvmtiError error2 = JVMTI_ERROR_NONE;
> 1393:     jthread thread;
> 1394:     int ei = NODE_EI(node);

Suggestion:

    EventIndex ei = NODE_EI(node);

src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 1691:

> 1689:      * a deferred event request.
> 1690:      */
> 1691:     if (gdata->virtualThreadStartEventsPermanentlyEnabled) {

Looks like this block can disable VITRUAL_THREAD_START when `rememberVThreadsWhenDisconnected` is set.

src/jdk.jdwp.agent/share/native/libjdwp/util.h line 90:

> 88:     jboolean includeVThreads;   /* If true, VM.AllThreads includes vthreads. */
> 89:     jboolean rememberVThreadsWhenDisconnected;
> 90:     jboolean virtualThreadStartEventsPermanentlyEnabled;

Could you please add description for this 2 flags (and maybe `vthreadsSupported` description also can be enhanced to see relations between the flags)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2561596843
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2561664461
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566654961
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566662313

From pchilanomate at openjdk.org  Wed Nov 26 22:51:55 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:51:55 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v7]
In-Reply-To: <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
References: 
 
 <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
Message-ID: 

On Tue, 25 Nov 2025 23:10:43 GMT, Coleen Phillimore  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   keep preexisting rebind order for mount
>
> src/hotspot/share/classfile/javaClasses.cpp line 1688:
> 
>> 1686: int java_lang_Thread::_jvmti_thread_state_offset;
>> 1687: int java_lang_Thread::_VTMS_transition_disable_count_offset;
>> 1688: int java_lang_Thread::_is_in_VTMS_transition_offset;
> 
> Since you're renaming these anyway, can we drop the VTMS part?  Just call it vthread_transition_disable_count_offset and is_in_vthread_transition_offset?  There are other VTMS named things that aren't these flags but they can stay.  Maybe migrate other names at some future point.

I dropped VTMS from all names.

> src/hotspot/share/opto/library_call.cpp line 3046:
> 
>> 3044: }
>> 3045: 
>> 3046: bool LibraryCallKit::inline_native_vthread_start_transition(address funcAddr, const char* funcName, bool is_final_transition) {
> 
> Would it be helpful to add a comment above this to say what this does? This is supposed to match some non-intrinsic code and might be helpful if you referenced that here.

Added a comment.

> src/hotspot/share/prims/jvm.cpp line 3671:
> 
>> 3669: 
>> 3670: JVM_ENTRY(void, JVM_VirtualThreadStartFinalTransition(JNIEnv* env, jobject vthread))
>> 3671:   oop vt = JNIHandles::resolve_external_guard(vthread);
> 
> Why do the opto runtime versions set is_in_VTMTS_transition in both the java.lang.Thread and JavaThread and these don't?

Because we set them in the intrinsic when trying to start the transition. Method `MountUnmountDisabler::start_transition` expects them to be false so we need to clear them in the opto versions.

> src/hotspot/share/runtime/mountUnmountDisabler.hpp line 34:
> 
>> 32: 
>> 33: class MountUnmountDisabler : public AnyObj {
>> 34:   static volatile int _global_start_transition_disable_count;
> 
> Can you describe this variable - when is it set and why is there a global disabler? What does it mean to have 'n' active disablers?
> 
> A comment at the beginning of MountUnmountDisabler to say something of the effect that during virtual thread mounting and unmounting, JVMTI and operations that need to examine thread state need to be disabled.  Or is it the converse?  During JVMTI and operations that examine the state of threads, virtual thread mounting and unmounting must wait until these operations are complete.  This class is for the latter right?

Added a comment for the class and this counter.

> src/hotspot/share/runtime/mutexLocker.cpp line 52:
> 
>> 50: Mutex*   JvmtiThreadState_lock        = nullptr;
>> 51: Monitor* EscapeBarrier_lock           = nullptr;
>> 52: Monitor* VTMSTransition_lock          = nullptr;
> 
> oh you could drop the name VTMS and call it VThreadTransitionLock can't you?

Done.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566661560
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566662105
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566663466
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566666104
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566666238

From pchilanomate at openjdk.org  Wed Nov 26 22:51:58 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:51:58 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v9]
In-Reply-To: <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
References: 
 
 <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
Message-ID: <9R5lVpD1GBtUw9g9Bc5X7wSEI2a-oFM2Q29HUmyqSmc=.5fb087cf-4305-4bf1-b730-8a3bda7fbe9a@github.com>

On Tue, 25 Nov 2025 23:27:47 GMT, Coleen Phillimore  wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   missing to initialize _is_disabler_at_start
>
> src/hotspot/share/prims/jvmtiEnvBase.cpp line 1772:
> 
>> 1770: 
>> 1771:   assert(java_thread != nullptr, "sanity check");
>> 1772:   assert(!java_thread->is_in_VTMS_transition(), "sanity check");
> 
> Why don't you need these asserts anymore?

We can?t assert this because it could be temporarily set by the target while trying to transition. Previously we had two fields in JavaThread, `_VTMS_transition_mark` and `_is_in_VTMS_transition`. `_VTMS_transition_mark` was set first (checked by the disabler), and if transitions were disabled we waited. Once the transition could start we set `_is_in_VTMS_transition`. 
Going over the changes I see I removed one assert in `JvmtiEnvBase::get_vthread_jvf` that should be okay to keep, so I restored it. Also added an assert in `JavaThread::is_in_VTMS_transition()` (now `is_in_vthread_transition`) to verify that if it?s accessed from another thread then it has to be done from a safe context where the value will not change?right after checking.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566664593

From pchilanomate at openjdk.org  Wed Nov 26 22:51:59 2025
From: pchilanomate at openjdk.org (Patricio Chilano Mateo)
Date: Wed, 26 Nov 2025 22:51:59 GMT
Subject: RFR: 8364343: Virtual Thread transition management needs to be
 independent of JVM TI [v7]
In-Reply-To: 
References: 
 
 <0e65HV5RscFZN_q4JGzXA7k5jlT7gw7klerMqbfz4GU=.598cedb2-fd53-458b-9047-4d712661cbe4@github.com>
 
Message-ID: 

On Tue, 25 Nov 2025 23:45:14 GMT, Coleen Phillimore  wrote:

>> src/hotspot/share/runtime/javaThread.cpp line 1152:
>> 
>>> 1150: bool JavaThread::is_in_VTMS_transition() const {
>>> 1151:   return AtomicAccess::load(&_is_in_VTMS_transition);
>>> 1152: }
>> 
>> Is the JavaThread version always the same as the java_lang_Thread::is_in_VTMS_transition(threadOop()) value?
>
> Why is there the same flag with the same name in both the Java class and C++ JavaThread?  Might be an efficient cache, so something should say that (if true).

The one in `JavaThread` is needed for the `disable_transition_for_all` case. Processing each vthread is not viable, so we instead process all `JavaThreads`. If no `JavaThread` is in a transition then it implies no vthread is in a transition.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566665257

From cjplummer at openjdk.org  Thu Nov 27 01:06:54 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 27 Nov 2025 01:06:54 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 25 Nov 2025 21:56:47 GMT, Alex Menkov  wrote:

>> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
>> 
>> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
>> 
>> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).
>
> src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1296:
> 
>> 1294: {
>> 1295:     jvmtiError error = JVMTI_ERROR_NONE;
>> 1296:     int ei = NODE_EI(node);
> 
> Suggestion:
> 
>     EventIndex ei = NODE_EI(node);

ok

> src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c line 1394:
> 
>> 1392:     jvmtiError error2 = JVMTI_ERROR_NONE;
>> 1393:     jthread thread;
>> 1394:     int ei = NODE_EI(node);
> 
> Suggestion:
> 
>     EventIndex ei = NODE_EI(node);

ok

> src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 1691:
> 
>> 1689:      * a deferred event request.
>> 1690:      */
>> 1691:     if (gdata->virtualThreadStartEventsPermanentlyEnabled) {
> 
> Looks like this block can disable VITRUAL_THREAD_START when `rememberVThreadsWhenDisconnected` is set.

virtualThreadStartEventsPermanentlyEnabled is only set true if includeVThreads is false, which means rememberVThreadsWhenDisconnected is also false (they are always set the same, as I discuss in my new comment below).

virtualThreadStartEventsPermanentlyEnabled could use a better name because it means "permanently enabled for handling deferred event enabling", whereas if includeVThreads is true, VITRUAL_THREAD_START events are always permanently enabled, but virtualThreadStartEventsPermanentlyEnabled will never be set true.

> src/jdk.jdwp.agent/share/native/libjdwp/util.h line 90:
> 
>> 88:     jboolean includeVThreads;   /* If true, VM.AllThreads includes vthreads. */
>> 89:     jboolean rememberVThreadsWhenDisconnected;
>> 90:     jboolean virtualThreadStartEventsPermanentlyEnabled;
> 
> Could you please add description for this 2 flags (and maybe `vthreadsSupported` description also can be enhanced to see relations between the flags)

I'm going to get rid of rememberVThreadsWhenDisconnected and just replace references to it with includeVThreads. Right now they are always set the same. I was considering someday making it a flag that could be set on the command line, but I don't seen a need for that anymore. I'd like to get rid of includeVThreads too, but some tests still rely on it. I'll files a CR for all this work soon.

I also plan on getting rid of vthreadsSupported. I doubt setting it to false even works. It's just a remnant from the early days of development of vthread support. It should just always be assumed true now. I'll file a CR for this also.

I'll add some comments for virtualThreadStartEventsPermanentlyEnabled.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566838053
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566838574
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566837301
PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566825506

From cjplummer at openjdk.org  Thu Nov 27 01:36:25 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 27 Nov 2025 01:36:25 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible [v2]
In-Reply-To: 
References: 
Message-ID: 

> Don't enabled VIRTUAL_THREAD_START/END events unless absolutely necessary. Solves performance issues when trying to debug apps that create a lot of virtual threads. Details in first comment.
> 
> With these changes the Skynet benchmark no longer shows any slowdown when launching with debugging enabled or when attaching the debugger.
> 
> Tested with all tier2, tier3, tier5, and tier6 CI testing (with filters to only run svc tests).

Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:

  use EventIndex type

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28485/files
  - new: https://git.openjdk.org/jdk/pull/28485/files/e8b21dba..24010875

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28485&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28485&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28485.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28485/head:pull/28485

PR: https://git.openjdk.org/jdk/pull/28485

From cjplummer at openjdk.org  Thu Nov 27 01:36:25 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 27 Nov 2025 01:36:25 GMT
Subject: RFR: 8371380: [LOOM] The debug agent should avoid enabling
 VIRTUAL_THREAD_START/END events when possible [v2]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 27 Nov 2025 00:59:46 GMT, Chris Plummer  wrote:

>> src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 1691:
>> 
>>> 1689:      * a deferred event request.
>>> 1690:      */
>>> 1691:     if (gdata->virtualThreadStartEventsPermanentlyEnabled) {
>> 
>> Looks like this block can disable VITRUAL_THREAD_START when `rememberVThreadsWhenDisconnected` is set.
>
> virtualThreadStartEventsPermanentlyEnabled is only set true if includeVThreads is false, which means rememberVThreadsWhenDisconnected is also false (they are always set the same, as I discuss in my new comment below).
> 
> virtualThreadStartEventsPermanentlyEnabled could use a better name because it means "permanently enabled for handling deferred event enabling", whereas if includeVThreads is true, VITRUAL_THREAD_START events are always permanently enabled, but virtualThreadStartEventsPermanentlyEnabled will never be set true.

How about virtualThreadStartEventsEnabledForDeferredEventMode?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28485#discussion_r2566914246

From cjplummer at openjdk.org  Thu Nov 27 06:54:47 2025
From: cjplummer at openjdk.org (Chris Plummer)
Date: Thu, 27 Nov 2025 06:54:47 GMT
Subject: RFR: 8371194: serviceability/sa/TestJhsdbJstackMixedWithXComp.java
 failing [v3]
In-Reply-To: 
References: <41mFEzxTY4NaRhF6tQU1o-pDe1eZOkQjiDxpwJSKbOE=.2eb30661-6152-4b27-863c-f97629a464b1@github.com>
 
 
Message-ID: 

On Tue, 25 Nov 2025 11:41:34 GMT, Yasumasa Suenaga  wrote:

> PING: could you review this?

Sorry I didn't have a chance to get to this yet. I'm on holiday the rest of the week. I should be able to look at it on Monday. I did run your changes through most of our relevant CI testing, and everything passed.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28284#issuecomment-3584433776

From lmesnik at openjdk.org  Thu Nov 27 20:17:58 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Thu, 27 Nov 2025 20:17:58 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled
Message-ID: 

The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 

I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 

The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java

Note: 
I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.

-------------

Commit messages:
 - 8372039: post_sampled_object_alloc is called while lock is handled

Changes: https://git.openjdk.org/jdk/pull/28544/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372039
  Stats: 49 lines in 5 files changed: 8 ins; 30 del; 11 mod
  Patch: https://git.openjdk.org/jdk/pull/28544.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28544/head:pull/28544

PR: https://git.openjdk.org/jdk/pull/28544

From lmesnik at openjdk.org  Thu Nov 27 20:53:32 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Thu, 27 Nov 2025 20:53:32 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled [v2]
In-Reply-To: 
References: 
Message-ID: 

> The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 
> 
> I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 
> 
> The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
> make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java
> 
> Note: 
> I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
> NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.

Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:

  Added regression test

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28544/files
  - new: https://git.openjdk.org/jdk/pull/28544/files/7662d282..67bcdf11

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=00-01

  Stats: 120 lines in 2 files changed: 120 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28544.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28544/head:pull/28544

PR: https://git.openjdk.org/jdk/pull/28544

From jnorlinder at openjdk.org  Thu Nov 27 22:01:59 2025
From: jnorlinder at openjdk.org (Jonas Norlinder)
Date: Thu, 27 Nov 2025 22:01:59 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
Message-ID: 

getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).

The specification for this methods states that only user-level CPU time would ever be returned on success.

-------------

Commit messages:
 - Remove debug pritn
 - Revert to old behaviour

Changes: https://git.openjdk.org/jdk/pull/28545/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28545&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372704
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28545.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28545/head:pull/28545

PR: https://git.openjdk.org/jdk/pull/28545

From dholmes at openjdk.org  Fri Nov 28 02:50:48 2025
From: dholmes at openjdk.org (David Holmes)
Date: Fri, 28 Nov 2025 02:50:48 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
In-Reply-To: 
References: 
Message-ID: 

On Thu, 27 Nov 2025 21:55:10 GMT, Jonas Norlinder  wrote:

> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
> 
> The specification for this methods states that only user-level CPU time would ever be returned on success.

Good catch on the bug introduced by JDK-8303242! Looks good.

Copyright year needs updating. Thanks

-------------

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28545#pullrequestreview-3517316099

From alanb at openjdk.org  Fri Nov 28 07:40:46 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Fri, 28 Nov 2025 07:40:46 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
In-Reply-To: 
References: 
Message-ID: 

On Thu, 27 Nov 2025 21:55:10 GMT, Jonas Norlinder  wrote:

> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
> 
> The specification for this methods states that only user-level CPU time would ever be returned on success.

Well spotted. We had to make significant changes to this code in JDK 21 with JDK-8303242 and it seems to have crept in then.

-------------

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28545#pullrequestreview-3517789481

From jnorlinder at openjdk.org  Fri Nov 28 08:42:24 2025
From: jnorlinder at openjdk.org (Jonas Norlinder)
Date: Fri, 28 Nov 2025 08:42:24 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
 [v2]
In-Reply-To: 
References: 
Message-ID: 

> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
> 
> The specification for this methods states that only user-level CPU time would ever be returned on success.

Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision:

  Fix copyright year

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28545/files
  - new: https://git.openjdk.org/jdk/pull/28545/files/4fdfbaf6..3d541253

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28545&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28545&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28545.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28545/head:pull/28545

PR: https://git.openjdk.org/jdk/pull/28545

From kevinw at openjdk.org  Fri Nov 28 08:59:59 2025
From: kevinw at openjdk.org (Kevin Walls)
Date: Fri, 28 Nov 2025 08:59:59 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
 [v2]
In-Reply-To: 
References: 
 
Message-ID: <3n31GMENZUt__tAKCIjKFCfkyt-YO1qUPFiGbi85Nhg=.9ec5f3f5-f130-40b9-bbe0-b28249e4d81a@github.com>

On Fri, 28 Nov 2025 08:42:24 GMT, Jonas Norlinder  wrote:

>> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
>> 
>> The specification for this methods states that only user-level CPU time would ever be returned on success.
>
> Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix copyright year

Marked as reviewed by kevinw (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28545#pullrequestreview-3517985724

From alanb at openjdk.org  Fri Nov 28 08:59:59 2025
From: alanb at openjdk.org (Alan Bateman)
Date: Fri, 28 Nov 2025 08:59:59 GMT
Subject: RFR: 8372704: ThreadMXBean.getThreadUserTime may return total time
 [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 28 Nov 2025 08:42:24 GMT, Jonas Norlinder  wrote:

>> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
>> 
>> The specification for this methods states that only user-level CPU time would ever be returned on success.
>
> Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix copyright year

Marked as reviewed by alanb (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28545#pullrequestreview-3517992668

From jnorlinder at openjdk.org  Fri Nov 28 09:00:00 2025
From: jnorlinder at openjdk.org (Jonas Norlinder)
Date: Fri, 28 Nov 2025 09:00:00 GMT
Subject: Integrated: 8372704: ThreadMXBean.getThreadUserTime may return total
 time
In-Reply-To: 
References: 
Message-ID: <5o3_tBeSh_i-BrVjhdSej4wzmekb3c6TmQxd_xPuZNs=.f3223ec1-7ecd-46d9-a83b-48368f29f219@github.com>

On Thu, 27 Nov 2025 21:55:10 GMT, Jonas Norlinder  wrote:

> getThreadUserTime will return total (system + user) time if called with e.g. ManagementFactory.getThreadMXBean().getThreadUserTime(Thread.currentThread().threadId()).
> 
> The specification for this methods states that only user-level CPU time would ever be returned on success.

This pull request has now been integrated.

Changeset: 08c16c38
Author:    Jonas Norlinder 
Committer: Kevin Walls 
URL:       https://git.openjdk.org/jdk/commit/08c16c384ac9dac22da960ad718ceb95b41ca660
Stats:     2 lines in 1 file changed: 0 ins; 0 del; 2 mod

8372704: ThreadMXBean.getThreadUserTime may return total time

Reviewed-by: alanb, kevinw, dholmes

-------------

PR: https://git.openjdk.org/jdk/pull/28545

From mbaesken at openjdk.org  Fri Nov 28 10:31:19 2025
From: mbaesken at openjdk.org (Matthias Baesken)
Date: Fri, 28 Nov 2025 10:31:19 GMT
Subject: RFR: 8372588: [asan] serviceability/sa/TestJmapCore.java and
 TestJmapCoreMetaspace.java fail after recent improvements
Message-ID: 

In the 2 core related tests TestJmapCore.java and TestJmapCoreMetaspace.java we run into the errors below when using asan-enabled binaries. This is most likely because we do not write cores any more with asan; seems to be related to [JDK-8368365](https://bugs.openjdk.org/browse/JDK-8368365) .

-------------

Commit messages:
 - JDK-8372588

Changes: https://git.openjdk.org/jdk/pull/28552/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28552&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372588
  Stats: 2 lines in 2 files changed: 2 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28552.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28552/head:pull/28552

PR: https://git.openjdk.org/jdk/pull/28552

From stuefe at openjdk.org  Fri Nov 28 11:51:45 2025
From: stuefe at openjdk.org (Thomas Stuefe)
Date: Fri, 28 Nov 2025 11:51:45 GMT
Subject: RFR: 8372588: [asan] serviceability/sa/TestJmapCore.java and
 TestJmapCoreMetaspace.java fail after recent improvements
In-Reply-To: 
References: 
Message-ID: <185T3PymftcInuQ2LQxry4ly8y_kWvWNJY-glAuEZgA=.18021f9c-dbd0-4187-8a15-8a2aa41b72e4@github.com>

On Fri, 28 Nov 2025 10:23:36 GMT, Matthias Baesken  wrote:

> In the 2 core related tests TestJmapCore.java and TestJmapCoreMetaspace.java we run into the errors below when using asan-enabled binaries. This is most likely because we do not write cores any more with asan; seems to be related to [JDK-8368365](https://bugs.openjdk.org/browse/JDK-8368365) .

Okay

-------------

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28552#pullrequestreview-3518659090

From eosterlund at openjdk.org  Fri Nov 28 13:12:54 2025
From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=)
Date: Fri, 28 Nov 2025 13:12:54 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 27 Nov 2025 20:53:32 GMT, Leonid Mesnik  wrote:

>> The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 
>> 
>> I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 
>> 
>> The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
>> make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java
>> 
>> Note: 
>> I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
>> NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Added regression test

This is good, but we also use the _is_disable_suspend flag to disable JVMTI events for similar reasons, but only from the AOT thread. Now that we have a better more explicit boolean for disabling JVMTI events, perhaps we should stop toggling the _is_disable_suspend flag on the AOT thread, in favour of using this new more explicit mechanism.

Having said that, if we do, then the disabling mechanism needs to be able to cope with nesting. If you agree, then I don't mind if we want to do that refactoring separately from this fix though. The fix looks good otherwise.

-------------

Changes requested by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28544#pullrequestreview-3518962513

From azeller at openjdk.org  Fri Nov 28 14:12:49 2025
From: azeller at openjdk.org (Arno Zeller)
Date: Fri, 28 Nov 2025 14:12:49 GMT
Subject: RFR: 8372588: [asan] serviceability/sa/TestJmapCore.java and
 TestJmapCoreMetaspace.java fail after recent improvements
In-Reply-To: 
References: 
Message-ID: 

On Fri, 28 Nov 2025 10:23:36 GMT, Matthias Baesken  wrote:

> In the 2 core related tests TestJmapCore.java and TestJmapCoreMetaspace.java we run into the errors below when using asan-enabled binaries. This is most likely because we do not write cores any more with asan; seems to be related to [JDK-8368365](https://bugs.openjdk.org/browse/JDK-8368365) .

Marked as reviewed by azeller (Author).

Looks good to me.

-------------

PR Review: https://git.openjdk.org/jdk/pull/28552#pullrequestreview-3519141750
PR Comment: https://git.openjdk.org/jdk/pull/28552#issuecomment-3589483266

From cnorrbin at openjdk.org  Fri Nov 28 15:11:00 2025
From: cnorrbin at openjdk.org (Casper Norrbin)
Date: Fri, 28 Nov 2025 15:11:00 GMT
Subject: RFR: 8372615: Many container tests fail when running rootless on
 cgroup v1
Message-ID: 

Hi everyone,

Many container tests verify that various resource limits work as expected. However, when running containers in rootless mode on both Docker and Podman with cgroup v1, resource limits are not supported. This causes tests to fail with error messages like: `Resource limits are not supported and ignored on cgroups V1 rootless systems`.

To address this, we should skip these tests when running on configurations that don't support resource limits, similar to how we already handle other unsupported configurations (e.g., missing container engine or incompatibility with a specific cgroup version or container runtime).

To check for this, we now need to use `Metrics.systemMetrics().getProvider()` from `jdk.internal.platform.Metrics` to detect cgroup v1. I've added this functionality to `DockerTestUtils`, which is already used by all container tests. As a result, all container tests now need to include the `java.base/jdk.internal.platform` module, even if they don't directly test resource limits.

Testing:
* Oracle tiers 1-5
* Local testing:
  - `hotspot/jtreg/containers/` 
  - `jdk/jdk/internal/platform/docker/`
on cgroup v1/v2 with Podman and Docker in both rootful and rootless configurations

-------------

Commit messages:
 - resource limit availability checks on container tests

Changes: https://git.openjdk.org/jdk/pull/28557/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28557&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372615
  Stats: 63 lines in 21 files changed: 32 ins; 5 del; 26 mod
  Patch: https://git.openjdk.org/jdk/pull/28557.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28557/head:pull/28557

PR: https://git.openjdk.org/jdk/pull/28557

From lmesnik at openjdk.org  Fri Nov 28 20:50:32 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Fri, 28 Nov 2025 20:50:32 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled [v3]
In-Reply-To: 
References: 
Message-ID: 

> The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 
> 
> I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 
> 
> The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
> make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java
> 
> Note: 
> I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
> NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.

Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:

  update jvmti disabling in the AOT thread

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28544/files
  - new: https://git.openjdk.org/jdk/pull/28544/files/67bcdf11..1c070dc7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28544.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28544/head:pull/28544

PR: https://git.openjdk.org/jdk/pull/28544

From lmesnik at openjdk.org  Fri Nov 28 21:09:24 2025
From: lmesnik at openjdk.org (Leonid Mesnik)
Date: Fri, 28 Nov 2025 21:09:24 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled [v4]
In-Reply-To: 
References: 
Message-ID: 

> The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 
> 
> I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 
> 
> The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
> make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java
> 
> Note: 
> I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
> NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.

Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:

  made jvmti_events_disalber as counter

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28544/files
  - new: https://git.openjdk.org/jdk/pull/28544/files/1c070dc7..f7e869b2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28544&range=02-03

  Stats: 6 lines in 1 file changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/28544.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28544/head:pull/28544

PR: https://git.openjdk.org/jdk/pull/28544

From lucy at openjdk.org  Fri Nov 28 21:44:45 2025
From: lucy at openjdk.org (Lutz Schmidt)
Date: Fri, 28 Nov 2025 21:44:45 GMT
Subject: RFR: 8372588: [asan] serviceability/sa/TestJmapCore.java and
 TestJmapCoreMetaspace.java fail after recent improvements
In-Reply-To: 
References: 
Message-ID: 

On Fri, 28 Nov 2025 10:23:36 GMT, Matthias Baesken  wrote:

> In the 2 core related tests TestJmapCore.java and TestJmapCoreMetaspace.java we run into the errors below when using asan-enabled binaries. This is most likely because we do not write cores any more with asan; seems to be related to [JDK-8368365](https://bugs.openjdk.org/browse/JDK-8368365) .

Looks good.

-------------

Marked as reviewed by lucy (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28552#pullrequestreview-3520113492

From eosterlund at openjdk.org  Fri Nov 28 22:50:48 2025
From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=)
Date: Fri, 28 Nov 2025 22:50:48 GMT
Subject: RFR: 8372039: post_sampled_object_alloc is called while lock is
 handled [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 28 Nov 2025 21:09:24 GMT, Leonid Mesnik  wrote:

>> The AOT allocates objects while holding lock. The jvmti events can't be posted in such case. The allocation sampling might be just temporary disabled while AOT objects are allocated. 
>> 
>> I prefer to disable jvmti events for allocation only, not for AOT globally. If there are more events should be generated during AOT initialization, we might want to preserve them and post after initialization is completed. 
>> 
>> The existing failure could be reproduced by running tests with jvmti stress agent and ZGC enabled. Like
>> make run-test JTREG_JVMTI_STRESS_AGENT=debugger=true TEST=gc/z/TestGarbageCollectorMXBean.java
>> 
>> Note: 
>> I prelaced NoJvmtiVMObjectAllocMark, it was not used. Also it was incorrect. The 
>> NoJvmtiEventsMark should be set even if jvmti events are not enable for this thread. Since jvmti events might be enabled just in the middle of the mark.
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   made jvmti_events_disalber as counter

Looks good.

-------------

Marked as reviewed by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28544#pullrequestreview-3520191286