RFR: 8294759: Print actual lock/monitor ranking [v3]

Aleksey Shipilev shade at openjdk.org
Wed Oct 5 16:14:45 UTC 2022


On Tue, 4 Oct 2022 21:49:42 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Ah, I was being defensive about this: computing min/max without relying on the actual `Rank` definition. While `0` is plausibly the lowest rank, I don't really want to rely on `safepoint` being the last rank. This is debugging code, so we can spend some time on this. Makes sense?
>
> All the other code in this file thinks safepoint is the last rank (it's an invariant) and INT_MAX is a bit large even for debugging code.  I think safepoint would be better. I marked it as reviewed so am not really insistent., but it looked weird to me.

Yeah, I can now see the `Mutex` constructor asserts the rank is within (0...safepoint). But it still feels a bit fragile to rely on, so I left it as is. This debugging code, we better off overdoing stuff rather than misleading developers. I added a few comments, though!

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

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


More information about the hotspot-runtime-dev mailing list