RFR: 8300926: Several startup regressions ~6-70% in 21-b6 all platforms [v4]

Coleen Phillimore coleenp at openjdk.org
Wed Feb 22 17:29:58 UTC 2023


On Tue, 21 Feb 2023 08:08:00 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> Hi all, please consider.
>> 
>> The original issue was when thread 1 asked to deopt nmethod set X and thread 2 asked for the same or a subset of X.
>> All method will already be marked, but the actual deoptimizing, not entrant, patching PC on stacks and patching post call nops, was not done yet. Which meant thread 2 could 'pass' thread 1.
>> Most places did deopt under Compile_lock, thus this is not an issue, but WB and clearCallSiteContext do not.
>> 
>> Since a handshakes may take long before completion and Compile_lock is used for so much more than deopts.
>> The fix in https://bugs.openjdk.org/browse/JDK-8299074 instead always emitted a handshake even when everything was already marked. (instead of adding Compile_lock to all places)
>> 
>> This turnout to be problematic in the startup, for example the number of deopt handshakes in jetty dry run startup went from 5 to 39 handshakes.
>> 
>> This fix first adds a barrier for which you do not pass until the requested deopts have happened and it coalesces the handshakes.
>> Secondly it moves handshakes part out of the Compile_lock where it is possible.
>> 
>> Which means we fix the performance bug and we reduce the contention on Compile_lock, meaning higher throughput in compiler and things such as class-loading.
>> 
>> It passes t1-t7 with flying colours! t8 still not completed and I'm redoing some testing due to last minute simplifications.
>> 
>> Thanks, Robbin
>
> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Coleen fix

I had two small additional requests.  I also reviewed the redefine classes and code cache code that I know and looks fine.

src/hotspot/share/classfile/vmClasses.cpp line 252:

> 250:   Dictionary* dictionary = loader_data->dictionary();
> 251:   dictionary->add_klass(THREAD, klass->name(), klass);
> 252:   SystemDictionary::add_to_hierarchy(klass, THREAD);

One more small changes please.  Can you make JavaThread* current the first parameter so this doesn't look like we're failing to throw an exception from these calls?

src/hotspot/share/oops/instanceKlass.hpp line 34:

> 32: #include "oops/instanceKlassFlags.hpp"
> 33: #include "oops/instanceOop.hpp"
> 34: #include "runtime/deoptimization.hpp"

Can you just forward declare DeoptimizationScope rather than including the whole file here?

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

Marked as reviewed by coleenp (Reviewer).

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


More information about the hotspot-dev mailing list