Print this page
rev 2755 : 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:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
          +++ new/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
↓ open down ↓ 216 lines elided ↑ open up ↑
 217  217      Thread::start(res);
 218  218    }
 219  219    os::yield(); // This seems to help with initial start-up of SLT
 220  220    return res;
 221  221  }
 222  222  
 223  223  void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) {
 224  224    MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
 225  225    assert(_buffer == empty, "Should be empty");
 226  226    assert(msg != empty, "empty message");
      227 +  assert(!Heap_lock->owned_by_self(), "Heap_lock owned by requesting thread");
      228 +
 227  229    _buffer = msg;
 228  230    while (_buffer != empty) {
 229  231      _monitor.notify();
 230  232      _monitor.wait(Mutex::_no_safepoint_check_flag);
 231  233    }
 232  234  }
 233  235  
 234  236  // ======= Surrogate Locker Thread =============
 235  237  
 236  238  void SurrogateLockerThread::loop() {
↓ open down ↓ 73 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX