comparison src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @ 1708:a03ae377b2e8

6930581: G1: assert(ParallelGCThreads > 1 || n_yielded() == _hrrs->occupied(),"Should have yielded all the .. Summary: During RSet updating, when ParallelGCThreads is zero, references that point into the collection set are added directly the referenced region's RSet. This can cause the sparse table in the RSet to expand. RSet scanning and the "occupied" routine will then operate on different instances of the sparse table causing the assert to trip. This may also cause some cards added post expansion to be missed during RSet scanning. When ParallelGCThreads is non-zero such references are recorded on the "references to be scanned" queue and the card containing the reference is recorded in a dirty card queue for use in the event of an evacuation failure. Employ the parallel code in the serial case to avoid expanding the RSets of regions in the collection set. Reviewed-by: iveresov, ysr, tonyp
author johnc
date Fri, 06 Aug 2010 10:17:21 -0700
parents 2d160770d2e5
children c32059ef4dc0
comparison
equal deleted inserted replaced
1707:0ce1569c90e5 1708:a03ae377b2e8
60 assert(from == NULL || from->is_in_reserved(p), "p is not in from"); 60 assert(from == NULL || from->is_in_reserved(p), "p is not in from");
61 61
62 HeapRegion* to = _g1->heap_region_containing(obj); 62 HeapRegion* to = _g1->heap_region_containing(obj);
63 // The test below could be optimized by applying a bit op to to and from. 63 // The test below could be optimized by applying a bit op to to and from.
64 if (to != NULL && from != NULL && from != to) { 64 if (to != NULL && from != NULL && from != to) {
65 // The _par_traversal_in_progress flag is true during the collection pause, 65 // The _traversal_in_progress flag is true during the collection pause,
66 // false during the evacuation failure handing. This should avoid a 66 // false during the evacuation failure handling. This should avoid a
67 // potential loop if we were to add the card containing 'p' to the DCQS 67 // potential loop if we were to add the card containing 'p' to the DCQS
68 // that's used to regenerate the remembered sets for the collection set, 68 // that's used to regenerate the remembered sets for the collection set,
69 // in the event of an evacuation failure, here. The UpdateRSImmediate 69 // in the event of an evacuation failure, here. The UpdateRSImmediate
70 // closure will eventally call this routine. 70 // closure will eventally call this routine.
71 if (_par_traversal_in_progress && 71 if (_traversal_in_progress &&
72 to->in_collection_set() && !self_forwarded(obj)) { 72 to->in_collection_set() && !self_forwarded(obj)) {
73 73
74 assert(_cset_rs_update_cl[tid] != NULL, "should have been set already"); 74 assert(_cset_rs_update_cl[tid] != NULL, "should have been set already");
75 _cset_rs_update_cl[tid]->do_oop(p); 75 _cset_rs_update_cl[tid]->do_oop(p);
76 76