JDK-8191789 : migrate more Thread-SMR stuff from thread.[ch]pp -> threadSMR.[ch]pp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-11-22
  • Updated: 2017-12-18
  • Resolved: 2017-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 11
10 b36Fixed 11Fixed
Related Reports
Relates :  
Relates :  
Description
A comment from Stefan K during the code review of JDK-8167108:

6) I think it would be nice if the SMR stuff in thread.hpp were encapsulated into an class instead of added directly to Thread and Threads. I sort-of expected the SMR variables to be moved to threadSMR.hpp.

For example:

 class Threads: AllStatic {
   friend class VMStructs;
  private:
+  // Safe Memory Reclamation (SMR) support:
+  static Monitor*              _smr_delete_lock;
+  // The '_cnt', '_max' and '_times" fields are enabled via
+  // -XX:+EnableThreadSMRStatistics:
+  static uint                  _smr_delete_lock_wait_cnt;
+  static uint                  _smr_delete_lock_wait_max;
+  static volatile int          _smr_delete_notify;
+  static volatile jint         _smr_deleted_thread_cnt;
+  static volatile jint         _smr_deleted_thread_time_max;
+  static volatile jint         _smr_deleted_thread_times;
+  static ThreadsList* volatile _smr_java_thread_list;
+  static ThreadsList*          get_smr_java_thread_list() {
+    return (ThreadsList*)OrderAccess::load_ptr_acquire((void* volatile*)&_smr_java_thread_list);
+  }
+  static ThreadsList*          xchg_smr_java_thread_list(ThreadsList* new_list) {
+    return (ThreadsList*)Atomic::xchg_ptr((void*)new_list, (volatile void*)&_smr_java_thread_list);
+  }
+  static long                  _smr_java_thread_list_alloc_cnt;
+  static long                  _smr_java_thread_list_free_cnt;
+  static uint                  _smr_java_thread_list_max;
+  static uint                  _smr_nested_thread_list_max;
+  static volatile jint         _smr_tlh_cnt;
+  static volatile jint         _smr_tlh_time_max;
+  static volatile jint         _smr_tlh_times;
+  static ThreadsList*          _smr_to_delete_list;
+  static uint                  _smr_to_delete_list_cnt;
+  static uint                  _smr_to_delete_list_max;

Could be:

class Threads: AllStatic {
  friend class VMStructs;
 private:
  // Safe Memory Reclamation (SMR) support:
  SMRSupport _smr_support;

And SMRSupport could be moved to threadSMR.hpp.