8038939: Some options related to RTM locking optimization works inconsistently

Wed, 09 Apr 2014 11:18:02 -0700

author
kvn
date
Wed, 09 Apr 2014 11:18:02 -0700
changeset 6557
526acaf3626f
parent 6556
6048424d3865
child 6558
2100bf712e2a

8038939: Some options related to RTM locking optimization works inconsistently
Summary: Switch UseRTMXendForLockBusy flag ON by default and change code to retry RTM locking on lock busy condition by default.
Reviewed-by: roland

src/cpu/x86/vm/globals_x86.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/macroAssembler_x86.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/x86/vm/globals_x86.hpp	Thu Apr 10 04:07:45 2014 -0700
     1.2 +++ b/src/cpu/x86/vm/globals_x86.hpp	Wed Apr 09 11:18:02 2014 -0700
     1.3 @@ -162,7 +162,7 @@
     1.4            "Number of milliseconds to wait before start calculating aborts " \
     1.5            "for RTM locking")                                                \
     1.6                                                                              \
     1.7 -  experimental(bool, UseRTMXendForLockBusy, false,                          \
     1.8 +  experimental(bool, UseRTMXendForLockBusy, true,                           \
     1.9            "Use RTM Xend instead of Xabort when lock busy")                  \
    1.10                                                                              \
    1.11    /* assembler */                                                           \
     2.1 --- a/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu Apr 10 04:07:45 2014 -0700
     2.2 +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Apr 09 11:18:02 2014 -0700
     2.3 @@ -1488,11 +1488,10 @@
     2.4      movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort
     2.5      bind(L_rtm_retry);
     2.6    }
     2.7 -  if (!UseRTMXendForLockBusy) {
     2.8 -    movptr(tmpReg, Address(objReg, 0));
     2.9 -    testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
    2.10 -    jcc(Assembler::notZero, IsInflated);
    2.11 -  }
    2.12 +  movptr(tmpReg, Address(objReg, 0));
    2.13 +  testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
    2.14 +  jcc(Assembler::notZero, IsInflated);
    2.15 +
    2.16    if (PrintPreciseRTMLockingStatistics || profile_rtm) {
    2.17      Label L_noincrement;
    2.18      if (RTMTotalCountIncrRate > 1) {
    2.19 @@ -1512,10 +1511,7 @@
    2.20    Register abort_status_Reg = tmpReg; // status of abort is stored in RAX
    2.21    if (UseRTMXendForLockBusy) {
    2.22      xend();
    2.23 -    movptr(tmpReg, Address(objReg, 0));
    2.24 -    testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
    2.25 -    jcc(Assembler::notZero, IsInflated);
    2.26 -    movptr(abort_status_Reg, 0x1);                // Set the abort status to 1 (as xabort does)
    2.27 +    movptr(abort_status_Reg, 0x2);   // Set the abort status to 2 (so we can retry)
    2.28      jmp(L_decrement_retry);
    2.29    }
    2.30    else {

mercurial