--- old/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp 2011-10-17 14:23:36.370149118 -0700 +++ new/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp 2011-10-17 14:23:36.163979935 -0700 @@ -147,12 +147,8 @@ } } } while (cm()->restart_for_overflow()); - double counting_start_time = os::elapsedVTime(); - - // YSR: These look dubious (i.e. redundant) !!! FIX ME - slt()->manipulatePLL(SurrogateLockerThread::acquirePLL); - slt()->manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL); + double counting_start_time = os::elapsedVTime(); if (!cm()->has_aborted()) { double count_start_sec = os::elapsedTime(); if (PrintGC) { @@ -175,6 +171,7 @@ } } } + double end_time = os::elapsedVTime(); _vtime_count_accum += (end_time - counting_start_time); // Update the total virtual time before doing this, since it will try @@ -335,13 +332,15 @@ clear_started(); } -// Note: this method, although exported by the ConcurrentMarkSweepThread, +// Note: this method, although exported by the ConcurrentMarkThread, // which is a non-JavaThread, can only be called by a JavaThread. // Currently this is done at vm creation time (post-vm-init) by the // main/Primordial (Java)Thread. -// XXX Consider changing this in the future to allow the CMS thread +// XXX Consider changing this in the future to allow the CM thread // itself to create this thread? void ConcurrentMarkThread::makeSurrogateLockerThread(TRAPS) { + assert(UseG1GC, "SLT thread needed only for concurrent GC"); + assert(THREAD->is_Java_thread(), "must be a Java thread"); assert(_slt == NULL, "SLT already created"); _slt = SurrogateLockerThread::make(THREAD); }