Integrated: 8331714: Make OopMapCache installation lock-free
Aleksey Shipilev
shade at openjdk.org
Tue May 7 08:32:58 UTC 2024
On Mon, 6 May 2024 10:02:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Trying to solve [JDK-8331572](https://bugs.openjdk.org/browse/JDK-8331572) runs into all sorts of lock ranking issues with `OopMapCacheAlloc_lock`. I think it would be a bit saner to rewrite the double-checked locking installation to atomic lock-free. OpenJDK code was using this lock since the initial load.
>
> There is a drawback that we might be trying to instantiate multiple `OopMapCache` instances from multiple threads. I think this is not a practical problem, as only a few threads would race here, and the allocation is relatively small (32*8 = 512 bytes). In imaginary worst^W nightmare case, with 100K threads racing we get a temporary native memory spike at +50M.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `all` tests
This pull request has now been integrated.
Changeset: a2584a83
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/a2584a8341b2dc9c102abd373a890b2108d3f57e
Stats: 12 lines in 3 files changed: 1 ins; 3 del; 8 mod
8331714: Make OopMapCache installation lock-free
Reviewed-by: zgu, coleenp
-------------
PR: https://git.openjdk.org/jdk/pull/19100
More information about the hotspot-dev
mailing list