JDK-8257831 : Suspend with handshakes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-07
  • Updated: 2021-04-29
  • Resolved: 2021-04-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b20Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Suspend is done via the _suspend_flag.
If we instead suspend via handshake it will reduce complicity and take us one step further to removing the _suspend_flag.
Comments
Changeset: 86bd44fe Author: Robbin Ehn <rehn@openjdk.org> Date: 2021-04-22 10:30:47 +0000 URL: https://git.openjdk.java.net/jdk/commit/86bd44fe
22-04-2021

Since this fix is making changes to the way suspend/resume works at thread exit time, I decided to do some focused testing on that code path. I created: JDK-8265240 runtime/Thread/SuspendAtExit.java needs updating to track updates to the existing test. I've run the updated test in parallel for 9 hours each for both configs of the test on the {fastdebug,release,slowdebug} configs on my MBP13: $ grep ^Executed doit_SuspendAtExit_*.log.9h.21 doit_SuspendAtExit_HandshakeALot_fastdebug.log.9h.21:Executed 1786444 loops in 32400 seconds. doit_SuspendAtExit_HandshakeALot_release.log.9h.21:Executed 1689146 loops in 32400 seconds. doit_SuspendAtExit_HandshakeALot_slowdebug.log.9h.21:Executed 810227 loops in 32400 seconds. doit_SuspendAtExit_fastdebug.log.9h.21:Executed 1839530 loops in 32400 seconds. doit_SuspendAtExit_release.log.9h.21:Executed 1857908 loops in 32400 seconds. doit_SuspendAtExit_slowdebug.log.9h.21:Executed 835304 loops in 32400 seconds. and Linux-X64 server: $ grep ^Executed doit_SuspendAtExit_*.log.9h.21 doit_SuspendAtExit_fastdebug.log.9h.21:Executed 1332863 loops in 32400 seconds. doit_SuspendAtExit_HandshakeALot_fastdebug.log.9h.21:Executed 2471544 loops in 32400 seconds. doit_SuspendAtExit_HandshakeALot_release.log.9h.21:Executed 397672 loops in 32400 seconds. doit_SuspendAtExit_HandshakeALot_slowdebug.log.9h.21:Executed 1009005 loops in 32400 seconds. doit_SuspendAtExit_release.log.9h.21:Executed 167232 loops in 32400 seconds. doit_SuspendAtExit_slowdebug.log.9h.21:Executed 531029 loops in 32400 seconds. This was the last changeset from [~rehn] that I tested in the above runs: commit 5034e8a54467b942186fc7da61ec04a8008b4aa5 Author: Robbin Ehn <robbin.ehn@oracle.com> Date: Tue Apr 13 09:36:56 2021 +0200 Obsolete unused flags
16-04-2021

Did another round of testing on v06 with the three ported tests from JDK-8262881 in parallel for 6 hours for each test on the {fastdebug,release,slowdebug} configs on my MBP13: $ grep ^Executed doit_SuspendWith*.6h.21 doit_SuspendWithObjectMonitorEnter_fastdebug.log.6h.21:Executed 45816358 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_release.log.6h.21:Executed 65810760 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.6h.21:Executed 23425185 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.6h.21:Executed 62580351 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_release.log.6h.21:Executed 92699345 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.6h.21:Executed 32187014 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.6h.21:Executed 42739510 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_release.log.6h.21:Executed 59911129 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.6h.21:Executed 22020039 loops in 21600 seconds. This was the last changeset from [~rehn] that I tested in the above runs: commit 5034e8a54467b942186fc7da61ec04a8008b4aa5 Author: Robbin Ehn <robbin.ehn@oracle.com> Date: Tue Apr 13 09:36:56 2021 +0200 Obsolete unused flags
14-04-2021

Thank you Dan!
13-04-2021

