src/share/vm/gc_implementation/g1/g1RemSet.cpp

changeset 2063
a03ae377b2e8
parent 2060
2d160770d2e5
child 2188
8b10f48633dc
     1.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Wed Aug 04 13:03:23 2010 -0400
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Fri Aug 06 10:17:21 2010 -0700
     1.3 @@ -122,7 +122,7 @@
     1.4  HRInto_G1RemSet::HRInto_G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
     1.5    : G1RemSet(g1), _ct_bs(ct_bs), _g1p(_g1->g1_policy()),
     1.6      _cg1r(g1->concurrent_g1_refine()),
     1.7 -    _par_traversal_in_progress(false),
     1.8 +    _traversal_in_progress(false),
     1.9      _cset_rs_update_cl(NULL),
    1.10      _cards_scanned(NULL), _total_cards_scanned(0)
    1.11  {
    1.12 @@ -484,28 +484,24 @@
    1.13    //   is updated immediately.
    1.14    DirtyCardQueue into_cset_dcq(&_g1->into_cset_dirty_card_queue_set());
    1.15  
    1.16 -  if (ParallelGCThreads > 0) {
    1.17 -    // The two flags below were introduced temporarily to serialize
    1.18 -    // the updating and scanning of remembered sets. There are some
    1.19 -    // race conditions when these two operations are done in parallel
    1.20 -    // and they are causing failures. When we resolve said race
    1.21 -    // conditions, we'll revert back to parallel remembered set
    1.22 -    // updating and scanning. See CRs 6677707 and 6677708.
    1.23 -    if (G1UseParallelRSetUpdating || (worker_i == 0)) {
    1.24 -      updateRS(&into_cset_dcq, worker_i);
    1.25 -    } else {
    1.26 -      _g1p->record_update_rs_processed_buffers(worker_i, 0.0);
    1.27 -      _g1p->record_update_rs_time(worker_i, 0.0);
    1.28 -    }
    1.29 -    if (G1UseParallelRSetScanning || (worker_i == 0)) {
    1.30 -      scanRS(oc, worker_i);
    1.31 -    } else {
    1.32 -      _g1p->record_scan_rs_time(worker_i, 0.0);
    1.33 -    }
    1.34 +  assert((ParallelGCThreads > 0) || worker_i == 0, "invariant");
    1.35 +
    1.36 +  // The two flags below were introduced temporarily to serialize
    1.37 +  // the updating and scanning of remembered sets. There are some
    1.38 +  // race conditions when these two operations are done in parallel
    1.39 +  // and they are causing failures. When we resolve said race
    1.40 +  // conditions, we'll revert back to parallel remembered set
    1.41 +  // updating and scanning. See CRs 6677707 and 6677708.
    1.42 +  if (G1UseParallelRSetUpdating || (worker_i == 0)) {
    1.43 +    updateRS(&into_cset_dcq, worker_i);
    1.44    } else {
    1.45 -    assert(worker_i == 0, "invariant");
    1.46 -    updateRS(&into_cset_dcq, 0);
    1.47 -    scanRS(oc, 0);
    1.48 +    _g1p->record_update_rs_processed_buffers(worker_i, 0.0);
    1.49 +    _g1p->record_update_rs_time(worker_i, 0.0);
    1.50 +  }
    1.51 +  if (G1UseParallelRSetScanning || (worker_i == 0)) {
    1.52 +    scanRS(oc, worker_i);
    1.53 +  } else {
    1.54 +    _g1p->record_scan_rs_time(worker_i, 0.0);
    1.55    }
    1.56  
    1.57    // We now clear the cached values of _cset_rs_update_cl for this worker
    1.58 @@ -524,9 +520,9 @@
    1.59    DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
    1.60    dcqs.concatenate_logs();
    1.61  
    1.62 -  assert(!_par_traversal_in_progress, "Invariant between iterations.");
    1.63 +  assert(!_traversal_in_progress, "Invariant between iterations.");
    1.64 +  set_traversal(true);
    1.65    if (ParallelGCThreads > 0) {
    1.66 -    set_par_traversal(true);
    1.67      _seq_task->set_par_threads((int)n_workers());
    1.68    }
    1.69    guarantee( _cards_scanned == NULL, "invariant" );
    1.70 @@ -623,9 +619,7 @@
    1.71    // Set all cards back to clean.
    1.72    _g1->cleanUpCardTable();
    1.73  
    1.74 -  if (ParallelGCThreads > 0) {
    1.75 -    set_par_traversal(false);
    1.76 -  }
    1.77 +  set_traversal(false);
    1.78  
    1.79    DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set();
    1.80    int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num();
    1.81 @@ -660,7 +654,7 @@
    1.82           "all buffers should be freed");
    1.83    _g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers();
    1.84  
    1.85 -  assert(!_par_traversal_in_progress, "Invariant between iterations.");
    1.86 +  assert(!_traversal_in_progress, "Invariant between iterations.");
    1.87  }
    1.88  
    1.89  class UpdateRSObjectClosure: public ObjectClosure {

mercurial