< prev index next >

src/hotspot/share/runtime/serviceThread.cpp

Print this page
rev 56635 : v2.00 -> v2.05 (CR5/v2.05/8-for-jdk13) patches combined into one; merge with 8229212.patch; merge with jdk-14+11; merge with 8230184.patch; merge with 8230876.patch; merge with jdk-14+15; merge with jdk-14+18.
rev 56638 : Merge the remainder of the lock-free monitor list changes from v2.06 with v2.06a and v2.06b after running the changes through the edit scripts; merge pieces from dcubed.monitor_deflate_conc.v2.06d in dcubed.monitor_deflate_conc.v2.06[ac]; merge pieces from dcubed.monitor_deflate_conc.v2.06e into dcubed.monitor_deflate_conc.v2.06c; merge with jdk-14+11; test work around for test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java should not been needed anymore; merge with jdk-14+18.
rev 56639 : loosen a couple more counter checks due to races observed in testing; simplify om_release() extraction of mid since list head or cur_mid_in_use is marked; simplify deflate_monitor_list() extraction of mid since there are no parallel deleters due to the safepoint; simplify deflate_monitor_list_using_JT() extraction of mid since list head or cur_mid_in_use is marked; prepend_block_to_lists() - simplify based on David H's comments; does not need load_acquire() or release_store() because of the cmpxchg(); prepend_to_common() - simplify to use mark_next_loop() for m and use mark_list_head() and release_store() for the non-empty list case; add more debugging for "Non-balanced monitor enter/exit" failure mode; fix race in inflate() in the "CASE: neutral" code path; install_displaced_markword_in_object() does not need to clear the header field since that is handled when the ObjectMonitor is moved from the global free list; LSuccess should clear boxReg to set ICC.ZF=1 to avoid depending on existing boxReg contents; update fast_unlock() to detect when object no longer refers to the same ObjectMonitor and take fast path exit instead; clarify fast_lock() code where we detect when object no longer refers to the same ObjectMonitor; add/update comments for movptr() calls where we move a literal into an Address; remove set_owner(); refactor setting of owner field into set_owner_from(2 versions), set_owner_from_BasicLock(), and try_set_owner_from(); the new functions include monitorinflation+owner logging; extract debug code from v2.06 and v2.07 and move to v2.07.debug; change 'jccb' -> 'jcc' and 'jmpb' -> 'jmp' as needed; checkpoint initial version of MacroAssembler::inc_om_ref_count(); update LP64 MacroAssembler::fast_lock() and fast_unlock() to use inc_om_ref_count(); fast_lock() return flag setting logic can use 'testptr(tmpReg, tmpReg)' instead of 'cmpptr(tmpReg, 0)' since that's more efficient; fast_unlock() LSuccess return flag setting logic can use 'testl (boxReg, 0)' instead of 'xorptr(boxReg, boxReg)' since that's more efficient; cleanup "fast-path" vs "fast path" and "slow-path" vs "slow path"; update MacroAssembler::rtm_inflated_locking() to use inc_om_ref_count(); update MacroAssembler::fast_lock() to preserve the flags before decrementing ref_count and restore the flags afterwards; this is more clean than depending on the contents of rax/tmpReg; coleenp CR - refactor async monitor deflation work from ServiceThread::service_thread_entry() to ObjectSynchronizer::deflate_idle_monitors_using_JT(); rehn,eosterlund CR - add support for HandshakeAfterDeflateIdleMonitors for platforms that don't have ObjectMonitor ref_count support implemented in C2 fast_lock() and fast_unlock().


 173       }
 174     }
 175 
 176     if (resolved_method_table_work) {
 177       ResolvedMethodTable::do_concurrent_work(jt);
 178     }
 179 
 180     if (thread_id_table_work) {
 181       ThreadIdTable::do_concurrent_work(jt);
 182     }
 183 
 184     if (protection_domain_table_work) {
 185       SystemDictionary::pd_cache_table()->unlink();
 186     }
 187 
 188     if (oopstorage_work) {
 189       cleanup_oopstorages();
 190     }
 191 
 192     if (deflate_idle_monitors) {
 193       // Deflate any global idle monitors.
 194       ObjectSynchronizer::deflate_global_idle_monitors_using_JT();
 195 
 196       int count = 0;
 197       for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
 198         if (jt->om_in_use_count > 0 && !jt->is_exiting()) {
 199           // This JavaThread is using ObjectMonitors so deflate any that
 200           // are idle unless this JavaThread is exiting; do not race with
 201           // ObjectSynchronizer::om_flush().
 202           ObjectSynchronizer::deflate_per_thread_idle_monitors_using_JT(jt);
 203           count++;
 204         }
 205       }
 206       if (count > 0) {
 207         log_debug(monitorinflation)("did async deflation of idle monitors for %d thread(s).", count);
 208       }
 209       // The ServiceThread's async deflation request has been processed.
 210       ObjectSynchronizer::set_is_async_deflation_requested(false);
 211     }
 212   }
 213 }
 214 
 215 bool ServiceThread::is_service_thread(Thread* thread) {
 216   return thread == _instance;
 217 }


 173       }
 174     }
 175 
 176     if (resolved_method_table_work) {
 177       ResolvedMethodTable::do_concurrent_work(jt);
 178     }
 179 
 180     if (thread_id_table_work) {
 181       ThreadIdTable::do_concurrent_work(jt);
 182     }
 183 
 184     if (protection_domain_table_work) {
 185       SystemDictionary::pd_cache_table()->unlink();
 186     }
 187 
 188     if (oopstorage_work) {
 189       cleanup_oopstorages();
 190     }
 191 
 192     if (deflate_idle_monitors) {
 193       ObjectSynchronizer::deflate_idle_monitors_using_JT();

















 194     }
 195   }
 196 }
 197 
 198 bool ServiceThread::is_service_thread(Thread* thread) {
 199   return thread == _instance;
 200 }
< prev index next >