JDK-8220052 : Deprecate -XX:-ThreadLocalHandshakes
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-03-04
  • Updated: 2019-03-05
  • Resolved: 2019-03-05
Related Reports
CSR :  
Description
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"},



Comments
Moving to Approved.
05-03-2019

Yes
05-03-2019

Thanks David. So the change would instead be: + { "ThreadLocalHandshakes", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::jdk(15) }, ?
05-03-2019

I did an editing pass and added myself as reviewer. I think we can probably target removal in 15.
05-03-2019