RFR: 8331714: Make OopMapCache installation lock-free
Zhengyu Gu
zgu at openjdk.org
Mon May 6 13:31:52 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:
> - [ ] Linux x86_64 server fastdebug, `all` tests
LGTM. Very similar to what I made in [PR #16074](https://github.com/openjdk/jdk/pull/16074)
-------------
Marked as reviewed by zgu (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19100#pullrequestreview-2040789441
More information about the hotspot-dev
mailing list