RTM disabled for Linux on PPC64 LE

Gustavo Romero gromero at linux.vnet.ibm.com
Fri Feb 12 13:45:19 UTC 2016


Hi,
As of now (tip 1922:be58b02c11f9, jdk9/jdk9 repo) Hotspot build for Linux on ppc64le of fails due to a simple uninitialized variable error:

hotspot/src/share/vm/ci/ciMethodData.hpp:585:100:       error: ‘data’ may be used uninitialized in this function
hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp:2408:78: error: ‘md’   may be used uninitialized in this function

So this straightforward patch solves the issue:
 diff -r 534c50395957 src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
--- a/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp	Thu Jan 28 15:42:23 2016 -0800
+++ b/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp	Mon Feb 08 17:13:14 2016 -0200
@@ -2321,8 +2321,8 @@
     if (reg_conflict) { obj = dst; }
   }
 -  ciMethodData* md;
-  ciProfileData* data;
+  ciMethodData* md = NULL;
+  ciProfileData* data = NULL;
   int mdo_offset_bias = 0; compiler/rtm
   if (should_profile) {
     ciMethod* method = op->profiled_method();

However, after the build, I realized that RTM is still disabled for Linux on ppc64le, failing 25 tests on compiler/rtm suite:

http://hastebin.com/raw/ohoxiwaqih

Hence after applying the following patches that enable RTM for Linux on ppc64le:

diff -r 266fa9bb5297 src/cpu/ppc/vm/vm_version_ppc.cpp
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Feb 04 16:48:39 2016 -0800
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri Feb 12 10:55:46 2016 -0200
@@ -255,7 +255,9 @@
     }
 #endif
 #ifdef linux
-    // TODO: check kernel version (we currently have too old versions only)
+    if (os::Linux::os_version() >= 4) { // at least Linux kernel version 4
+      os_too_old = false;
+    }
 #endif
     if (os_too_old) {
       vm_exit_during_initialization("RTM is not supported on this OS version.");


diff -r 266fa9bb5297 src/os/linux/vm/os_linux.cpp
--- a/src/os/linux/vm/os_linux.cpp	Thu Feb 04 16:48:39 2016 -0800
+++ b/src/os/linux/vm/os_linux.cpp	Fri Feb 12 10:58:10 2016 -0200
@@ -135,6 +135,7 @@
 int os::Linux::_page_size = -1;
 const int os::Linux::_vm_default_page_size = (8 * K);
 bool os::Linux::_supports_fast_thread_cpu_time = false;
+uint32_t os::Linux::_os_version = 0;
 const char * os::Linux::_glibc_version = NULL;
 const char * os::Linux::_libpthread_version = NULL;
 pthread_condattr_t os::Linux::_condattr[1];
@@ -4332,6 +4333,21 @@
   return (tp.tv_sec * NANOSECS_PER_SEC) + tp.tv_nsec;
 }
 +void os::Linux::initialize_os_info() {
+  assert(_os_version == 0, "OS info already initialized");
+
+  struct utsname _uname;
+  +  uname(&_uname); // Not sure yet how deal if ret == -1
+  _os_version = atoi(_uname.release);
+}
+
+uint32_t os::Linux::os_version() {
+  assert(_os_version != 0, "not initialized");
+  return _os_version;
+}
+
+
 /////
 // glibc on Linux platform uses non-documented flag
 // to indicate, that some special sort of signal
@@ -4553,6 +4569,7 @@
   init_page_sizes((size_t) Linux::page_size());
    Linux::initialize_system_info();
+  Linux::initialize_os_info();
    // main_thread points to the aboriginal thread
   Linux::_main_thread = pthread_self();


diff -r 266fa9bb5297 src/os/linux/vm/os_linux.hpp
--- a/src/os/linux/vm/os_linux.hpp	Thu Feb 04 16:48:39 2016 -0800
+++ b/src/os/linux/vm/os_linux.hpp	Fri Feb 12 10:59:01 2016 -0200
@@ -55,7 +55,7 @@
   static bool _supports_fast_thread_cpu_time;
    static GrowableArray<int>* _cpu_to_node;
-
+  static uint32_t _os_version;   protected:
    static julong _physical_memory;
@@ -198,6 +198,9 @@
    static jlong fast_thread_cpu_time(clockid_t clockid);
 +  static void initialize_os_info();
+  static uint32_t os_version(); +
   // pthread_cond clock suppport
  private:
   static pthread_condattr_t _condattr[1];


23 tests are now passing: http://hastebin.com/raw/oyicagusod

Is there a reason to let RTM disabled for Linux on ppc64le by now? Could somebody explain what is currently missing on PPC64 LE RTM implementation in order to make all RTM tests pass?

Thank you.

Regards,
--
Gustavo Romero



More information about the ppc-aix-port-dev mailing list