request for review (XS), 6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent

Y. Srinivas Ramakrishna y.s.ramakrishna at
Fri Dec 3 20:28:11 UTC 2010

Keith, two points:

(1) the gc_end() here is incorrectly placed for concurrent full gc calls.
     That's because the end may not yet have occurred. It occurs only in the
     else arm where we post the notify on the lock.

     That's the case when a concurrently called full gc has stood witness
     for this request.

     For the case where that is not the case (the if() arm where we
     nudge the concurrent collector), the concurrent gc has just started.

     You will then find that the caller is notified in doit_epilogue() to
     the GC operation.

(2) For the same reason as above, the destructor of JVMTI GC Marker will
     fire too early and post a finish event earlier than the actual end
     of the CMS concurrent collection.

     Because of the above, you might be better off posting the start and end
     in the context of the calling Java thread (if you want strict bracketing),
     looking at the success indication that the operation returns.

If you can lose the scoped c'tor/d'tor idiom of the jvmti marker, then you are
better off posting the start where you do now and the finish in the
epilogue (or in the java thread). The dtrace begin/end's are of course more
free to move to the right places (the start is in the right place and
the end needs to move to the doit_epilogue as stated above).

Sorry for the trouble, but this is because the concurrent collection is
done concurrent with the Java threads and the VM thread goes off and
does a bunch of other stuff in between (including many other gc events
such as scavenges etc.)

-- ramki

On 12/3/2010 8:18 AM, Keith McGuigan wrote:
> Updated webrev:
> On Dec 3, 2010, at 3:30 AM, Igor Veresov wrote:
>> You're calling notify_gc_end() while holding the FullGCCount_lock. Is that ok? Would it be more
>> prudent to divert control to the user without holding it?
>> igor
>> On 12/2/10 2:29 PM, Keith McGuigan wrote:
>>> This fix adds JVMTI callbacks for CMS full GCs:
>>> --
>>> - Keith

More information about the hotspot-gc-dev mailing list