1.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp Thu Mar 12 18:17:25 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp Wed Mar 18 11:37:48 2009 -0400 1.3 @@ -502,14 +502,17 @@ 1.4 } 1.5 1.6 if (ParallelGCThreads > 0) { 1.7 - // This is a temporary change to serialize the update and scanning 1.8 - // of remembered sets. There are some race conditions when this is 1.9 - // done in parallel and they are causing failures. When we resolve 1.10 - // said race conditions, we'll revert back to parallel remembered 1.11 - // set updating and scanning. See CRs 6677707 and 6677708. 1.12 - if (worker_i == 0) { 1.13 + // The two flags below were introduced temporarily to serialize 1.14 + // the updating and scanning of remembered sets. There are some 1.15 + // race conditions when these two operations are done in parallel 1.16 + // and they are causing failures. When we resolve said race 1.17 + // conditions, we'll revert back to parallel remembered set 1.18 + // updating and scanning. See CRs 6677707 and 6677708. 1.19 + if (G1EnableParallelRSetUpdating || (worker_i == 0)) { 1.20 updateRS(worker_i); 1.21 scanNewRefsRS(oc, worker_i); 1.22 + } 1.23 + if (G1EnableParallelRSetScanning || (worker_i == 0)) { 1.24 scanRS(oc, worker_i); 1.25 } 1.26 } else { 1.27 @@ -716,8 +719,7 @@ 1.28 bool doHeapRegion(HeapRegion* r) { 1.29 if (!r->in_collection_set() && 1.30 !r->continuesHumongous() && 1.31 - !r->is_young() && 1.32 - !r->is_survivor()) { 1.33 + !r->is_young()) { 1.34 _update_rs_oop_cl.set_from(r); 1.35 UpdateRSObjectClosure update_rs_obj_cl(&_update_rs_oop_cl); 1.36 1.37 @@ -854,7 +856,7 @@ 1.38 // before all the cards on the region are dirtied. This is unlikely, 1.39 // and it doesn't happen often, but it can happen. So, the extra 1.40 // check below filters out those cards. 1.41 - if (r->is_young() || r->is_survivor()) { 1.42 + if (r->is_young()) { 1.43 return; 1.44 } 1.45 // While we are processing RSet buffers during the collection, we 1.46 @@ -1025,7 +1027,9 @@ 1.47 } 1.48 } 1.49 void HRInto_G1RemSet::prepare_for_verify() { 1.50 - if (G1HRRSFlushLogBuffersOnVerify && VerifyBeforeGC && !_g1->full_collection()) { 1.51 + if (G1HRRSFlushLogBuffersOnVerify && 1.52 + (VerifyBeforeGC || VerifyAfterGC) 1.53 + && !_g1->full_collection()) { 1.54 cleanupHRRS(); 1.55 _g1->set_refine_cte_cl_concurrency(false); 1.56 if (SafepointSynchronize::is_at_safepoint()) { 1.57 @@ -1036,5 +1040,7 @@ 1.58 _cg1r->set_use_cache(false); 1.59 updateRS(0); 1.60 _cg1r->set_use_cache(cg1r_use_cache); 1.61 + 1.62 + assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed"); 1.63 } 1.64 }