From 4e336f549912907ecb0d7a08331471f7cbee216c Mon Sep 17 00:00:00 2001 From: aph Date: Wed, 28 Jul 2010 17:38:21 +0100 Subject: [PATCH] 6888526: Linux getCurrentThreadCpuTime is drastically slower than Windows Reviewed-by: dcubed, dholmes --- src/os/linux/vm/globals_linux.hpp | 7 ++++--- src/share/vm/runtime/arguments.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/os/linux/vm/globals_linux.hpp b/src/os/linux/vm/globals_linux.hpp index 14b22bf7c..75b313737 100644 --- a/src/os/linux/vm/globals_linux.hpp +++ b/src/os/linux/vm/globals_linux.hpp @@ -29,9 +29,10 @@ product(bool, UseOprofile, false, \ "enable support for Oprofile profiler") \ \ - product(bool, UseLinuxPosixThreadCPUClocks, false, \ - "enable fast Linux Posix clocks where available") \ - + product(bool, UseLinuxPosixThreadCPUClocks, true, \ + "enable fast Linux Posix clocks where available") +// NB: The default value of UseLinuxPosixThreadCPUClocks may be +// overridden in Arguments::parse_each_vm_init_arg. // // Defines Linux-specific default values. The flags are available on all diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 5ba65fba4..486112abc 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -2593,6 +2593,12 @@ SOLARIS_ONLY( FLAG_IS_DEFAULT(UseVMInterruptibleIO)) { FLAG_SET_DEFAULT(UseVMInterruptibleIO, true); } +#ifdef LINUX + if (JDK_Version::current().compare_major(6) <= 0 && + FLAG_IS_DEFAULT(UseLinuxPosixThreadCPUClocks)) { + FLAG_SET_DEFAULT(UseLinuxPosixThreadCPUClocks, false); + } +#endif // LINUX return JNI_OK; } -- GitLab