JDK-8329351 : Add runtime/Monitor/TestRecursiveLocking.java for recursive Java monitor stress testing
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2024-03-29
  • Updated: 2024-12-06
  • Resolved: 2024-12-04
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 24
24 b27Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We've recently changed the recursive Java monitor mechanism
for LockingMode == LM_LIGHTWEIGHT. We could use some
stress testing.

The first test to be added is:

runtime/Monitor/TestRecursiveLocking.java

- This test has two modes:
  - 1 - outer and inner
  - 2 - alternate A and B

The SynchronizedObject class and the OUTER followed by INNER
testing model is adapted from [~aboldtch]'s test program:
runtime/lockStack/TestLockStackCapacity.java 

There are a total of 18 configs for this test:
- 6 groups of the three LockingMode configs:
  - 0 - LM_MONITOR
  - 1 - LM_LEGACY
  - 2 - LM_LIGHTWEIGHT
- The first group tests recursive locking in -Xint in outer then inner mode.
- The second group tests recursive locking in -Xint in alternate A and B mode.
- The third group tests recursive locking in C1 in outer then inner mode.
- The fourth group tests recursive locking in C1 in alternate A and B mode.
- The fifth group tests recursive locking in C2 in outer then inner mode.
- The sixth group tests recursive locking in C2 in alternate A and B mode.

By default, each of the 18 testing configs runs for 5 seconds for a total
of 90 seconds of execution time with JOBS=1. Obviously higher JOBS
values will do things in parallel as resources are available. The default
version of the test is NOT run in Tier1; it is run in Tier2 intentionally since
this is a stress test.

runtime/Monitor/StressWrapper_TestRecursiveLocking_36M.java is a
wrapper that executes runtime/Monitor/TestRecursiveLocking.java for
2 minutes for each of the 18 configs for a total of 36 minutes of execution
time with JOBS=1. Again, higher JOBS values will do things in parallel as
resources are available. The StressWrapper_TestRecursiveLocking_36M.java
version of the test is run in Tier3 and is NOT run in Tier1 or Tier2.
Comments
Changeset: 994504c3 Branch: master Author: Fredrik Bredberg <fbredberg@openjdk.org> Date: 2024-12-04 09:32:33 +0000 URL: https://git.openjdk.org/jdk/commit/994504c3e1440401a22ad3bdb30413f9db8a7780
04-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22238 Date: 2024-11-19 13:09:22 +0000
19-11-2024

Was asked to take over from [~dcubed] who's just too busy. Will create new PR.
19-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/18664 Date: 2024-04-05 19:23:52 +0000
02-10-2024