JDK-8164683 : Solaris: JVM abuses thread preemption control
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris
  • CPU: x86,sparc
  • Submitted: 2016-08-23
  • Updated: 2019-05-28
  • Resolved: 2018-08-10
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 12
12 b07Fixed
Related Reports
Relates :  
Relates :  
Description
The JVM tries to increase the priority of C2 and GC threads by using preemption control. However it is doing so completely incorrectly - preemption control is only to used momentarily, e.g. whilst holding a 'hot lock'. The JVM is enabling it permanently at thread startup which can cause performance issues. The code in question should just be removed.

Relevant files:

Calls to schedctl_start:

 hotspot/src/os/solaris/vm/os_solaris.cpp (call to schedctl_start)

Calls to os::hint_no_preempt:

 hotspot/src/share/vm/compiler/compileBroker.cpp
 hotspot/src/share/vm/runtime/safepoint.cpp
  hotspot/src/share/vm/runtime/vmThread.cpp
 hotspot/src/os/aix/vm/os_aix.cpp
 hotspot/src/os/windows/vm/os_windows.cpp
 hotspot/src/os/bsd/vm/os_bsd.cpp
 hotspot/src/os/linux/vm/os_linux.cpp
 hotspot/src/os/solaris/vm/os_solaris.cpp
Comments
This code will be removed in 12
31-07-2018

Thanks, I hadn't noticed that CompilerThreadHintNoPreempt was a different option.
06-02-2018

The VMThreadHintNoPreempt flag is only checked by a couple of uses of os::hint_no_preempt: hotspot/src/share/vm/runtime/safepoint.cpp hotspot/src/share/vm/runtime/vmThread.cpp The call in ./share/compiler/compileBroker.cpp is guarded by CompilerThreadHintNoPreempt which is true by default and a product flag. As a first step to removal this flag will need to be set to false, and deprecated. These are the only calls to os::hint_no_preempt.
06-02-2018

Can we remove this function entirely? First we have to remove the option with a CSR for 11. product(bool, VMThreadHintNoPreempt, false, \ "(Solaris only) Give VM thread an extra quanta") \ \
05-02-2018

ILW L?? = P4 I: Low, Theoretical performance issue L: Unknown (High), Unknown performance impact W: Unknown (High), No known workaround
29-08-2016