< prev index next >

src/hotspot/share/runtime/objectMonitor.cpp

Print this page
rev 59376 : 8153224.v2.10.patch merged with 8153224.v2.11.patch.
rev 59377 : CR1 changes from dcubed, dholmes, eosterlund and rehn.
rev 59378 : CR changes from dholmes, dcubed; fix is_being_async_deflated() race found by eosterlund; WB_ForceSafepoint() should request a special clean up with AsyncDeflateIdleMonitors; add a barrier in install_displaced_markword_in_object() to separate the header load from the preceding loads in is_being_async_deflated().
rev 59379 : eosterlund CR - Switch from three part async deflation protocol to a two part async deflation protocol where a negative contentions field is a linearization point.

*** 524,536 **** return; } if (AsyncDeflateIdleMonitors && try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) { ! // The deflation protocol finished the first part (setting owner), ! // but it failed the second part (making contentions negative) and ! // bailed. Acquired the monitor. assert(_succ != Self, "invariant"); assert(_Responsible != Self, "invariant"); return; } --- 524,540 ---- return; } if (AsyncDeflateIdleMonitors && try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) { ! // Cancelled the in-progress async deflation. We bump contentions an ! // extra time to prevent the async deflater thread from temporarily ! // changing it to -max_jint and back to zero (no flicker to confuse ! // is_being_async_deflated()). The async deflater thread will ! // decrement contentions after it recognizes that the async ! // deflation was cancelled. ! add_to_contentions(1); assert(_succ != Self, "invariant"); assert(_Responsible != Self, "invariant"); return; }
*** 650,662 **** if (TryLock(Self) > 0) break; if (AsyncDeflateIdleMonitors && try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) { ! // The deflation protocol finished the first part (setting owner), ! // but it failed the second part (making contentions negative) and ! // bailed. Acquired the monitor. break; } // The lock is still contested. // Keep a tally of the # of futile wakeups. --- 654,670 ---- if (TryLock(Self) > 0) break; if (AsyncDeflateIdleMonitors && try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) { ! // Cancelled the in-progress async deflation. We bump contentions an ! // extra time to prevent the async deflater thread from temporarily ! // changing it to -max_jint and back to zero (no flicker to confuse ! // is_being_async_deflated()). The async deflater thread will ! // decrement contentions after it recognizes that the async ! // deflation was cancelled. ! add_to_contentions(1); break; } // The lock is still contested. // Keep a tally of the # of futile wakeups.
< prev index next >