Consider avoiding safepoints in AdvancedThresholdPolicy::select_task

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 9
    • Component/s: hotspot
    • None

      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

            Assignee:
            Albert Noll (Inactive)
            Reporter:
            Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: