--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Wed Jul 05 16:49:07 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Wed Mar 18 11:37:48 2009 -0400
@@ -502,14 +502,17 @@
}
if (ParallelGCThreads > 0) {
- // This is a temporary change to serialize the update and scanning
- // of remembered sets. There are some race conditions when this is
- // done in parallel and they are causing failures. When we resolve
- // said race conditions, we'll revert back to parallel remembered
- // set updating and scanning. See CRs 6677707 and 6677708.
- if (worker_i == 0) {
+ // The two flags below were introduced temporarily to serialize
+ // the updating and scanning of remembered sets. There are some
+ // race conditions when these two operations are done in parallel
+ // and they are causing failures. When we resolve said race
+ // conditions, we'll revert back to parallel remembered set
+ // updating and scanning. See CRs 6677707 and 6677708.
+ if (G1EnableParallelRSetUpdating || (worker_i == 0)) {
updateRS(worker_i);
scanNewRefsRS(oc, worker_i);
+ }
+ if (G1EnableParallelRSetScanning || (worker_i == 0)) {
scanRS(oc, worker_i);
}
} else {
@@ -716,8 +719,7 @@
bool doHeapRegion(HeapRegion* r) {
if (!r->in_collection_set() &&
!r->continuesHumongous() &&
- !r->is_young() &&
- !r->is_survivor()) {
+ !r->is_young()) {
_update_rs_oop_cl.set_from(r);
UpdateRSObjectClosure update_rs_obj_cl(&_update_rs_oop_cl);
@@ -854,7 +856,7 @@
// before all the cards on the region are dirtied. This is unlikely,
// and it doesn't happen often, but it can happen. So, the extra
// check below filters out those cards.
- if (r->is_young() || r->is_survivor()) {
+ if (r->is_young()) {
return;
}
// While we are processing RSet buffers during the collection, we
@@ -1025,7 +1027,9 @@
}
}
void HRInto_G1RemSet::prepare_for_verify() {
- if (G1HRRSFlushLogBuffersOnVerify && VerifyBeforeGC && !_g1->full_collection()) {
+ if (G1HRRSFlushLogBuffersOnVerify &&
+ (VerifyBeforeGC || VerifyAfterGC)
+ && !_g1->full_collection()) {
cleanupHRRS();
_g1->set_refine_cte_cl_concurrency(false);
if (SafepointSynchronize::is_at_safepoint()) {
@@ -1036,5 +1040,7 @@
_cg1r->set_use_cache(false);
updateRS(0);
_cg1r->set_use_cache(cg1r_use_cache);
+
+ assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed");
}
}