RFR: 8144944: JVMCI compiler initialization can happen on different thread than JVMCI initialization

Doug Simon doug.simon at oracle.com
Wed Dec 9 22:01:06 UTC 2015


Thanks for the review.

-Doug

> On 09 Dec 2015, at 22:46, Christian Thalinger <christian.thalinger at oracle.com> wrote:
> 
>> 
>> On Dec 9, 2015, at 11:33 AM, Doug Simon <doug.simon at oracle.com> wrote:
>> 
>>> 
>>> On 09 Dec 2015, at 21:18, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>>> 
>>>> 
>>>> On Dec 8, 2015, at 12:07 PM, Doug Simon <doug.simon at oracle.com> wrote:
>>>> 
>>>> The timer used for JVMCI related initialization (enabled by -Djvmci.inittimer=true) currently assumes that all JVMCI related initialization happens on the same thread. This is wrong. While all related initialization should happen on the same thread, core JVMCI initialization may be performed by one compiler thread and JVMCI compiler (e.g., Graal) initialization may be performed on a different compiler thread.
>>>> 
>>>> For example, one compiler thread may be the first to execute:
>>>> 
>>>> http://hg.openjdk.java.net/graal/graal-jvmci-9/hotspot/file/7a570929c5e5/src/share/vm/jvmci/jvmciCompiler.cpp#l129
>>>> 
>>>> which can trigger core JVMCI initialization while a different compiler thread is the first to reach:
>>>> 
>>>> http://hg.openjdk.java.net/graal/graal-jvmci-9/hotspot/file/7a570929c5e5/src/share/vm/jvmci/jvmciCompiler.cpp#l145
>>>> 
>>>> which triggers JVMCI compiler initialization.
>>> 
>>> How and when did the bug manifest?
>> 
>> It appears sporadically with an assertions-enabled bootstrap (i.e., -esa -XX:+BootstrapJVMCI).
>> 
>>> I guess writing a test is impossible.  If that’s the case please add the noreg-hard label.
>> 
>> Done.
>> 
>>> 
>>>> 
>>>> https://bugs.openjdk.java.net/browse/JDK-8144944
>>>> http://cr.openjdk.java.net/~dnsimon/8144944/
>>> 
>>>     @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "only the initializing thread accesses this field")
>>> 
>>> Is that still required?  Which field was it?
>> 
>> It used to be timerDepth but now it’s initializingThread. So yes, it is still required.
> 
> That’s what I figured but thanks for confirming.  Looks good.
> 
>> 
>> -Doug



More information about the hotspot-compiler-dev mailing list