RFR: 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

Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/19100#issuecomment-2097739754


More information about the hotspot-dev mailing list