How to change compilation policy to trigger C2 compilation ASAP?

Tangwei (Euler) tangwei6 at huawei.com
Wed May 20 02:06:38 UTC 2015


Our real machine has 16 CPU cores, but unfortunately, our simulator can only support one thread now. So it doesn’t work for me to increase compiler threads by now.
I am glad to share if find some interesting thing.  ☺  Thanks for your help!


Regards!
wei

From: Vitaly Davidovich [mailto:vitalyd at gmail.com]
Sent: Wednesday, May 20, 2015 9:56 AM
To: Tangwei (Euler)
Cc: hotspot compiler
Subject: RE: How to change compilation policy to trigger C2 compilation ASAP?


How many CPUs are available to your jvm? Perhaps try to also bump # of compiler threads and also bump ReservedCodeCacheSize for good measure.  If you reduce thresholds to something reasonable, more compiler threads (assuming you have cores to run them on in parallel) should theoretically keep the backlog down and not stall compilations.  Also, probably best to have more C2 compiler threads than C1 since those compilations take longer.

If you do make any interesting discoveries, please do share :).

sent from my phone
On May 19, 2015 9:41 PM, "Tangwei (Euler)" <tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>> wrote:
Vitaly,
  Yes, I agree with you that tuning is necessary to get peak performance. That’s why I want to run the application on simulator by changing threshold to
collect some performance data to guide optimization in next step. I am using JAVA 8.  The number of compiler thread to run is default value 2.

Regards!
wei



From: Vitaly Davidovich [mailto:vitalyd at gmail.com<mailto:vitalyd at gmail.com>]
Sent: Wednesday, May 20, 2015 9:12 AM
To: Tangwei (Euler)
Cc: hotspot compiler
Subject: RE: How to change compilation policy to trigger C2 compilation ASAP?


These thresholds are going to effectively compile the world, gated only by backlog that will surely ensue on the compiler thread queues? I would start with using default values, and tuning them down until perf is satisfactory.  As you have it configured, I don't think tiered will help; in fact, it's probably worse than simply using C2 and lowering CompileThreshold.  I think the threshold for C2 should probably depend on how well the code runs with C1, which is likely to be very application (and hardware, to some extent) specific.

Are you using java 8? How many compiler threads for C1 and C2 are you using?

By the way, I'm likely to do some tiered experiments myself soon, so this is new territory to me as well.  At an initial glance, if default values aren't good, it seems to devolve into the same "black magic" as GC tuning.

sent from my phone
On May 19, 2015 8:43 PM, "Tangwei (Euler)" <tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>> wrote:
My goal is just to reach peak performance quickly. Following is one tier threshold combination I tried:

-XX:Tier0ProfilingStartPercentage=0
-XX:Tier3InvocationThreshold=3
-XX:Tier3MinInvocationThreshold=2
-XX:Tier3CompileThreshold=2
-XX:Tier4InvocationThreshold=4
-XX:Tier4MinInvocationThreshold=3
-XX:Tier4CompileThreshold=2

Regards!
wei


From: Vitaly Davidovich [mailto:vitalyd at gmail.com<mailto:vitalyd at gmail.com>]
Sent: Tuesday, May 19, 2015 9:33 PM
To: Tangwei (Euler)
Cc: hotspot compiler
Subject: Re: How to change compilation policy to trigger C2 compilation ASAP?


Is your goal specifically to have C2 compile or just to reach peak performance quickly? It sounds like the latter.  What values did you specify for the tier thresholds? Also, it may help you to -XX:+PrintCompilation to tune the flags as this will show you which methods are being compiled, when, and at what tier.

sent from my phone
On May 19, 2015 9:01 AM, "Tangwei (Euler)" <tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>> wrote:
Hi All,
  I want to run a JAVA application on a performance simulator, and do a profiling on a hot function JITTed with C2 compiler.
In order to make C2 compiler compile hot function as early as possible, I hope to reduce the threshold of function invocation
count in interpreter and C1 to drive the JIT compiler transitioned to Level 4 (C2) ASAP. Following is the option list I try, but
failed to find a right combination to meet my requirement. Anyone can help to figure out what options I can use?
Thanks in advance.

-XX:Tier0ProfilingStartPercentage=0
-XX:Tier3InvocationThreshold
-XX:Tier3MinInvocationThreshold
-XX:Tier3CompileThreshold
-XX:Tier4InvocationThreshold
-XX:CompileThreshold
-XX:Tier4MinInvocationThreshold
-XX:Tier4CompileThreshold

Regards!
wei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150520/b8c9f094/attachment-0001.html>


More information about the hotspot-compiler-dev mailing list