Skip to content

Commit

Permalink
8318507: G1: Improve remset clearing for humongous candidates
Browse files Browse the repository at this point in the history
Reviewed-by: iwalulya, ayang, mli
  • Loading branch information
Thomas Schatzl committed Oct 23, 2023
1 parent 4eab39d commit 729f4c5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/hotspot/share/gc/g1/g1RemSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,23 +1186,17 @@ class G1MergeHeapRootsTask : public WorkerTask {
guarantee(r->rem_set()->occupancy_less_or_equal_than(G1EagerReclaimRemSetThreshold),
"Found a not-small remembered set here. This is inconsistent with previous assumptions.");


_cl.merge_card_set_for_region(r);

// We should only clear the card based remembered set here as we will not
// implicitly rebuild anything else during eager reclaim. Note that at the moment
// (and probably never) we do not enter this path if there are other kind of
// remembered sets for this region.
r->rem_set()->clear(true /* only_cardset */);
// Clear_locked() above sets the state to Empty. However we want to continue
// collecting remembered set entries for humongous regions that were not
// reclaimed.
r->rem_set()->set_state_complete();
#ifdef ASSERT
G1HeapRegionAttr region_attr = g1h->region_attr(region_index);
assert(region_attr.remset_is_tracked(), "must be");
#endif
assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
// We want to continue collecting remembered set entries for humongous regions
// that were not reclaimed.
r->rem_set()->clear(true /* only_cardset */, true /* keep_tracked */);

assert(r->rem_set()->is_empty() && r->rem_set()->is_complete(), "must be for eager reclaim candidates");

return false;
}
Expand Down

1 comment on commit 729f4c5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.