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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Vladimir Kozlov-2
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_*.

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

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

Changes: https://git.openjdk.java.net/jdk/pull/2356/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2356&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8260301
  Stats: 9 lines in 1 file changed: 9 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2356.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2356/head:pull/2356

PR: https://git.openjdk.java.net/jdk/pull/2356
Reply | Threaded
Open this post in threaded view
|

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

Dean Long-2
On Tue, 2 Feb 2021 15:44:16 GMT, Vladimir Kozlov <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

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

Vladimir Kozlov-2
On Wed, 3 Feb 2021 03:15:16 GMT, Dean Long <[hidden email]> 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.

Thank you, Dean

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

PR: https://git.openjdk.java.net/jdk/pull/2356
Reply | Threaded
Open this post in threaded view
|

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

Igor Ignatyev-2
In reply to this post by Vladimir Kozlov-2
On Tue, 2 Feb 2021 15:44:16 GMT, Vladimir Kozlov <[hidden email]> 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

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

Marked as reviewed by iignatyev (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2356
Reply | Threaded
Open this post in threaded view
|

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

Vladimir Kozlov-2
In reply to this post by Vladimir Kozlov-2
On Tue, 2 Feb 2021 15:44:16 GMT, Vladimir Kozlov <[hidden email]> 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_*.

This pull request has now been integrated.

Changeset: f025bc1d
Author:    Vladimir Kozlov <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/f025bc1d
Stats:     9 lines in 1 file changed: 9 ins; 0 del; 0 mod

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

Reviewed-by: dlong, iignatyev

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

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