RFR: 8260301: misc gc/g1/unloading tests fails with "RuntimeException: Method could not be enqueued for compilation at level N"

Vladimir Kozlov kvn at openjdk.java.net
Wed Feb 3 18:08:44 UTC 2021


On Wed, 3 Feb 2021 16:27:54 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:

>> On return WB wait to acquire Compile_lock before checking compilation status
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/prims/whitebox.cpp#L988 
>> 
>> This lock is used by ciEnv for compiled code publishing:
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/ci/ciEnv.cpp#L981
>> 
>> So while WB waits the lock compiler thread can finish compilation, register nmethod and clear method's queued_for_compilation bit.
>> 
>> The problem is that WB check `nm` value (compiled code) which it got before the lock and when method compilation is not finished.
>> 
>> The fix is to check compiled code again similar to check in CompileBroker:
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compileBroker.cpp#L1501 
>> 
>> Passed hs-tier1-4 testing and 100 x vmTestbase/gc/g1/unloading/tests/unloading_compilation_*.
>
> LGTM

Thank you, Igor

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

PR: https://git.openjdk.java.net/jdk/pull/2356


More information about the hotspot-compiler-dev mailing list