6888526: Linux getCurrentThreadCpuTime is drastically slower than Windows

Wed, 28 Jul 2010 17:38:21 +0100

author
aph
date
Wed, 28 Jul 2010 17:38:21 +0100
changeset 2034
3d90023429ec
parent 2033
7f0fdccac34f
child 2035
a64438a2b7e8

6888526: Linux getCurrentThreadCpuTime is drastically slower than Windows
Reviewed-by: dcubed, dholmes

src/os/linux/vm/globals_linux.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/os/linux/vm/globals_linux.hpp	Sun Jul 25 07:31:50 2010 -0700
     1.2 +++ b/src/os/linux/vm/globals_linux.hpp	Wed Jul 28 17:38:21 2010 +0100
     1.3 @@ -29,9 +29,10 @@
     1.4    product(bool, UseOprofile, false,                                 \
     1.5          "enable support for Oprofile profiler")                     \
     1.6                                                                      \
     1.7 -  product(bool, UseLinuxPosixThreadCPUClocks, false,                \
     1.8 -          "enable fast Linux Posix clocks where available")         \
     1.9 -
    1.10 +  product(bool, UseLinuxPosixThreadCPUClocks, true,                 \
    1.11 +          "enable fast Linux Posix clocks where available")
    1.12 +// NB: The default value of UseLinuxPosixThreadCPUClocks may be
    1.13 +// overridden in Arguments::parse_each_vm_init_arg.
    1.14  
    1.15  //
    1.16  // Defines Linux-specific default values. The flags are available on all
     2.1 --- a/src/share/vm/runtime/arguments.cpp	Sun Jul 25 07:31:50 2010 -0700
     2.2 +++ b/src/share/vm/runtime/arguments.cpp	Wed Jul 28 17:38:21 2010 +0100
     2.3 @@ -2593,6 +2593,12 @@
     2.4        FLAG_IS_DEFAULT(UseVMInterruptibleIO)) {
     2.5      FLAG_SET_DEFAULT(UseVMInterruptibleIO, true);
     2.6    }
     2.7 +#ifdef LINUX
     2.8 + if (JDK_Version::current().compare_major(6) <= 0 &&
     2.9 +      FLAG_IS_DEFAULT(UseLinuxPosixThreadCPUClocks)) {
    2.10 +    FLAG_SET_DEFAULT(UseLinuxPosixThreadCPUClocks, false);
    2.11 +  }
    2.12 +#endif // LINUX
    2.13    return JNI_OK;
    2.14  }
    2.15  

mercurial