RFR: 8306767: Concurrent repacking of extra data in MethodData is potentially unsafe [v16]

Emanuel Peter epeter at openjdk.org
Mon Jan 15 10:29:22 UTC 2024


On Thu, 11 Jan 2024 15:59:47 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.
>
> @fisk @tkrodriguez what do you suggest for that?

Should I create a wrapper object for it? Maybe a `MutexLockerAndNoSafepointVerifier`? Would I place that simply in `methodData.hpp`? Or make it available more widely?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16840#discussion_r1452191879


More information about the hotspot-dev mailing list