RFR: 8328866: Add raw monitor rank support to the debug agent. [v9]
Chris Plummer
cjplummer at openjdk.org
Mon Jul 29 18:06:52 UTC 2024
> This PR adds ranked monitor support to the debug agent. The debug agent has a large number of monitors, and it's really hard to know which order to grab them in, and for that matter which monitors might already be held at any given moment. By imposing a rank on each monitor, we can check to make sure they are always grabbed in the order of their rank. Having this in place when I was working on [JDK-8324868](https://bugs.openjdk.org/browse/JDK-8324868) would have made it much easier to detect a deadlock that was occuring, and the reason for it. That's what motivated me to do this work
>
> There were 2 or 3 minor rank issues discovered as a result of these changes. I also learned a lot about some of the more ugly details of the locking support in the process.
>
> Tested with the following on all supported platforms and with virtual threads:
>
> com/sun/jdi
> vmTestbase/nsk/jdi
> vmTestbase/nsk/jdb
> vmTestbase/nsk/jdwp
>
> Still need to run tier2 and tier5.
>
> Details of the changes follow in the first comment.
Chris Plummer 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
- Fix a couple of minor typos in comments.
- Simplify by getting rid of special logic around leaf monitors.
- Flip rank order. Some cleanup and better comments for verifyMonitorRank().
- Fix minor comment typo.
- Fix jcheck extra whitespace.
- Fix comment typo.
- Call verifyMonitorRank() when doing a wait since wait does an exit and enter, so we should do the same rank check that we do during an enter.
- Minor comment fix in debugMonitorCreate()
- Don't do anything in assertIsCurrentThread() if asserts are disabled
- ... and 8 more: https://git.openjdk.org/jdk/compare/c4e6255a...dc978d7a
-------------
Changes: https://git.openjdk.org/jdk/pull/19044/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19044&range=08
Stats: 590 lines in 11 files changed: 523 ins; 2 del; 65 mod
Patch: https://git.openjdk.org/jdk/pull/19044.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19044/head:pull/19044
PR: https://git.openjdk.org/jdk/pull/19044
More information about the serviceability-dev
mailing list