JDK-8146705 : Improve JVMCI support for blocking compilation
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-01-08
  • Updated: 2018-03-23
  • Resolved: 2016-01-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b105Fixed
Related Reports
Relates :  
Relates :  
Description
As a result of JDK-8141330, the CompileBroker uses a timeout of 1 second when waiting for a blocking JVMCI compilation to complete. This approach is too simple. JVMCI compiler threads themselves flood the compilation queues with compilation requests; such compilations cannot be blocking (the JVMCI compiler executes Java code and so can cause the system to deadlock). This flooding means that application submitted tasks often timeout before the tasks even start compiling.
Once a JVMCI thread starts compiling a task, there is still the risk of it deadlocking. The current timeout mechanism needs to be augmented with a test of the compiler thread's state. As long as it's not blocked for too long, we know the compiler is making progress and will eventually complete.

This issue covers the following changes when the VM is in blocking compilation mode:

1. Blocking tasks are selected before non-blocking tasks from the compilation queue(s).
2. A thread waiting for a compilation task to complete checks the state of the compiler thread periodically (500ms intervals). If 5 successive checks see a blocked thread, the compilation times out and the waiting thread is unblocked.
Comments
http://cr.openjdk.java.net/~dnsimon/8146705/
11-01-2016

http://hg.openjdk.java.net/graal/graal-jvmci-8/rev/9d78d44d3aac http://hg.openjdk.java.net/graal/graal-jvmci-9/hotspot/rev/d8ad03e43340
08-01-2016