8242032: G1 region remembered sets may contain non-coarse level PRTs for already coarsened regions

Reviewed-by: ayang, tschatzl
This commit is contained in:
Joakim Nordström 2021-02-22 16:16:59 +00:00 committed by Thomas Schatzl
parent d7eebdac5d
commit a6a7e4398a

View File

@ -145,6 +145,13 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
PerRegionTable* prt = find_region_table(ind, from_hr);
if (prt == NULL) {
MutexLocker x(_m, Mutex::_no_safepoint_check_flag);
// Rechecking if the region is coarsened, while holding the lock.
if (is_region_coarsened(from_hrm_ind)) {
assert(contains_reference(from), "We just found " PTR_FORMAT " in the Coarse table", p2i(from));
return;
}
// Confirm that it's really not there...
prt = find_region_table(ind, from_hr);
if (prt == NULL) {
@ -160,6 +167,8 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
return;
}
// Sparse PRT returned overflow (sparse table is full)
if (_n_fine_entries == _max_fine_entries) {
prt = delete_region_table(num_added_by_coarsening);
// There is no need to clear the links to the 'all' list here: