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

ParallelGCThreads is not calculated correctly

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b103
    • CPU:
      sparc_64

      Backports

        Description

        ParallelGCThreads are calculated based on the platform architecture. It depends on the values in static variables of VM_Version. In jdk9 the values of ParallelGCThreads is calculated before the VM_Version variables are initialized so the calculations of ParallelGCThreads is not recognizing the architecture of the platform. In particular do not recognize that ParallelGCThreads should be calculated based on later niagara hardware (post niagara 1). There may be other parameters that are not being calculated correctly. The ParallelGCThreads was calculated correctly in jdk7 GA. It appears not be to calculated correctly in jdk8 although I have not debugged that case.

          Issue Links

            Activity

            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            The call to calculate the ParallelGCThreads happens in this call chain in the call to apply_ergo() indicated in the chain.

              [1] VM_Version::calc_parallel_worker_threads(), line 477 in

            "vm_version_sparc.cpp"
              [2] Abstract_VM_Version::parallel_worker_threads(), line 324 in

            "vm_version.cpp"
              [3] Arguments::set_g1_gc_flags(), line 1653 in "arguments.cpp"
              [4] Arguments::set_gc_specific_flags(), line 1708 in

            "arguments.cpp"
              [5] ArgumentsExt::set_gc_specific_flags(), line 37 in

            "arguments_ext.cpp"
              [6] Arguments::apply_ergo(), line 3870 in "arguments.cpp"

            =>[7] Threads::create_vm(args = 0xffffffff7d1ffdb8, canTryAgain =

            0xffffffff7d1ffbdf), line 3324 in "thread.cpp"
            3324 jint ergo_result = Arguments::apply_ergo();


              [8] JNI_CreateJavaVM_inner(vm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 3979 in

            "jni.cpp"
              [9] JNI_CreateJavaVM(vm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 4051 in

            "jni.cpp"
              [10] InitializeJVM(pvm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, ifn = 0xffffffff7d1fff00), line 1167 in "java.c"
              [11] JavaMain(_args = 0xffffffff7fffe380), line 377 in "java.c"

            The call to initialize the VM_Version is in this call chain.

            =>[1] VM_Version::initialize(), line 38 in "vm_version_sparc.cpp"
              [2] VM_Version_init(), line 283 in "vm_version.cpp"
              [3] init_globals(), line 106 in "init.cpp"
              [4] Threads::create_vm(args = 0xffffffff7d1ffdb8, canTryAgain =

            0xffffffff7d1ffbdf), line 3413 in "thread.cpp"
            3413 jint status = init_globals();

              [5] JNI_CreateJavaVM_inner(vm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 3979 in

            "jni.cpp"
              [6] JNI_CreateJavaVM(vm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 4051 in

            "jni.cpp"
              [7] InitializeJVM(pvm = 0xffffffff7d1ffef8, penv =

            0xffffffff7d1ffef0, ifn = 0xffffffff7d1fff00), line 1167 in "java.c"
              [8] JavaMain(_args = 0xffffffff7fffe380), line 377 in "java.c"


            There may be other JVM parameters that are calculated before the VM_Version is initialized. The ParallelGCThreads calculation depends on the result of a call to is_niagara_plus().
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - The call to calculate the ParallelGCThreads happens in this call chain in the call to apply_ergo() indicated in the chain.   [1] VM_Version::calc_parallel_worker_threads(), line 477 in "vm_version_sparc.cpp"   [2] Abstract_VM_Version::parallel_worker_threads(), line 324 in "vm_version.cpp"   [3] Arguments::set_g1_gc_flags(), line 1653 in "arguments.cpp"   [4] Arguments::set_gc_specific_flags(), line 1708 in "arguments.cpp"   [5] ArgumentsExt::set_gc_specific_flags(), line 37 in "arguments_ext.cpp"   [6] Arguments::apply_ergo(), line 3870 in "arguments.cpp" =>[7] Threads::create_vm(args = 0xffffffff7d1ffdb8, canTryAgain = 0xffffffff7d1ffbdf), line 3324 in "thread.cpp" 3324 jint ergo_result = Arguments::apply_ergo();   [8] JNI_CreateJavaVM_inner(vm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 3979 in "jni.cpp"   [9] JNI_CreateJavaVM(vm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 4051 in "jni.cpp"   [10] InitializeJVM(pvm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, ifn = 0xffffffff7d1fff00), line 1167 in "java.c"   [11] JavaMain(_args = 0xffffffff7fffe380), line 377 in "java.c" The call to initialize the VM_Version is in this call chain. =>[1] VM_Version::initialize(), line 38 in "vm_version_sparc.cpp"   [2] VM_Version_init(), line 283 in "vm_version.cpp"   [3] init_globals(), line 106 in "init.cpp"   [4] Threads::create_vm(args = 0xffffffff7d1ffdb8, canTryAgain = 0xffffffff7d1ffbdf), line 3413 in "thread.cpp" 3413 jint status = init_globals();   [5] JNI_CreateJavaVM_inner(vm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 3979 in "jni.cpp"   [6] JNI_CreateJavaVM(vm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, args = 0xffffffff7d1ffdb8), line 4051 in "jni.cpp"   [7] InitializeJVM(pvm = 0xffffffff7d1ffef8, penv = 0xffffffff7d1ffef0, ifn = 0xffffffff7d1fff00), line 1167 in "java.c"   [8] JavaMain(_args = 0xffffffff7fffe380), line 377 in "java.c" There may be other JVM parameters that are calculated before the VM_Version is initialized. The ParallelGCThreads calculation depends on the result of a call to is_niagara_plus().
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            A consequence of this bug is that the number of GC threads on later niagara hardware is approximately twice what it is meant to be.
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - A consequence of this bug is that the number of GC threads on later niagara hardware is approximately twice what it is meant to be.
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            I debugged this on a T5 from the performance lab (ghostbox) - sca00bnx. Stop in is_niagara_plus() and step through the code. You should see that _features is 0 and that it is initialized later.
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - I debugged this on a T5 from the performance lab (ghostbox) - sca00bnx. Stop in is_niagara_plus() and step through the code. You should see that _features is 0 and that it is initialized later.
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment - - edited
            Call to initialize JVM that sets _features (call to determine_features())

            #1 0x00007ffff68e6a8c in VM_Version_init() ()
               from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so
            #2 0x00007ffff6288f55 in init_globals() ()
               from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so
            #3 0x00007ffff683642a in Threads::create_vm(JavaVMInitArgs*, bool*) ()
               from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so
            #4 0x00007ffff63664b4 in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) ()
               from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so
            #5 0x00007ffff63667d3 in JNI_CreateJavaVM ()
               from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so
            #6 0x00007ffff79aa07e in InitializeJVM (pvm=0x7ffff7fd4e88,
                penv=0x7ffff7fd4e90, ifn=0x7ffff7fd4ee0)
                at /export/jmasa/java/jdk9-full-test/jdk/src/java.base/share/native/libjli/java.c:1158
            #7 0x00007ffff79a7df9 in JavaMain (_args=0x7fffffffad80)
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - - edited Call to initialize JVM that sets _features (call to determine_features()) #1 0x00007ffff68e6a8c in VM_Version_init() ()    from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so #2 0x00007ffff6288f55 in init_globals() ()    from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so #3 0x00007ffff683642a in Threads::create_vm(JavaVMInitArgs*, bool*) ()    from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so #4 0x00007ffff63664b4 in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) ()    from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so #5 0x00007ffff63667d3 in JNI_CreateJavaVM ()    from /export/jmasa/java/jdk9-full-test/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server/libjvm.so #6 0x00007ffff79aa07e in InitializeJVM (pvm=0x7ffff7fd4e88,     penv=0x7ffff7fd4e90, ifn=0x7ffff7fd4ee0)     at /export/jmasa/java/jdk9-full-test/jdk/src/java.base/share/native/libjli/java.c:1158 #7 0x00007ffff79a7df9 in JavaMain (_args=0x7fffffffad80)
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            This is a bug on any T2 or later Niagara.
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - This is a bug on any T2 or later Niagara.
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            On a Niagara with 16 hardware threads, the wrong answer for number of ParallelGCThreads is

            java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
                 uint ParallelGCThreads = 13 {product}


            The correct answer is

            java -c2_rt_8133023 -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
                 uint ParallelGCThreads = 10 {product}
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - On a Niagara with 16 hardware threads, the wrong answer for number of ParallelGCThreads is java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads      uint ParallelGCThreads = 13 {product} The correct answer is java -c2_rt_8133023 -XX:+PrintFlagsFinal -version | grep ParallelGCThreads      uint ParallelGCThreads = 10 {product}
            Hide
            jmasa Jon Masamitsu (Inactive) added a comment -
            Problem exits on jdk8

            SunOS mrspock 5.11 11.1 sun4v sparc SUNW,T5440

             java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
                uintx ParallelGCThreads = 163 {product}
            java version "1.8.0"
            Java(TM) SE Runtime Environment (build 1.8.0-b132)
            Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

            java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
                 uint ParallelGCThreads = 163 {product}
            java version "1.9.0-internal-debug"
            Java(TM) SE Runtime Environment (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00)
            Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00, mixed mode)

            With fix

            java -c2_rt_8133023 -XX:+PrintFlagsFinal -version | grep ParallelGCThreads
                 uint ParallelGCThreads = 85 {product}
            java version "1.9.0-internal-debug"
            Java(TM) SE Runtime Environment (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00)
            Java HotSpot(TM) 64-Bit Server VM (build 1.9.0--internal, mixed mode)
            Show
            jmasa Jon Masamitsu (Inactive) added a comment - Problem exits on jdk8 SunOS mrspock 5.11 11.1 sun4v sparc SUNW,T5440  java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads     uintx ParallelGCThreads = 163 {product} java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) java -server -XX:+PrintFlagsFinal -version | grep ParallelGCThreads      uint ParallelGCThreads = 163 {product} java version "1.9.0-internal-debug" Java(TM) SE Runtime Environment (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00) Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00, mixed mode) With fix java -c2_rt_8133023 -XX:+PrintFlagsFinal -version | grep ParallelGCThreads      uint ParallelGCThreads = 85 {product} java version "1.9.0-internal-debug" Java(TM) SE Runtime Environment (build 1.9.0-internal-debug-jmasamit_2015_11_11_18_41-b00) Java HotSpot(TM) 64-Bit Server VM (build 1.9.0--internal, mixed mode)
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/0b22be0db834
            User: jmasa
            Date: 2015-12-10 06:57:30 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/0b22be0db834 User: jmasa Date: 2015-12-10 06:57:30 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/0b22be0db834
            User: lana
            Date: 2016-01-27 21:42:23 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/0b22be0db834 User: lana Date: 2016-01-27 21:42:23 +0000

              People

              • Assignee:
                jmasa Jon Masamitsu (Inactive)
                Reporter:
                jmasa Jon Masamitsu (Inactive)
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: