[9] RFR(XXS): 8036091: compiler/membars/DekkerTest.java fails with -XX:CICompilerCount=1

Albert albert.noll at oracle.com
Mon Mar 3 04:25:12 PST 2014


Hi Aleksey,

thanks for your feedback. I just want to make clear that I do not have a 
strong opinion on this.
I understand your arguments and if it turns out that reverting to the 
original behavior (silently
start a second compiler thread) is the way to go, I will certainly not 
argue against it.

For me the only clean solution that *enforces* and *retains* the meaning 
of the fag is to enable
a compiler thread to grab tasks from both queues (or have a shared 
queue). Maybe someone
can tell why it is implemented as it is?

I agree with you that the current approach (report an error) exposes an 
unnecessary implementation
detail of HS. However, the fact that tiered compilation is enabled by 
default and that tiered compilation
is provided by two different compilers is implementation-specific to 
Hotspot. If someone looks at
the code in globals.hpp and reads "Number of compiler threads to run" 
he/she expects to have 1 compiler
thread when starting Hotspot with -XX:CICompilerCount=1.

I think it is better to report a misconfiguration to the user (HS 
currently requires at least 2 compiler
threads for tiered) than silently introducing a new behavior. I.e., 
behavior of HS changes from Java 7
to Java 8, since TieredCompilation is  enabled by default:

java -XX:CICompilerCount=1   (1 compiler thread  in Java 7)
java -XX:CICompilerCount=1   (2 compiler threads in Java 8)

So if, for whatever reason, a customer wants to have a single compiler 
thread, this behavior change
will go unnoticed. I think this is not good.

Finally, I want to say that the meaning of the flag is not well 
specified. No matter how we will proceed,
we should provide a precise definition.

Best,
Albert


On 03/03/2014 12:03 PM, Aleksey Shipilev wrote:
> Hi Albert,
>
> But, your original explanation [1] means C1 and C2 are different
> compilers, and CICompilerCount=1 could apply to both of them
> individually, which means C1 and C2 get one thread each. We can probably
> weasel out by saying the option means "*total* number of compiler threads".
>
> However, that does not help much, because we just annoy users with VM
> errors. How would user force a single compiler thread to run?
>
> Before the CICC enforcement:
>   a) +Tiered, CICC=1: user silently gets two compiler threads
>   b) -Tiered, CICC=1: user gets single compiler thread
>
> After the CICC change:
>   a) +Tiered, CICC=1: user gets the VM error. If user still wants to run
> Tiered then he/she should set CICC=2 and move on. If user wants a single
> thread, then we force him/her to disable Tiered.
>   b) -Tiered, CICC=1: user is opaque about the change
>
> So, we require users to explicitly segregate the additional
> configuration sets depending on +/-Tiered, only to communicate to them
> they maybe running two separate compilers which by implementation detail
> require two separate threads. I think there is no new and valuable
> information to the users in that parlance, only the annoying. I can see
> yet another case why would users disable Tiered right away in their
> tests, which is not what we want.
>
> I think we should rollback CICC=1 check to silently mean CICC=2 in case
> of Tiered and rework Tiered to use the common compiler thread pool, so
> that to remove the substance of this discussion. Is this doable?
> Otherwise, I think we need to have a proper CCC in place discussing the
> change in the accepted values of a product flag.
>
> -Aleksey.
>
> [1] "JDK-8034775 changed the minimum number of compiler threads for
> tiered compilation to 2, since ***each compiler*** (C1 and C2) requires
> a separate compiler thread." (emphasis is mine)
>
> On 03/03/2014 02:38 PM, Albert wrote:
>> Hi Aleksey,
>>
>> that is not what the description of the flag says:
>>
>>    product(intx, CICompilerCount, CI_COMPILER_COUNT,
>>            "Number of compiler threads to run")
>>
>> Best,
>> Albert
>>
>>
>> On 03/03/2014 11:36 AM, Aleksey Shipilev wrote:
>>> On 03/03/2014 02:28 PM, Albert wrote:
>>>> Silently using 2 instead of 1 compiler thread when tiered is enabled
>>>> and -XX:CICompilerCount=1 was the default behavior before
>>>> JDK-8034775. I worked on JDK-8034775 and back than it occurred to me
>>>> that it is strange that the JVM silently 'overrules' an explicit
>>>> command given by the user (namely that he/she wants to use only 1
>>>> compiler thread).
>>> I don't find it strange if you follow the notion of two compilers in
>>> TieredCompilation. CICompilerCount=1 means "one thread per compiler",
>>> which given two compilers means two threads. If you really want a single
>>> thread in the compiler thread pool, then you should disable one of the
>>> compilers.
>>>
>>> -Aleksey.



More information about the hotspot-compiler-dev mailing list