Did another round of testing on v03 with the three ported tests from JDK-8262881 in parallel for 6 hours for each test on the {fastdebug,release,slowdebug} configs on my MBP13: $ grep ^Executed doit_SuspendWith*.6h.20 doit_SuspendWithObjectMonitorEnter_fastdebug.log.6h.20:Executed 45639866 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_release.log.6h.20:Executed 64989073 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.6h.20:Executed 23559223 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.6h.20:Executed 63396499 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_release.log.6h.20:Executed 93075208 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.6h.20:Executed 32507885 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.6h.20:Executed 42498870 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_release.log.6h.20:Executed 59569806 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.6h.20:Executed 21692135 loops in 21600 seconds. This was the last changeset from [~rehn] that I tested in the above runs: commit ed8accf0e101d6a981a47d714db66c9a65196227 Author: Robbin Ehn <robbin.ehn@oracle.com> Date: Thu Apr 8 09:05:26 2021 +0200 White space fixes
12-04-2021

I ran the three ported tests from JDK-8262881 in parallel for 6 hours for each test on the {fastdebug,release,slowdebug} configs on my MBP13: $ grep ^Executed doit_Sus6h.0h*.log.20m.0 doit_SuspendWithObjectMonitorEnter_fastdebug.log.6h.0:Executed 63009098 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.6h.0:Executed 33090961 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.6h.0:Executed 60323579 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_release.log.6h.0:Executed 89511275 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.6h.0:Executed 30969125 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.6h.0:Executed 42844815 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_release.log.6h.0:Executed 60072283 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.6h.0:Executed 22401881 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_release.log is missing from the above because it had a crash that possibly unrelated to this bug fix. I'm investigating. And on my Linux-X64 server: $ grep ^Executed doit_SuspendWith*.log.6h.0 doit_SuspendWithObjectMonitorEnter_fastdebug.log.6h.0:Executed 42300565 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_release.log.6h.0:Executed 55498698 loops in 21600 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.6h.0:Executed 21445532 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.6h.0:Executed 44728083 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_release.log.6h.0:Executed 60380169 loops in 21600 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.6h.0:Executed 22101842 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.6h.0:Executed 42691863 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_release.log.6h.0:Executed 54887246 loops in 21600 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.6h.0:Executed 22177525 loops in 21600 seconds.
16-03-2021

I'm using the following issue: JDK-8262881 port JVM/DI tests from JDK-4413752 to JVM/TI to provide some targeted testing for [~rehn]'s work on this issue. I ran the three ported tests from JDK-8262881 in parallel for 20 minutes for each test on the {fastdebug,release,slowdebug} configs on my MBP13: $ grep ^Executed doit_SuspendWith*.log.20m.0 doit_SuspendWithObjectMonitorEnter_fastdebug.log.20m.0:Executed 2627337 loops in 1200 seconds. doit_SuspendWithObjectMonitorEnter_release.log.20m.0:Executed 3694232 loops in 1200 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.20m.0:Executed 1391509 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.20m.0:Executed 3794492 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_release.log.20m.0:Executed 5415668 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.20m.0:Executed 2014911 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.20m.0:Executed 2658649 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_release.log.20m.0:Executed 3640576 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.20m.0:Executed 1428265 loops in 1200 seconds. And on my Linux-X64 server: $ grep ^Executed doit_SuspendWith*.log.20m.0 doit_SuspendWithObjectMonitorEnter_fastdebug.log.20m.0:Executed 2352385 loops in 1200 seconds. doit_SuspendWithObjectMonitorEnter_release.log.20m.0:Executed 3120738 loops in 1200 seconds. doit_SuspendWithObjectMonitorEnter_slowdebug.log.20m.0:Executed 1193120 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_fastdebug.log.20m.0:Executed 3333137 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_release.log.20m.0:Executed 4536498 loops in 1200 seconds. doit_SuspendWithObjectMonitorWait_slowdebug.log.20m.0:Executed 1675100 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_fastdebug.log.20m.0:Executed 2350135 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_release.log.20m.0:Executed 3024200 loops in 1200 seconds. doit_SuspendWithRawMonitorEnter_slowdebug.log.20m.0:Executed 1232610 loops in 1200 seconds.
15-03-2021

The following two (ancient) bugs are related to this work: JDK-4413752 Linux: suspended thread blocks raw ObjectMonitor entry JDK-4333847 test mncntenter001 causes hotspot intermittently hangs The first bug covers the suspended thread entering a raw monitor case and the second bug covers the suspended thread entering a Java monitor case.
01-03-2021