8153224: Monitor deflation prolong safepoints

Add support for AsyncDeflateIdleMonitors (default true); the async deflation work is performed by the ServiceThread.

Co-authored-by: Carsten Varming <varming@gmail.com>
Reviewed-by: dcubed, rehn, rkennke, cvarming, coleenp, acorn, dholmes, eosterlund
This commit is contained in:
Daniel D. Daugherty 2020-06-01 23:37:14 -04:00
parent 30aa1b0689
commit 00f223e22f
23 changed files with 1496 additions and 250 deletions

View file

@ -4692,6 +4692,8 @@ GrowableArray<JavaThread*>* Threads::get_pending_threads(ThreadsList * t_list,
DO_JAVA_THREADS(t_list, p) {
if (!p->can_call_java()) continue;
// The first stage of async deflation does not affect any field
// used by this comparison so the ObjectMonitor* is usable here.
address pending = (address)p->current_pending_monitor();
if (pending == monitor) { // found a match
if (i < count) result->append(p); // save the first count matches