RFR: JDK-8304723: Statically allocate global mutexes [v5]

David Holmes dholmes at openjdk.org
Fri Mar 24 04:58:31 UTC 2023


On Thu, 23 Mar 2023 15:27:58 GMT, Justin King <jcking at openjdk.org> wrote:

>> Switch to statically allocate storage for all of Hotspot's global mutexes and monitors. This avoids needing to allocate each one dynamically at startup. These also live for the lifetime of the program, so this reduces any potential memory fragmention in the C heap.
>
> Justin King has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move alignas before static
>   
>   Signed-off-by: Justin King <jcking at google.com>

This version seems fine.

One query below.

Thanks.

src/hotspot/share/runtime/mutexLocker.cpp line 210:

> 208: // Specify relative ranked lock
> 209: #ifdef ASSERT
> 210: #define MUTEX_DEFL(name, type, held_lock, ...) MUTEX_DEF(name, type, (held_lock)->rank()-1, ##__VA_ARGS__)

Pre-existing but what does the 'L' suffix mean here? We now have _DEF _DEFN and _DEFL and I'm not clear what the N and L signify. ??

Nit while you are here `rank()-1` -> `rank() - 1`

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13143#pullrequestreview-1355999010
PR Review Comment: https://git.openjdk.org/jdk/pull/13143#discussion_r1147116770


More information about the hotspot-dev mailing list