6841831: G1: assert(contains_reference(from),"We just added it!") fires

During parallel rset updating we have to make sure that the worker ids of the refinement threads do not intersect with the worker ids that can be claimed by the mutator threads.

Reviewed-by: tonyp
This commit is contained in:
Igor Veresov 2009-05-18 11:52:46 -07:00
parent 8c764e214c
commit 4f6c7e4a14
7 changed files with 26 additions and 13 deletions

View file

@ -1052,10 +1052,11 @@ bool OtherRegionsTable::contains_reference_locked(oop* from) const {
}
// Determines how many threads can add records to an rset in parallel.
// This can be done by either mutator threads together with the
// concurrent refinement threads or GC threads.
int HeapRegionRemSet::num_par_rem_sets() {
// We always have at least two, so that a mutator thread can claim an
// id and add to a rem set.
return (int) MAX2(ParallelGCThreads, (size_t)2);
return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads);
}
HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa,