Skip to content

Commit

Permalink
8341643: G1: Merged cards counter skewed by merge cards cache
Browse files Browse the repository at this point in the history
Reviewed-by: iwalulya, mli
  • Loading branch information
Thomas Schatzl committed Oct 8, 2024
1 parent 6e48618 commit 4a12f5b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hotspot/share/gc/g1/g1RemSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ class G1MergeHeapRootsTask : public WorkerTask {
_merged[G1GCPhaseTimes::MergeRSCards] += increment;
}

void dec_remset_cards(size_t decrement) {
_merged[G1GCPhaseTimes::MergeRSCards] -= decrement;
}

size_t merged(uint i) const { return _merged[i]; }
};

Expand Down Expand Up @@ -1091,6 +1095,11 @@ class G1MergeHeapRootsTask : public WorkerTask {

G1MergeCardSetStats stats() {
_merge_card_set_cache.flush();
// Compensation for the dummy cards that were initially pushed into the
// card cache.
// We do not need to compensate for the other counters because the dummy
// card mark will never update another counter because it is initally "dirty".
_stats.dec_remset_cards(G1MergeCardSetCache::CacheSize);
return _stats;
}
};
Expand Down

0 comments on commit 4a12f5b

Please sign in to comment.