Skip to content
Permalink
Browse files
8242032: G1 region remembered sets may contain non-coarse level PRTs …
…for already coarsened regions

Reviewed-by: ayang, tschatzl
  • Loading branch information
jaokim authored and Thomas Schatzl committed Feb 22, 2021
1 parent d7eebda commit a6a7e4398aae9568e39650341aa3255ab23f9961
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/hotspot/share/gc/g1/heapRegionRemSet.cpp
@@ -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:

1 comment on commit a6a7e43

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on a6a7e43 Feb 22, 2021

Please sign in to comment.