7014261: G1: RSet-related failures

A race between the concurrent cleanup thread and the VM thread while it is processing the "expanded sparse table list" causes both threads to try to free the same sparse table entry and either causes one of the threads to fail or leaves the entry in an inconsistent state. The solution is purge all entries on the expanded list that correspond go regions that are being cleaned up.

Reviewed-by: brutisso, johnc
This commit is contained in:
Antonios Printezis 2011-01-25 17:58:19 -05:00
parent 14f4450d25
commit ded092cb70
7 changed files with 171 additions and 36 deletions

View file

@ -4925,10 +4925,11 @@ void G1CollectedHeap::evacuate_collection_set() {
COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
}
void G1CollectedHeap::free_region_if_totally_empty(HeapRegion* hr,
void G1CollectedHeap::free_region_if_empty(HeapRegion* hr,
size_t* pre_used,
FreeRegionList* free_list,
HumongousRegionSet* humongous_proxy_set,
HRRSCleanupTask* hrrs_cleanup_task,
bool par) {
if (hr->used() > 0 && hr->max_live_bytes() == 0 && !hr->is_young()) {
if (hr->isHumongous()) {
@ -4937,6 +4938,8 @@ void G1CollectedHeap::free_region_if_totally_empty(HeapRegion* hr,
} else {
free_region(hr, pre_used, free_list, par);
}
} else {
hr->rem_set()->do_cleanup_work(hrrs_cleanup_task);
}
}