mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +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) },
|
{ "InlineNotify", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
|
||||||
{ "EnableTracing", 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) },
|
{ "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
|
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
|
||||||
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
|
{ "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 " \
|
"When true prevents OS-level spurious, or premature, wakeups " \
|
||||||
"from Object.wait (Ignored for Windows)") \
|
"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, \
|
develop(bool, UsePthreads, false, \
|
||||||
"Use pthread-based instead of libthread-based synchronization " \
|
"Use pthread-based instead of libthread-based synchronization " \
|
||||||
"(SPARC only)") \
|
"(SPARC only)") \
|
||||||
|
|
|
@ -348,9 +348,7 @@ int Monitor::TrySpin(Thread * const Self) {
|
||||||
|
|
||||||
int Probes = 0;
|
int Probes = 0;
|
||||||
int Delay = 0;
|
int Delay = 0;
|
||||||
int Steps = 0;
|
int SpinMax = 20;
|
||||||
int SpinMax = NativeMonitorSpinLimit;
|
|
||||||
int flgs = NativeMonitorFlags;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
intptr_t v = _LockWord.FullWord;
|
intptr_t v = _LockWord.FullWord;
|
||||||
if ((v & _LBIT) == 0) {
|
if ((v & _LBIT) == 0) {
|
||||||
|
@ -360,9 +358,7 @@ int Monitor::TrySpin(Thread * const Self) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flgs & 8) == 0) {
|
|
||||||
SpinPause();
|
SpinPause();
|
||||||
}
|
|
||||||
|
|
||||||
// Periodically increase Delay -- variable Delay form
|
// Periodically increase Delay -- variable Delay form
|
||||||
// conceptually: delay *= 1 + 1/Exponent
|
// conceptually: delay *= 1 + 1/Exponent
|
||||||
|
@ -374,8 +370,6 @@ int Monitor::TrySpin(Thread * const Self) {
|
||||||
// CONSIDER: Delay += 1 + (Delay/4); Delay &= 0x7FF ;
|
// CONSIDER: Delay += 1 + (Delay/4); Delay &= 0x7FF ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flgs & 2) continue;
|
|
||||||
|
|
||||||
// Consider checking _owner's schedctl state, if OFFPROC abort spin.
|
// 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
|
// 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
|
// 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$.
|
// 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.
|
// Furthermore, they don't have a W$ like traditional SPARC processors.
|
||||||
// We currently use a Marsaglia Shift-Xor RNG loop.
|
// We currently use a Marsaglia Shift-Xor RNG loop.
|
||||||
Steps += Delay;
|
|
||||||
if (Self != NULL) {
|
if (Self != NULL) {
|
||||||
jint rv = Self->rng[0];
|
jint rv = Self->rng[0];
|
||||||
for (int k = Delay; --k >= 0;) {
|
for (int k = Delay; --k >= 0;) {
|
||||||
rv = MarsagliaXORV(rv);
|
rv = MarsagliaXORV(rv);
|
||||||
if ((flgs & 4) == 0 && SafepointMechanism::poll(Self)) return 0;
|
if (SafepointMechanism::poll(Self)) return 0;
|
||||||
}
|
}
|
||||||
Self->rng[0] = rv;
|
Self->rng[0] = rv;
|
||||||
} else {
|
} else {
|
||||||
|
@ -406,10 +399,6 @@ int Monitor::TrySpin(Thread * const Self) {
|
||||||
|
|
||||||
static int ParkCommon(ParkEvent * ev, jlong timo) {
|
static int ParkCommon(ParkEvent * ev, jlong timo) {
|
||||||
// Diagnostic support - periodically unwedge blocked threads
|
// Diagnostic support - periodically unwedge blocked threads
|
||||||
intx nmt = NativeMonitorTimeout;
|
|
||||||
if (nmt > 0 && (nmt < timo || timo <= 0)) {
|
|
||||||
timo = nmt;
|
|
||||||
}
|
|
||||||
int err = OS_OK;
|
int err = OS_OK;
|
||||||
if (0 == timo) {
|
if (0 == timo) {
|
||||||
ev->park();
|
ev->park();
|
||||||
|
@ -466,11 +455,6 @@ void Monitor::ILock(Thread * Self) {
|
||||||
ESelf->reset();
|
ESelf->reset();
|
||||||
OrderAccess::fence();
|
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;
|
if (AcquireOrPush(ESelf)) goto Exeunt;
|
||||||
|
|
||||||
// At any given time there is at most one ondeck thread.
|
// 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
|
// Self is now in the OnDeck position and will remain so until it
|
||||||
// manages to acquire the lock.
|
// manages to acquire the lock.
|
||||||
OnDeck_LOOP:
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
assert(_OnDeck == ESelf, "invariant");
|
assert(_OnDeck == ESelf, "invariant");
|
||||||
if (TrySpin(Self)) break;
|
if (TrySpin(Self)) break;
|
||||||
|
@ -706,11 +689,6 @@ bool Monitor::notify() {
|
||||||
nfy->Notified = 1;
|
nfy->Notified = 1;
|
||||||
}
|
}
|
||||||
Thread::muxRelease(_WaitLock);
|
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");
|
assert(ILocked(), "invariant");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -794,7 +772,7 @@ int Monitor::IWait(Thread * Self, jlong timo) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (ESelf->Notified) break;
|
if (ESelf->Notified) break;
|
||||||
int err = ParkCommon(ESelf, timo);
|
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
|
// Prepare for reentry - if necessary, remove ESelf from WaitSet
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue