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

Emanuel Peter epeter at openjdk.org
Fri Dec 22 08:41:53 UTC 2023


On Tue, 28 Nov 2023 14:29:45 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   removed some ttyl cases, which collided with the extra_data_lock
>
> Looks good!

@fisk @tkrodriguez I continued working on this now, and updated the description. It seems to pass the tests.

One open question is about `MethodData::bci_to_extra_data`:
The idea used to be that we would first read the extra data without a lock (concurrent == true):

`ProfileData* result = bci_to_extra_data_helper(bci, m, dp, true);`

and then if the record was missing, we would take the `extra_data_lock`, and then with `concurrent = false`:

`ProfileData* result = bci_to_extra_data_helper(bci, m, dp, false);`

and then if the record is still missing, we would allocate a new one.

Now, this code is pointless, there is no concurrent action any more because the whole method is under the `extra_data_lock`.

Should I refactor the code there, or leave that to a cleanup-RFE? (for now I left a TODO in the patch).

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

PR Comment: https://git.openjdk.org/jdk/pull/16840#issuecomment-1867395966


More information about the hotspot-dev mailing list