mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8202615: Remove NativeMonitorSpinLimit, NativeMonitorFlags and NativeMonitorTimeout experimental flags
Removed NativeMonitorSpinLimit, NativeMonitorFlags and NativeMonitorTimeout experimental flags from globals.hpp and mutex.cpp and marked them as obsolete. Reviewed-by: kbarrett, dholmes
This commit is contained in:
parent
0a0a8a5791
commit
46f2f92658
3 changed files with 7 additions and 32 deletions
|
@ -570,6 +570,9 @@ static SpecialFlag const special_jvm_flags[] = {
|
|||
{ "InlineNotify", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
{ "EnableTracing", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
{ "UseLockedTracing", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
{ "NativeMonitorTimeout", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
{ "NativeMonitorSpinLimit", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
{ "NativeMonitorFlags", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||
|
||||
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
|
||||
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
|
||||
|
|
|
@ -854,12 +854,6 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
|||
"When true prevents OS-level spurious, or premature, wakeups " \
|
||||
"from Object.wait (Ignored for Windows)") \
|
||||
\
|
||||
experimental(intx, NativeMonitorTimeout, -1, "(Unstable)") \
|
||||
\
|
||||
experimental(intx, NativeMonitorFlags, 0, "(Unstable)") \
|
||||
\
|
||||
experimental(intx, NativeMonitorSpinLimit, 20, "(Unstable)") \
|
||||
\
|
||||
develop(bool, UsePthreads, false, \
|
||||
"Use pthread-based instead of libthread-based synchronization " \
|
||||
"(SPARC only)") \
|
||||
|
|
|
@ -348,9 +348,7 @@ int Monitor::TrySpin(Thread * const Self) {
|
|||
|
||||
int Probes = 0;
|
||||
int Delay = 0;
|
||||
int Steps = 0;
|
||||
int SpinMax = NativeMonitorSpinLimit;
|
||||
int flgs = NativeMonitorFlags;
|
||||
int SpinMax = 20;
|
||||
for (;;) {
|
||||
intptr_t v = _LockWord.FullWord;
|
||||
if ((v & _LBIT) == 0) {
|
||||
|
@ -360,9 +358,7 @@ int Monitor::TrySpin(Thread * const Self) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ((flgs & 8) == 0) {
|
||||
SpinPause();
|
||||
}
|
||||
|
||||
// Periodically increase Delay -- variable Delay form
|
||||
// conceptually: delay *= 1 + 1/Exponent
|
||||
|
@ -374,8 +370,6 @@ int Monitor::TrySpin(Thread * const Self) {
|
|||
// CONSIDER: Delay += 1 + (Delay/4); Delay &= 0x7FF ;
|
||||
}
|
||||
|
||||
if (flgs & 2) continue;
|
||||
|
||||
// Consider checking _owner's schedctl state, if OFFPROC abort spin.
|
||||
// If the owner is OFFPROC then it's unlike that the lock will be dropped
|
||||
// in a timely fashion, which suggests that spinning would not be fruitful
|
||||
|
@ -390,12 +384,11 @@ int Monitor::TrySpin(Thread * const Self) {
|
|||
// spin loop. N1 and brethren write-around the L1$ over the xbar into the L2$.
|
||||
// Furthermore, they don't have a W$ like traditional SPARC processors.
|
||||
// We currently use a Marsaglia Shift-Xor RNG loop.
|
||||
Steps += Delay;
|
||||
if (Self != NULL) {
|
||||
jint rv = Self->rng[0];
|
||||
for (int k = Delay; --k >= 0;) {
|
||||
rv = MarsagliaXORV(rv);
|
||||
if ((flgs & 4) == 0 && SafepointMechanism::poll(Self)) return 0;
|
||||
if (SafepointMechanism::poll(Self)) return 0;
|
||||
}
|
||||
Self->rng[0] = rv;
|
||||
} else {
|
||||
|
@ -406,10 +399,6 @@ int Monitor::TrySpin(Thread * const Self) {
|
|||
|
||||
static int ParkCommon(ParkEvent * ev, jlong timo) {
|
||||
// Diagnostic support - periodically unwedge blocked threads
|
||||
intx nmt = NativeMonitorTimeout;
|
||||
if (nmt > 0 && (nmt < timo || timo <= 0)) {
|
||||
timo = nmt;
|
||||
}
|
||||
int err = OS_OK;
|
||||
if (0 == timo) {
|
||||
ev->park();
|
||||
|
@ -466,11 +455,6 @@ void Monitor::ILock(Thread * Self) {
|
|||
ESelf->reset();
|
||||
OrderAccess::fence();
|
||||
|
||||
// Optional optimization ... try barging on the inner lock
|
||||
if ((NativeMonitorFlags & 32) && Atomic::replace_if_null(ESelf, &_OnDeck)) {
|
||||
goto OnDeck_LOOP;
|
||||
}
|
||||
|
||||
if (AcquireOrPush(ESelf)) goto Exeunt;
|
||||
|
||||
// At any given time there is at most one ondeck thread.
|
||||
|
@ -484,7 +468,6 @@ void Monitor::ILock(Thread * Self) {
|
|||
|
||||
// Self is now in the OnDeck position and will remain so until it
|
||||
// manages to acquire the lock.
|
||||
OnDeck_LOOP:
|
||||
for (;;) {
|
||||
assert(_OnDeck == ESelf, "invariant");
|
||||
if (TrySpin(Self)) break;
|
||||
|
@ -706,11 +689,6 @@ bool Monitor::notify() {
|
|||
nfy->Notified = 1;
|
||||
}
|
||||
Thread::muxRelease(_WaitLock);
|
||||
if (nfy != NULL && (NativeMonitorFlags & 16)) {
|
||||
// Experimental code ... light up the wakee in the hope that this thread (the owner)
|
||||
// will drop the lock just about the time the wakee comes ONPROC.
|
||||
nfy->unpark();
|
||||
}
|
||||
assert(ILocked(), "invariant");
|
||||
return true;
|
||||
}
|
||||
|
@ -794,7 +772,7 @@ int Monitor::IWait(Thread * Self, jlong timo) {
|
|||
for (;;) {
|
||||
if (ESelf->Notified) break;
|
||||
int err = ParkCommon(ESelf, timo);
|
||||
if (err == OS_TIMEOUT || (NativeMonitorFlags & 1)) break;
|
||||
if (err == OS_TIMEOUT) break;
|
||||
}
|
||||
|
||||
// Prepare for reentry - if necessary, remove ESelf from WaitSet
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue