Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8214458

Port ShenandoahTaskTerminator to mainline and make it default

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 12
    • hotspot
    • None
    • gc
    • behavioral
    • medium
    • Hide
      The OWST task terminator is functionally equivalent to the current ParallelTaskTerminator, so replacing existing critical infrastructure with something new always carries some risk.

      The Shenandoah project has been using this task terminator for the past 2+ years without issues indicating a certain level of stability. During review there will be extensive testing with existing collectors. We will provide a way to use the old task terminator in place of the new one for some time.

      Given task terminator is a critical component of GCs and it is on by default, the risk level is set to medium.
      Show
      The OWST task terminator is functionally equivalent to the current ParallelTaskTerminator, so replacing existing critical infrastructure with something new always carries some risk. The Shenandoah project has been using this task terminator for the past 2+ years without issues indicating a certain level of stability. During review there will be extensive testing with existing collectors. We will provide a way to use the old task terminator in place of the new one for some time. Given task terminator is a critical component of GCs and it is on by default, the risk level is set to medium.
    • add/remove/modify command line option
    • Implementation

      Summary

      Add diagnostic VM flag "UseOWSTTaskTerminator" to set the task terminator protocol to be used.

      Problem

      The current task termination protocol (called ParallelTaskTerminator, or PTT here) is inefficient in the number of waiting threads it wakes up for a given observed amount of remaining work and in some situations takes a very long time to find out that all threads are done with their work to actually terminate a given parallel phase.

      The Shenandoah project has implemented an improved termination protocol called Optimized Work Stealing Threads (OWST) that fixes the shortcomings of PTT based on some work Google conducted earlier.

      While we think the implementation of OWST is stable because it has not shown issues for 2+ years of use in the Shenandoah project for the Shenandoah collector, significantly wider use by adopting it for all Hotspot collectors may expose unknown issues. So we want a way to provide the user a way to fall back to the PTT protocol in case of issues.

      Solution

      Introduce a new diagnostic VM flag called "UseOWSTTaskTerminator" that selects the termination protocol to use. The default is set to true, meaning that all GCs will use the OWST protocol by default. In case of issues it allows a user to switch back to the PTT protocol by setting this flag to false.

      Specification

      From gc_globals.hpp:

        diagnostic(bool, UseOWSTTaskTerminator, true,                         \
            "Use Optimized Work Stealing Threads task termination "           \
            "protocol")                                                       \

            zgu Zhengyu Gu
            tschatzl Thomas Schatzl
            Roman Kennke, Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: