RFR (S): 8214522: Last runtime locking issues for concurrent class unloading

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Fri Nov 30 14:34:36 UTC 2018


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.
>
> 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,
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