8341643: G1: Merged cards counter skewed by merge cards cache

Reviewed-by: iwalulya, mli
This commit is contained in:
Thomas Schatzl 2024-10-08 14:12:53 +00:00
parent 6e48618161
commit 4a12f5b26e

View File

@ -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]; }
};
@ -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;
}
};