RFR (S): 8214522: Last runtime locking issues for concurrent class unloading
Erik Österlund
erik.osterlund at oracle.com
Fri Nov 30 14:36:55 UTC 2018
Hi Coleen,
On 2018-11-30 15:34, coleen.phillimore at oracle.com wrote:
>
> On 11/30/18 7:45 AM, Erik Österlund wrote:
>> Hi,
>>
>> There are a few asserts and one lock acquisition remaining for
>> concurrent class unloading to be happy.
>>
>> The asserts are changed to comply with
>> SystemDictionary::do_unloading() being done concurrently under the
>> CLDG lock, and ClassLoaderDataGraph::purge() being called without any
>> locks taken (as the data has been unlinked and subsequently had a
>> global handshake performed to make sure nobody is looking at the
>> unloading list any longer).
>
> This seems okay but JFR looks at the unloading list in a safepoint, I
> think. As such, that should be safe.
As far as I could tell, JFR only looks at the unloading list during
SystemDictionary::do_unloading(), which is done under the CLDG lock.
>>
>> The MetaspaceExpand_lock in
>> MetaspaceUtils::find_enclosing_virtual_space() is needed because
>> Metaspace::purge() uses the MetaspaceExpand_lock, and reads are not
>> safe without this lock. This lock was in Coleens original webrev last
>> sweep, but when I was asked why we needed it, I did not remember why
>> so we decided to leave it out until I could remember why I added that.
>> This is why.
>>
>
> Other locks and assertion changes look good to me.
Thanks for reviewing!
/Erik
> Thanks,
> Coleen
>
>> Bugs:
>> https://bugs.openjdk.java.net/browse/JDK-8214522
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8214522/webrev.00/
>>
>> Thanks,
>> /Erik
>
More information about the hotspot-runtime-dev
mailing list