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

Set AssumeMP to true and deprecate the flag

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 10
    • hotspot
    • None
    • behavioral
    • minimal
    • A truly uniprocessor environment may see a small performance change through the use of MP safe instructions. Though on an actual uniprocessor such instructions should basically be no-ops anyway.
    • add/remove/modify command line option
    • Implementation

      Summary

      Set the AssumeMP VM flag to true by default, and deprecate it.

      Problem

      We're now operating in a world where uniprocessors (physical or virtual) are very rare on our supported platforms. Further, we have dynamic environments where we may start of with one processor but acquire more as time goes by. The VM generates different code for uniprocessors and multi-processors, and also has to follow different code paths. This runtime selection happens many times but is pure overhead on the overwhelming majority of systems that are multi-processor. It will be far more efficient to assume all platforms are always multi-processor, but we need to get there in a two step process.

      Solution

      The AssumeMP flag was added to account for dynamic environments that may start off with only one processor and then acquire more. It is false by default but can be set true in those environments so that correct MP code is always generated/used. The proposal is to switch AssumeMP to default to true, always, and to deprecate it with a view to its obsoletion in a later release - at which point all the code is always MP aware.

      Specification

      Set the flag to true:

      diff -r ab3a898fff11 src/hotspot/share/runtime/globals.hpp
      --- a/src/hotspot/share/runtime/globals.hpp
      +++ b/src/hotspot/share/runtime/globals.hpp
      @@ -592,7 +592,7 @@
                 range(8, 256)                                                     \
                 constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
                                                                                   \
      -  product(bool, AssumeMP, false,                                            \
      +  product(bool, AssumeMP, true,                                             \
                 "Instruct the VM to assume multiple processors are available")    \
                                                                                   \
         /* UseMembar is theoretically a temp flag used for memory barrier      */ \

      and mark it deprecated:

      diff -r ab3a898fff11 src/hotspot/share/runtime/arguments.cpp
      --- a/src/hotspot/share/runtime/arguments.cpp
      +++ b/src/hotspot/share/runtime/arguments.cpp
      @@ -377,6 +377,7 @@
         // --- Non-alias flags - sorted by obsolete_in then expired_in:
         { "MaxGCMinorPauseMillis",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
         { "UseConcMarkSweepGC",           JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
      +  { "AssumeMP",                     JDK_Version::jdk(10),JDK_Version::undefined(), JDK_Version::undefined() },
         { "MonitorInUseLists",            JDK_Version::jdk(10),JDK_Version::undefined(), JDK_Version::undefined() },
         { "MaxRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
         { "MinRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },

            dholmes David Holmes
            eosterlund Erik Ă–sterlund
            Aleksey Shipilev, Daniel Daugherty, Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: