RFR: 8298469: Obsolete legacy parallel class loading workaround for non-parallel-capable class loaders

Coleen Phillimore coleenp at openjdk.org
Mon Mar 13 13:57:42 UTC 2023


On Mon, 13 Mar 2023 02:14:22 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> This change removes the JVM code and option (default off) to synchronize class loading for non-parallel capable class loading.  For more information see: https://bugs.openjdk.org/browse/JDK-8295673
>> and Release Note for the option in 20: https://bugs.openjdk.org/browse/JDK-8296446
>> 
>> Now Release Note for removal: https://bugs.openjdk.org/browse/JDK-8303967
>> 
>> Tested with tier1-7.
>
> src/hotspot/share/classfile/placeholders.cpp line 137:
> 
>> 135:   assert(action != PlaceholderTable::LOAD_INSTANCE || !EnableWaitForParallelLoad || seen == nullptr,
>> 136:          "Only one LOAD_INSTANCE allowed at a time");
>> 137: 
> 
> Getting rid of the full assertion seems to go beyond obsoleting EnableWaitForParallelLoad.

The assertion reduces to something somewhat useless.  Without EnableWaitForParallel load, you can have more then one thread with a LOAD_INSTANCE placeholder.  These threads will wait when the go call into ClassLoader.loadClass() now.
There is nothing to assert here anymore.

> src/hotspot/share/classfile/systemDictionary.cpp line 564:
> 
>> 562: 
>> 563: // For bootstrap and non-parallelCapable class loaders, check and wait for
>> 564: // another thread to complete loading this class.
> 
> A replacement comment describing the method would be nice.

Ok, how about
// Check for other threads loading this class either to throw CCE or wait in the case of the boot loader.

> src/hotspot/share/classfile/systemDictionary.cpp line 604:
> 
>> 602:         } else {
>> 603:           return nullptr;
>> 604:         }
> 
> Again unclear how this all disappears just because the flag is obsoleted.

Only the bootclass loader waits on the SystemDictionary_lock for multiple threads now.  Not the non-parallel capable class loaders.

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

PR: https://git.openjdk.org/jdk/pull/12974


More information about the hotspot-runtime-dev mailing list