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

Parallel GC: Obsolete and remove flags BindGCTaskThreadsToCPUs and UseGCTaskAffinity

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 14
    • hotspot
    • None
    • gc
    • behavioral
    • minimal
    • The options to be obsoleted and removed are very obscure ones for a single operating system or ones that have no impact for some time now.
    • add/remove/modify command line option
    • Implementation

      Summary

      Obsolete -XX:BindGCTaskThreadsToCPUs and -XX:UseGCTaskAffinity.

      Problem

      Parallel GC is moving to use WorkGang (the parallelisation abstraction used by the other GCs), The mostly broken functionality behind -XX:BindGCTaskThreadsToCPUs and -XX:UseGCTaskAffinity can not easily be moved. It is not widely used, and undocumented; this is a good opportunity to obsolete these two flags.

      Solution

      • BindGCTaskThreadsToCPUs is used to run threads pinned on specific CPUs. Only implemented on Solaris and seems mostly unused.

      • UseGCTaskAffinity is used to take tasks with a certain thread affinity; it does not work and should have been obsoleted since (at least) JDK-8138707.

      These flag do not change the functional behaviour of the JVM, BindGCTaskThreadsToCPUs could in theory increase performance on Solaris, but it is questionable if it really does (the default value is off, and we have no tests of this feature). Neither option seems to be much used, so the impact of removing them ought to be low.

      Obsolete -XX:BindGCTaskThreadsToCPUs and -XX:UseGCTaskAffinity in JDK 14. Push the removal before next LTS (JDK 17). Proposed removal is thus JDK 16.

      Specification

      diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp
      index 8b6056c54b3..be5e34b2f09 100644
      --- a/src/hotspot/share/gc/shared/gc_globals.hpp
      +++ b/src/hotspot/share/gc/shared/gc_globals.hpp
      @@ -679,12 +679,6 @@
         product(bool, DisableExplicitGC, false,                                   \
                 "Ignore calls to System.gc()")                                    \
                                                                                   \
      -  product(bool, BindGCTaskThreadsToCPUs, false,                             \
      -          "Bind GCTaskThreads to CPUs if possible")                         \
      -                                                                            \
      -  product(bool, UseGCTaskAffinity, false,                                   \
      -          "Use worker affinity when asking for GCTasks")                    \
      -                                                                            \
         product(bool, PrintGC, false,                                             \
                 "Print message at garbage collection. "                           \
                 "Deprecated, use -Xlog:gc instead.")                              \
      diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
      index e08d46577c8..5e95c2afdbf 100644
      --- a/src/hotspot/share/runtime/arguments.cpp
      +++ b/src/hotspot/share/runtime/arguments.cpp
      @@ -562,6 +562,8 @@ static SpecialFlag const special_jvm_flags[] = {
         { "ProfilerNumberOfRuntimeStubNodes", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
         { "UseImplicitStableValues",       JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
         { "NeedsDeoptSuspend",             JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
      +  { "BindGCTaskThreadsToCPUs",       JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
      +  { "UseGCTaskAffinity",             JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
      
       #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
         // These entries will generate build errors.  Their purpose is to test the macros.
      @@ -1929,13 +1931,6 @@ jint Arguments::set_aggressive_heap_flags() {
           return JNI_EINVAL;
         }
      
      -  // Get around early Solaris scheduling bug
      -  // (affinity vs other jobs on system)
      -  // but disallow DR and offlining (5008695).
      -  if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != JVMFlag::SUCCESS) {
      -    return JNI_EINVAL;
      -  }
      -
         return JNI_OK;
       }

            lkorinth Leo Korinth
            lkorinth Leo Korinth
            Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: