changeset 51300:3e66d204af9b

8153107: enabling ObjectSynchronizer::quick_enter() on ARM64 causes hangs Summary: Always set the markword for recursive monitors in MacroAssembler::fast_lock(). Reviewed-by: aph, drwhite, dcubed, bulasevich
author apetushkov
date Fri, 15 Jun 2018 13:57:32 -0400
parents 9eaaa711fef5
children cc58f1fa0438
files src/hotspot/cpu/arm/macroAssembler_arm.cpp src/hotspot/share/runtime/sharedRuntime.cpp
diffstat 2 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Tue Jun 19 19:19:43 2018 +0200
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Fri Jun 15 13:57:32 2018 -0400
@@ -3023,8 +3023,8 @@
   mov(Rscratch, SP);
   sub(Rscratch, Rmark, Rscratch);
   ands(Rscratch, Rscratch, imm);
-  b(done, ne); // exit with failure
-  str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes())); // set to zero
+  // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107)
+  str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
   b(done);
 
 #else
@@ -3034,7 +3034,8 @@
   sub(Rscratch, Rmark, SP, eq);
   movs(Rscratch, AsmOperand(Rscratch, lsr, exact_log2(os::vm_page_size())), eq);
   // If still 'eq' then recursive locking OK
-  str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()), eq); // set to zero
+  // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107)
+  str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
   b(done);
 #endif
 
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Tue Jun 19 19:19:43 2018 +0200
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Fri Jun 15 13:57:32 2018 -0400
@@ -1989,11 +1989,7 @@
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
-  // Disable ObjectSynchronizer::quick_enter() in default config
-  // on AARCH64 and ARM until JDK-8153107 is resolved.
-  if (ARM_ONLY((SyncFlags & 256) != 0 &&)
-      AARCH64_ONLY((SyncFlags & 256) != 0 &&)
-      !SafepointSynchronize::is_synchronizing()) {
+  if (!SafepointSynchronize::is_synchronizing()) {
     // Only try quick_enter() if we're not trying to reach a safepoint
     // so that the calling thread reaches the safepoint more quickly.
     if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;