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

Deprecate -XX:-ThreadLocalHandshakes

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 13
    • hotspot
    • None
    • behavioral
    • low
    • The flag was added as a way to disable thread-local handshakes if there were problems encountered with its use. Going forward handshakes are intended to be performant and functionally robust so there should not be any need to disable them.
    • add/remove/modify command line option
    • Implementation

      Summary

      Deprecate -XX:-ThreadLocalHandshakes.

      Problem

      Thread-local handshakes were introduced as an alternate mechanism to global safepoints, with a view to converting existing global safepoint operations over to thread-to-thread interactions where feasible. Many new features are planning to use or using handshakes with the assumption they are cheap, and using the fallback path (turning all handshakes into global safepoints), will not be feasible as two distinct code paths will need to be maintained.

      Solution

      Deprecate -XX:-ThreadLocalHandshakes in JDK 13 and obsolete it in JDK 14, so that thread-local handshakes will be guaranteed to be available.

      Specification

      diff -r 05d35241e1e9 src/hotspot/share/runtime/arguments.cpp
      --- a/src/hotspot/share/runtime/arguments.cpp   Mon Mar 04 10:19:35 2019 +0100
      +++ b/src/hotspot/share/runtime/arguments.cpp   Mon Mar 04 12:02:03 2019 +0100
      @@ -530,6 +530,7 @@
         { "UseMembar",                    JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::undefined() },
         { "CompilationPolicyChoice",      JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
         { "FailOverToOldVerifier",        JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
      +  { "ThreadLocalHandshakes",        JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::jdk(15) },
      
         // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
         { "DefaultMaxRAMFraction",        JDK_Version::jdk(8),  JDK_Version::undefined(), JDK_Version::undefined() },
      diff -r 05d35241e1e9 test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
      --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java   Mon Mar 04 10:19:35 2019 +0100
      +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java   Mon Mar 04 12:02:03 2019 +0100
      @@ -45,6 +45,7 @@
               {"MinRAMFraction",            "2"},
               {"InitialRAMFraction",        "64"},
               {"TLABStats",                 "false"},
      +        {"ThreadLocalHandshakes",     "true"},
      
               // deprecated alias flags (see also aliased_jvm_flags):
               {"DefaultMaxRAMFraction", "4"},

            rehn Robbin Ehn
            rehn Robbin Ehn
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: