--- old/src/hotspot/share/runtime/thread.cpp 2017-11-22 20:56:31.000000000 -0500 +++ new/src/hotspot/share/runtime/thread.cpp 2017-11-22 20:56:31.000000000 -0500 @@ -1479,8 +1479,6 @@ void JavaThread::collect_counters(typeArrayOop array) { if (JVMCICounterSize > 0) { - // dcubed - Looks like the Threads_lock is for stable access - // to _jvmci_old_thread_counters and _jvmci_counters. MutexLocker tl(Threads_lock); JavaThreadIteratorWithHandle jtiwh; for (int i = 0; i < array->length(); i++) { @@ -4650,6 +4648,7 @@ } static unsigned int ptr_hash(void * const& s1) { + // 2654435761 = 2^32 * Phi (golden ratio) return (unsigned int)(((uint32_t)(uintptr_t)s1) * 2654435761u); } --- old/src/hotspot/share/runtime/thread.hpp 2017-11-22 20:56:33.000000000 -0500 +++ new/src/hotspot/share/runtime/thread.hpp 2017-11-22 20:56:33.000000000 -0500 @@ -2129,40 +2129,26 @@ // Safe Memory Reclamation (SMR) support: static Monitor* _smr_delete_lock; // The '_cnt', '_max' and '_times" fields are enabled via - // -XX:+EnableThreadSMRStatistics: - // # of parallel threads in _smr_delete_lock->wait(). + // -XX:+EnableThreadSMRStatistics (see thread.cpp for a + // description about each field): static uint _smr_delete_lock_wait_cnt; - // Max # of parallel threads in _smr_delete_lock->wait(). static uint _smr_delete_lock_wait_max; - // Flag to indicate when an _smr_delete_lock->notify() is needed. static volatile uint _smr_delete_notify; - // # of threads deleted over VM lifetime. static volatile uint _smr_deleted_thread_cnt; - // Max time in millis to delete a thread. static volatile uint _smr_deleted_thread_time_max; - // Cumulative time in millis to delete threads. static volatile uint _smr_deleted_thread_times; static ThreadsList* volatile _smr_java_thread_list; static ThreadsList* get_smr_java_thread_list(); static ThreadsList* xchg_smr_java_thread_list(ThreadsList* new_list); - // # of ThreadsLists allocated over VM lifetime. static uint64_t _smr_java_thread_list_alloc_cnt; - // # of ThreadsLists freed over VM lifetime. static uint64_t _smr_java_thread_list_free_cnt; - // Max size ThreadsList allocated. static uint _smr_java_thread_list_max; - // Max # of nested ThreadsLists for a thread. static uint _smr_nested_thread_list_max; - // # of ThreadsListHandles deleted over VM lifetime. static volatile uint _smr_tlh_cnt; - // Max time in millis to delete a ThreadsListHandle. static volatile uint _smr_tlh_time_max; - // Cumulative time in millis to delete ThreadsListHandles. static volatile uint _smr_tlh_times; static ThreadsList* _smr_to_delete_list; - // # of parallel ThreadsLists on the to-delete list. static uint _smr_to_delete_list_cnt; - // Max # of parallel ThreadsLists on the to-delete list. static uint _smr_to_delete_list_max; static JavaThread* _thread_list; @@ -2189,8 +2175,6 @@ static void possibly_parallel_threads_do(bool is_par, ThreadClosure* tc); // SMR support: - template - static void threads_do_smr(T *tc, Thread *self); static ThreadsList *acquire_stable_list(Thread *self, bool is_ThreadsListSetter); static ThreadsList *acquire_stable_list_fast_path(Thread *self); static ThreadsList *acquire_stable_list_nested_path(Thread *self); --- old/src/hotspot/share/runtime/thread.inline.hpp 2017-11-22 20:56:35.000000000 -0500 +++ new/src/hotspot/share/runtime/thread.inline.hpp 2017-11-22 20:56:35.000000000 -0500 @@ -212,12 +212,6 @@ OrderAccess::release_store((volatile jint *) &_terminated, (jint) _thread_terminated); } -template -inline void Threads::threads_do_smr(T *tc, Thread *self) { - ThreadsListHandle handle(self); - handle.threads_do(tc); -} - inline ThreadsList* Threads::get_smr_java_thread_list() { return (ThreadsList*)OrderAccess::load_acquire(&_smr_java_thread_list); } --- old/src/hotspot/share/runtime/threadSMR.hpp 2017-11-22 20:56:37.000000000 -0500 +++ new/src/hotspot/share/runtime/threadSMR.hpp 2017-11-22 20:56:36.000000000 -0500 @@ -28,7 +28,7 @@ #include "memory/allocation.hpp" #include "runtime/timer.hpp" -// Thread Safe Memory Reclaimation (Thread-SMR) support. +// Thread Safe Memory Reclamation (Thread-SMR) support. // // ThreadsListHandles are used to safely perform operations on one or more // threads without the risk of the thread or threads exiting during the