RFR: 8260301: misc gc/g1/unloading tests fails with "RuntimeException: Method could not be enqueued for compilation at level N"
Dean Long
dlong at openjdk.java.net
Wed Feb 3 03:17:41 UTC 2021
On Tue, 2 Feb 2021 15:44:16 GMT, Vladimir Kozlov <kvn 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_*.
Looks good.
-------------
Marked as reviewed by dlong (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2356
More information about the hotspot-compiler-dev
mailing list