RFR: 8215889: assert(!_unloading) failed: This oop is not available to unloading class loader data with ZGC

Nils Eliasson nils.eliasson at oracle.com
Thu Jan 10 14:28:13 UTC 2019


Hi Erik,

Nice work! Looks good.

// Nils

On 2019-01-07 10:51, Erik Österlund wrote:
> Hi,
>
> There are SpeculativeTrapData entries in the extra data space of MDOs 
> that are currently not being checked for stale Method* entries due to 
> concurrent class unloading.
>
> The fix involves lazily cleaning SpeculativeTrapData entries during 
> ciMethodData::load_extra_data(), which unpacks the extra data from the 
> source MDO to the ci copy of the MDO, that the compiler subsequently 
> uses as reference during the ongoing compilation, and needs to have 
> live metadata only.
>
> A new ciMethodData::prepare_metadata() method is added to ci MDO 
> mirrors that lazily cleans the extra data space and pre-caches the 
> ciEnv with all the metadata it encounters. When creating ciMethod 
> handles, the Compile_lock might be taken, which strictly requires 
> safepoint checking. Therefore, prepare_metadata() loops until it can 
> pre-cache all live metadata without any cache misses, because that 
> implies the subsequent code copying the MDO can not safepoint while 
> extracting the extra data from the MDO, which is a requirement as 1) a 
> safepoint may invalidate the metadata again, 2) both the cleaning 
> (from the concurrent GC thread) and extraction (from the compiler 
> thread) must be done under the mdo->extra_data_lock().
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8215889
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8215889/webrev.00/
>
> Testing: hs-tier1-6, and a bunch of local testing, including 24 hours 
> kitchensink in fastdebug.
>
> Thanks,
> /Erik


More information about the hotspot-dev mailing list