RFR: 8306767: Concurrent repacking of extra data in MethodData is potentially unsafe [v16]
Emanuel Peter
epeter at openjdk.org
Mon Jan 15 12:35:59 UTC 2024
On Mon, 15 Jan 2024 12:29:20 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/ci/ciMethodData.cpp line 135:
>>
>>> 133:
>>> 134: // Lock to read ProfileData, and ensure lock is not unintentionally broken by a safepoint
>>> 135: MutexLocker ml(mdo->extra_data_lock(), Mutex::_no_safepoint_check_flag);
>>
>> Is there anyway to have MutexLocker take care of verifying that the there's no safepoint? It would be nice to replace:
>>
>>
>> MutexLocker ml();
>> NoSafepointVerifier no_safepoint;
>>
>>
>> by:
>>
>>
>> MutexLocker ml();
>>
>>
>> only.
>
> @rwestrel I introduced a `NoSafepointMutexLocker`, which is composed of both a `ConditionalMutexLocker` and a `NoSafepointVerifier`.
But in this specific instance I keep them separate, because I need to pass the `NoSafepointVerifier` down, so that I can pass it to the `PauseNoSafepointVerifier`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16840#discussion_r1452320637
More information about the hotspot-dev
mailing list