mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 01:19:28 +01:00
8349213: G1: Clearing bitmaps during collection set merging not claimed by region
Reviewed-by: iwalulya, ayang
This commit is contained in:
@@ -1266,6 +1266,7 @@ class G1MergeHeapRootsTask : public WorkerTask {
|
||||
};
|
||||
|
||||
uint _num_workers;
|
||||
G1HeapRegionClaimer _hr_claimer;
|
||||
G1RemSetScanState* _scan_state;
|
||||
|
||||
// To mitigate contention due multiple threads accessing and popping BufferNodes from a shared
|
||||
@@ -1295,6 +1296,7 @@ public:
|
||||
G1MergeHeapRootsTask(G1RemSetScanState* scan_state, uint num_workers, bool initial_evacuation) :
|
||||
WorkerTask("G1 Merge Heap Roots"),
|
||||
_num_workers(num_workers),
|
||||
_hr_claimer(num_workers),
|
||||
_scan_state(scan_state),
|
||||
_dirty_card_buffers(nullptr),
|
||||
_initial_evacuation(initial_evacuation),
|
||||
@@ -1384,7 +1386,6 @@ public:
|
||||
{
|
||||
// 2. collection set
|
||||
G1MergeCardSetClosure merge(_scan_state);
|
||||
G1ClearBitmapClosure clear_bitmap(g1h, _scan_state);
|
||||
|
||||
if (_initial_evacuation) {
|
||||
G1HeapRegionRemSet::iterate_for_merge(g1h->young_regions_cardset(), merge);
|
||||
@@ -1392,7 +1393,6 @@ public:
|
||||
|
||||
g1h->collection_set()->merge_cardsets_for_collection_groups(merge, worker_id, _num_workers);
|
||||
|
||||
g1h->collection_set_iterate_increment_from(&clear_bitmap, nullptr, worker_id);
|
||||
G1MergeCardSetStats stats = merge.stats();
|
||||
|
||||
for (uint i = 0; i < G1GCPhaseTimes::MergeRSContainersSentinel; i++) {
|
||||
@@ -1401,6 +1401,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Preparation for evacuation failure handling.
|
||||
{
|
||||
G1ClearBitmapClosure clear(g1h, _scan_state);
|
||||
g1h->collection_set_iterate_increment_from(&clear, &_hr_claimer, worker_id);
|
||||
}
|
||||
|
||||
// Now apply the closure to all remaining log entries.
|
||||
if (_initial_evacuation) {
|
||||
assert(merge_remset_phase == G1GCPhaseTimes::MergeRS, "Wrong merge phase");
|
||||
|
||||
Reference in New Issue
Block a user