RFR: 8323724: Remove potential re-inflation from FastHashCode under LM_LIGHTWEIGHT
Fredrik Bredberg
fbredberg at openjdk.org
Thu May 2 12:43:53 UTC 2024
On Wed, 24 Apr 2024 16:18:25 GMT, Coleen Phillimore <coleenp 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 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.
>
> Is there an RFE for this? It looks like a good cleanup.
@coleenp
> Is there an RFE for this? It looks like a good cleanup.
Do you think I should create a RFE for this, before integrating this PR?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18876#issuecomment-2090402428
More information about the hotspot-runtime-dev
mailing list