Integrated: 8323724: Remove potential re-inflation from FastHashCode under LM_LIGHTWEIGHT

Fredrik Bredberg fbredberg at openjdk.org
Thu May 2 13:56:59 UTC 2024


On Sat, 20 Apr 2024 13:38:01 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

> There is a race when a thread that tries to install the hash code finds an inflated `ObjectMonitor`, which the deflation thread is concurrently deflating, thus causing the `FastHashCode` logic to re-inflate the `ObjectMonitor`.
> 
> This PR solves that by simply taking the ObjectMonitor pointer from the markWord and retrying without inflating, if it was deflated.
> 
> This enhancement will remove the last code path which can inflate an `ObjectMonitor` from a non java thread, which in turn will simplify the `is_lock_owned` logic and allow for stronger assertions.
> 
> Tested and passes tier1-tier5 ok.

This pull request has now been integrated.

Changeset: 553d45b1
Author:    Fredrik Bredberg <fbredberg at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/553d45b11460a794613651373f34c8379c11729b
Stats:     5 lines in 1 file changed: 2 ins; 0 del; 3 mod

8323724: Remove potential re-inflation from FastHashCode under LM_LIGHTWEIGHT

Reviewed-by: aboldtch, coleenp

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

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


More information about the hotspot-runtime-dev mailing list