comparison src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @ 4022:db89aa49298f

7099824: G1: we should take the pending list lock before doing the remark pause Summary: Acquire the pending list lock in the prologue method of G1's concurrent VM_Operation and release the lock in the epilogue() method. The locking/unlocking order of the pending list lock and the Heap_lock should match that in the prologue and epilogue methods of VM_GC_Operation. Reviewed-by: tonyp, ysr
author johnc
date Thu, 20 Oct 2011 12:06:20 -0700
parents ec4b032a4977
children 00dd86e542eb
comparison
equal deleted inserted replaced
4021:8d161913dfc3 4022:db89aa49298f
145 gclog_or_tty->stamp(PrintGCTimeStamps); 145 gclog_or_tty->stamp(PrintGCTimeStamps);
146 gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]"); 146 gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
147 } 147 }
148 } 148 }
149 } while (cm()->restart_for_overflow()); 149 } while (cm()->restart_for_overflow());
150
150 double counting_start_time = os::elapsedVTime(); 151 double counting_start_time = os::elapsedVTime();
151
152 // YSR: These look dubious (i.e. redundant) !!! FIX ME
153 slt()->manipulatePLL(SurrogateLockerThread::acquirePLL);
154 slt()->manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
155
156 if (!cm()->has_aborted()) { 152 if (!cm()->has_aborted()) {
157 double count_start_sec = os::elapsedTime(); 153 double count_start_sec = os::elapsedTime();
158 if (PrintGC) { 154 if (PrintGC) {
159 gclog_or_tty->date_stamp(PrintGCDateStamps); 155 gclog_or_tty->date_stamp(PrintGCDateStamps);
160 gclog_or_tty->stamp(PrintGCTimeStamps); 156 gclog_or_tty->stamp(PrintGCTimeStamps);
173 gclog_or_tty->print_cr("[GC concurrent-count-end, %1.7lf]", 169 gclog_or_tty->print_cr("[GC concurrent-count-end, %1.7lf]",
174 count_end_sec - count_start_sec); 170 count_end_sec - count_start_sec);
175 } 171 }
176 } 172 }
177 } 173 }
174
178 double end_time = os::elapsedVTime(); 175 double end_time = os::elapsedVTime();
179 _vtime_count_accum += (end_time - counting_start_time); 176 _vtime_count_accum += (end_time - counting_start_time);
180 // Update the total virtual time before doing this, since it will try 177 // Update the total virtual time before doing this, since it will try
181 // to measure it to get the vtime for this marking. We purposely 178 // to measure it to get the vtime for this marking. We purposely
182 // neglect the presumably-short "completeCleanup" phase here. 179 // neglect the presumably-short "completeCleanup" phase here.
333 } 330 }
334 set_in_progress(); 331 set_in_progress();
335 clear_started(); 332 clear_started();
336 } 333 }
337 334
338 // Note: this method, although exported by the ConcurrentMarkSweepThread, 335 // Note: As is the case with CMS - this method, although exported
339 // which is a non-JavaThread, can only be called by a JavaThread. 336 // by the ConcurrentMarkThread, which is a non-JavaThread, can only
340 // Currently this is done at vm creation time (post-vm-init) by the 337 // be called by a JavaThread. Currently this is done at vm creation
341 // main/Primordial (Java)Thread. 338 // time (post-vm-init) by the main/Primordial (Java)Thread.
342 // XXX Consider changing this in the future to allow the CMS thread 339 // XXX Consider changing this in the future to allow the CM thread
343 // itself to create this thread? 340 // itself to create this thread?
344 void ConcurrentMarkThread::makeSurrogateLockerThread(TRAPS) { 341 void ConcurrentMarkThread::makeSurrogateLockerThread(TRAPS) {
342 assert(UseG1GC, "SLT thread needed only for concurrent GC");
343 assert(THREAD->is_Java_thread(), "must be a Java thread");
345 assert(_slt == NULL, "SLT already created"); 344 assert(_slt == NULL, "SLT already created");
346 _slt = SurrogateLockerThread::make(THREAD); 345 _slt = SurrogateLockerThread::make(THREAD);
347 } 346 }