RFR(S) 8231125 Improve testing of parallel loading of shared classes by the boot class loader

David Holmes david.holmes at oracle.com
Wed Sep 18 01:27:55 UTC 2019


Hi Ioi,

On 18/09/2019 7:24 am, coleen.phillimore at oracle.com wrote:
> http://cr.openjdk.java.net/~iklam/jdk14/8231125-shared-boot-class-parallel-test.v01/src/hotspot/share/classfile/systemDictionary.cpp.udiff.html 
> 
> 
> Can you add a line something like.
> 
> + if (class_loader() == NULL) {
> + // See case 3 in SystemDictionary::resolve_instance_class_or_null
> +      // multiple threads wait on the SystemDictionary_lock if the boot 
> loader class is in the placeholder table, so only
> +      // one thread loads the class.
> + assert(ik->class_loader_data() == NULL, "boot loader classes are not 
> loaded in parallel");
> + }
> +

Even with Coleen's suggested comment I still don't see what this code 
has to do with loading in parallel? AFAICS all you are asserting is that 
if the class is to be loaded by the boot-loader then the class should 
have been dumped by the boot-loader - no?

The test seems okay - the proof is in the running :)

One style nit:

!         for (int i=0; i<APP_LOOPS; i++) {

spaces around binary operators please. This seems to impact all for loops.

Also:

175             {   // Avoid logging in this block so the threads can 
proceeds without

s/proceeds/proceed/

Thanks,
David
-----

> I wonder if the ObjectLocker is really needed for non-bootclass loaders 
> below this code, since it appears to not be needed for boot class loaders.
> 
> The test changes look good.  I think you're supposed to have @bug tags 
> in them.
> 
> Thanks for going through this code looking for races!
> Coleen
> 
> 
> On 9/17/19 1:10 PM, Ioi Lam wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8231125
>> http://cr.openjdk.java.net/~iklam/jdk14/8231125-shared-boot-class-parallel-test.v01/ 
>>
>>
>>
>> [1] Modified ParallelLoadTest.java to also test the loading of shared 
>> classes
>>     into the boot loader.
>> [2] Modified ParallelLoad.java to minimize the initial time lag when 
>> the 4 parallel
>>     threads compete to load the same class.
>> [3] Added an assert in the JVM to verify that for a shared classes loaded
>>     the boot class loader, SystemDictionary::load_shared_class is not 
>> called
>>     multiple times.
>>
> 


More information about the hotspot-runtime-dev mailing list