Integrated: JDK-8314654: Metaspace: move locking out of MetaspaceArena

Thomas Stuefe stuefe at openjdk.org
Thu Oct 5 06:05:25 UTC 2023


On Mon, 28 Aug 2023 13:18:02 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> We have the following relationships.
> 
> 
> 
> -->  CLD  --> ClassLoaderMetaspace  ----+---> MetaspaceArena (nonclass)
>                                         |
>                                         |                                                                
>                                         +---> MetaspaceArena (class)
> 
> 
> 
> For historical reasons, `MetaspaceArena` locks itself with a lock owned by `ClassLoaderData` on all public entry points. That is unnecessarily complex. The natural point for this locking would be in the `ClassLoaderMetaspace` class.
> 
> Moving locking up one layer reduces complexity and prepares for some upcoming Metaspace changes for Liliput.
> 
> Note: Nothing functional changes. We lock the same paths as before, only where we used to lock upon entry in MA, we now lock in the caller.
> 
> In gtests, however, I got rid entirely of locking since all those tests are single-threaded, and the implicit locking done by MA had been just unnecessary.

This pull request has now been integrated.

Changeset: c6c69b57
Author:    Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/c6c69b579c71238db5a6f940160d481992eec735
Stats:     108 lines in 6 files changed: 19 ins; 72 del; 17 mod

8314654: Metaspace: move locking out of MetaspaceArena

Reviewed-by: adinn, jsjolen

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

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


More information about the hotspot-runtime-dev mailing list