Skip to content

Commit a71b404

Browse files
author
Thomas Schatzl
committedMay 24, 2024
8331398: G1: G1HeapRegionPrinter reclamation events should print the original region type
Reviewed-by: ayang, iwalulya, gli
1 parent af056c1 commit a71b404

File tree

4 files changed

+5
-47
lines changed

4 files changed

+5
-47
lines changed
 

‎src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
12471247
hr->set_containing_set(nullptr);
12481248
hr->clear_cardtable();
12491249
_g1h->concurrent_mark()->clear_statistics(hr);
1250+
G1HeapRegionPrinter::mark_reclaim(hr);
12501251
_g1h->free_humongous_region(hr, _local_cleanup_list);
12511252
};
12521253

@@ -1263,6 +1264,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
12631264
hr->set_containing_set(nullptr);
12641265
hr->clear_cardtable();
12651266
_g1h->concurrent_mark()->clear_statistics(hr);
1267+
G1HeapRegionPrinter::mark_reclaim(hr);
12661268
_g1h->free_region(hr, _local_cleanup_list);
12671269
}
12681270

@@ -1317,8 +1319,6 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
13171319
~G1UpdateRegionLivenessAndSelectForRebuildTask() {
13181320
if (!_cleanup_list.is_empty()) {
13191321
log_debug(gc)("Reclaimed %u empty regions", _cleanup_list.length());
1320-
// Now print the empty regions list.
1321-
G1HeapRegionPrinter::mark_reclaim(&_cleanup_list);
13221322
// And actually make them available.
13231323
_g1h->prepend_to_freelist(&_cleanup_list);
13241324
}

‎src/hotspot/share/gc/g1/g1HeapRegionPrinter.cpp

-38
This file was deleted.

‎src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ class G1HeapRegionPrinter : public AllStatic {
3939
action, hr->get_type_str(), p2i(hr->bottom()), p2i(hr->top()), p2i(hr->end()));
4040
}
4141

42-
static void mark_reclaim(HeapRegion* hr) {
43-
print("MARK-RECLAIM", hr);
44-
}
45-
4642
public:
4743
// In some places we iterate over a list in order to generate output
4844
// for the list's elements. By exposing this we can avoid this
@@ -61,7 +57,7 @@ class G1HeapRegionPrinter : public AllStatic {
6157

6258
static void evac_failure(HeapRegion* hr) { print("EVAC-FAILURE", hr); }
6359

64-
static void mark_reclaim(FreeRegionList* free_list);
60+
static void mark_reclaim(HeapRegion* hr) { print("MARK-RECLAIM", hr); }
6561

6662
static void eager_reclaim(HeapRegion* hr) { print("EAGER-RECLAIM", hr); }
6763

‎src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ class G1FreeHumongousRegionClosure : public HeapRegionIndexClosure {
412412
_freed_bytes += r->used();
413413
r->set_containing_set(nullptr);
414414
_humongous_regions_reclaimed++;
415-
_g1h->free_humongous_region(r, nullptr);
416415
G1HeapRegionPrinter::eager_reclaim(r);
416+
_g1h->free_humongous_region(r, nullptr);
417417
};
418418

419419
_g1h->humongous_obj_regions_iterate(r, free_humongous_region);
@@ -759,9 +759,9 @@ class FreeCSetClosure : public HeapRegionClosure {
759759
assert(!r->is_empty(), "Region %u is an empty region in the collection set.", r->hrm_index());
760760
stats()->account_evacuated_region(r);
761761

762+
G1HeapRegionPrinter::evac_reclaim(r);
762763
// Free the region and its remembered set.
763764
_g1h->free_region(r, nullptr);
764-
G1HeapRegionPrinter::evac_reclaim(r);
765765
}
766766

767767
void handle_failed_region(HeapRegion* r) {

0 commit comments

Comments
 (0)