RFR(M): 8219584: Try to dump error file by thread which causes safepoint timeout

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Mar 6 19:14:00 UTC 2019


Hi Martin,

On 3/6/19 3:43 AM, Doerr, Martin wrote:
> Hi,
> 
> my proposal JDK-8219584 is currently being reviewed on hotspot-runtime-dev, but it contains a small test which 
> explicitly uses C2.
> 
> May I get a review for TestAbortVMOnSafepointTimeout.java, please?
> 
> Webrev:
> 
> http://cr.openjdk.java.net/~mdoerr/8219584_kill_thread_on_safepoint_timeout/webrev.02/
> 
> Bug with description of the feature:
> 
> https://bugs.openjdk.java.net/browse/JDK-8219584
> 
> The purpose of the method “test_loop” is to loop long enough to hit a safepoint timeout (with configured timeout delay).
> 
> I compile it directly by C2 with -XX:-UseCountedLoopSafepoints and -XX:LoopStripMiningIter=0.

Yes, these flags combination should work even if one of this flag is set by testing infra.
Also you correctly use @requires vm.compiler2.enabled to run VM build where these flag are available.

> 
> This should force the loop to get compiled without safepoint and 2 billion divisions should definitely take long enough 
> to hit a 500ms safepoint timeout.

Compiling with -Xcomp may produce unexpected result. Did you look on generated code for test_loop() method?
Also use something smaller then Integer.MAX_VALUE for limit (subtract -100 for example) to simplify logic for overflow 
checks.
You may also add -XX:LoopUnrollLimit=0 to avoid unrolling and other loop optimizations which you don't need. Check 
generated code.

> 
> I’ve tested it many times on all platforms we have and I’ve never seen it failing.

Did you tested on SPARC? How long it takes to run on it?

> 
> Is it fine to rely on this?

Yes, I think so.

Vladimir

> 
> Best regards,
> 
> Martin
> 


More information about the hotspot-compiler-dev mailing list