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

Emanuel Peter epeter at openjdk.org
Wed Nov 29 07:26:04 UTC 2023


On Wed, 29 Nov 2023 07:16:27 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> The lock needs to be held while accessing the contents of pdata which is very complicated in this particular usage pattern.  Maybe the caller needs to refetch the pointer under a lock instead of passing it out of this method.
>
> I see.
> And how about other usages of `ProfileData` from the `mdo`, like these (there is a few variants of them around):
> 
> ProfileData* data = mdo->first_data();
> ProfileData* data = mdo->bci_to_data(bci);

And there are 2 uses of `query_update_method_data`. One does not use the return `pdata`. The other uses it and in some cases updates it. Do you think it is safe to just re-fetch it, or would that potentially cut some connection between the two that should not be cut?
The alternative is just to already get the lock before calling `query_update_method_data`.

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

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


More information about the hotspot-dev mailing list