--- old/src/hotspot/share/runtime/objectMonitor.cpp 2018-09-17 23:29:49.035745033 -0700 +++ new/src/hotspot/share/runtime/objectMonitor.cpp 2018-09-17 23:29:48.823745041 -0700 @@ -103,7 +103,6 @@ int ObjectMonitor::Knob_SpinLimit = 5000; // derived by an external tool - -static int Knob_MaxSpinners = -1; // Should be a function of # CPUs static int Knob_Bonus = 100; // spin success bonus static int Knob_BonusB = 100; // spin success bonus static int Knob_Penalty = 200; // spin failure penalty @@ -1333,12 +1332,6 @@ THROW_MSG(vmSymbols::java_lang_IllegalMonitorStateException(), "current thread not owner"); } -static int Adjust(volatile int * adr, int dx) { - int v; - for (v = *adr; Atomic::cmpxchg(v + dx, adr, v) != v; v = *adr) /* empty */; - return v; -} - static void post_monitor_wait_event(EventJavaMonitorWait* event, ObjectMonitor* monitor, jlong notifier_tid, @@ -1845,15 +1838,6 @@ return 0; } - int MaxSpin = Knob_MaxSpinners; - if (MaxSpin >= 0) { - if (_Spinner > MaxSpin) { - return 0; - } - // Slightly racy, but benign ... - Adjust(&_Spinner, 1); - } - // We're good to spin ... spin ingress. // CONSIDER: use Prefetch::write() to avoid RTS->RTO upgrades // when preparing to LD...CAS _owner, etc and the CAS is likely @@ -1907,7 +1891,6 @@ if (_succ == Self) { _succ = NULL; } - if (MaxSpin > 0) Adjust(&_Spinner, -1); // Increase _SpinDuration : // The spin was successful (profitable) so we tend toward @@ -1966,7 +1949,6 @@ } Abort: - if (MaxSpin >= 0) Adjust(&_Spinner, -1); if (_succ == Self) { _succ = NULL; // Invariant: after setting succ=null a contending thread