JDK-8042925 : Consider avoiding safepoints in AdvancedThresholdPolicy::select_task
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-05-12
  • Updated: 2014-05-13
  • Resolved: 2014-05-13
Related Reports
Duplicate :  
Relates :  
Description
There are 2 places in AdvancedThresholdPolicy::select_task where safepoint can occur:
- AdvancedThresholdPolicy::update_rate
- CompileTaskWrapper::~CompileTaskWrapper for a stale task

AdvancedThresholdPolicy::select_task is called from CompileQueue::get() which holds MethodCompileQueue_lock.

Additional precautions are needed to avoid deadlocks in VM thread, so there's an agreement when entering a safepoint to avoid holding any locks VM thread can use  (see [1]). 

[1] http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/tip/src/share/vm/runtime/thread.cpp#l903
Comments
Will be fixed as part of JDK-8023461.
13-05-2014