< prev index next >

src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp

Print this page
rev 7316 : 8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
Summary: Suppress gc_alot during VM init, improve error for SLT uninitialized.
Reviewed-by:
rev 7317 : 8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
Summary: Suppress gc_alot during VM init, improve error for SLT uninitialized.
Reviewed-by: jmasa, brutisso


  25 #include "precompiled.hpp"
  26 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
  27 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
  28 #include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
  29 #include "gc_implementation/shared/gcTimer.hpp"
  30 #include "gc_implementation/shared/gcTraceTime.hpp"
  31 #include "gc_implementation/shared/isGCActiveMark.hpp"
  32 #include "memory/gcLocker.inline.hpp"
  33 #include "runtime/interfaceSupport.hpp"
  34 #include "runtime/os.hpp"
  35 #include "utilities/dtrace.hpp"
  36 
  37 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  38 
  39 //////////////////////////////////////////////////////////
  40 // Methods in abstract class VM_CMS_Operation
  41 //////////////////////////////////////////////////////////
  42 void VM_CMS_Operation::acquire_pending_list_lock() {
  43   // The caller may block while communicating
  44   // with the SLT thread in order to acquire/release the PLL.
  45   ConcurrentMarkSweepThread::slt()->
  46     manipulatePLL(SurrogateLockerThread::acquirePLL);




  47 }
  48 
  49 void VM_CMS_Operation::release_and_notify_pending_list_lock() {
  50   // The caller may block while communicating
  51   // with the SLT thread in order to acquire/release the PLL.
  52   ConcurrentMarkSweepThread::slt()->
  53     manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
  54 }
  55 
  56 void VM_CMS_Operation::verify_before_gc() {
  57   if (VerifyBeforeGC &&
  58       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  59     GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
  60     HandleMark hm;
  61     FreelistLocker x(_collector);
  62     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  63     Universe::heap()->prepare_for_verify();
  64     Universe::verify();
  65   }
  66 }




  25 #include "precompiled.hpp"
  26 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
  27 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
  28 #include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
  29 #include "gc_implementation/shared/gcTimer.hpp"
  30 #include "gc_implementation/shared/gcTraceTime.hpp"
  31 #include "gc_implementation/shared/isGCActiveMark.hpp"
  32 #include "memory/gcLocker.inline.hpp"
  33 #include "runtime/interfaceSupport.hpp"
  34 #include "runtime/os.hpp"
  35 #include "utilities/dtrace.hpp"
  36 
  37 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  38 
  39 //////////////////////////////////////////////////////////
  40 // Methods in abstract class VM_CMS_Operation
  41 //////////////////////////////////////////////////////////
  42 void VM_CMS_Operation::acquire_pending_list_lock() {
  43   // The caller may block while communicating
  44   // with the SLT thread in order to acquire/release the PLL.
  45   SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
  46   if (slt != NULL) {
  47     slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
  48   } else {
  49     SurrogateLockerThread::report_missing_slt();
  50   }
  51 }
  52 
  53 void VM_CMS_Operation::release_and_notify_pending_list_lock() {
  54   // The caller may block while communicating
  55   // with the SLT thread in order to acquire/release the PLL.
  56   ConcurrentMarkSweepThread::slt()->
  57     manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
  58 }
  59 
  60 void VM_CMS_Operation::verify_before_gc() {
  61   if (VerifyBeforeGC &&
  62       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  63     GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm, _collector->_gc_tracer_cm->gc_id());
  64     HandleMark hm;
  65     FreelistLocker x(_collector);
  66     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  67     Universe::heap()->prepare_for_verify();
  68     Universe::verify();
  69   }
  70 }


< prev index next >