[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-hotspot-runtime-dev
Subject: Integrated: JDK-8275704: Metaspace::contains() should be threadsafe
From: Thomas Stuefe <stuefe () openjdk ! java ! net>
Date: 2021-10-28 5:33:37
Message-ID: 0T3CR6MCK-CSd0tLDjnAQQO2Fh7mY_SHGyoeKl1v_bA=.3cc6258c-97b3-468f-8e6f-011c01100398 () github ! com
[Download RAW message or body]
On Thu, 21 Oct 2021 09:14:26 GMT, Thomas Stuefe <stuefe@openjdk.org> wrote:
> Metaspace::contains() is used in many places. It is not threadsafe since it walks \
> the list of metaspace mappings, which can be altered concurrently. This is \
> suspected to be the cause of JDK-8271124.
> Currently, it does not lock, and adding a lock is not realistic either. It should \
> work lockless.
> This patch builds atop of https://bugs.openjdk.java.net/browse/JDK-8275582, which \
> removed the old (pre JEP 387) technique of uncommitting metaspace memory. As a side \
> effect, that patch changed the mapping list to an add-only structure. The only \
> remaining place where it gets modified is in VirtualSpaceList::create_node(). \
> Modifications are synchronized via lock. The only place where we walk the list \
> locklessly is in Metaspace::contains(). This patch adds the appropriate memory \
> barriers to those two places.
> Tests:
> - GHAs
> - SAP nightlies (queued)
This pull request has now been integrated.
Changeset: d9b0138d
Author: Thomas Stuefe <stuefe@openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/d9b0138d7d02ceddc5d9c73908177f0b0d2e7c54
Stats: 23 lines in 2 files changed: 15 ins; 1 del; 7 mod
8275704: Metaspace::contains() should be threadsafe
Reviewed-by: coleenp, dholmes
-------------
PR: https://git.openjdk.java.net/jdk/pull/6060
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic