Skip to content

Commit

Permalink
8331398: G1: G1HeapRegionPrinter reclamation events should print the …
Browse files Browse the repository at this point in the history
…original region type

Reviewed-by: ayang, iwalulya, gli
  • Loading branch information
Thomas Schatzl committed May 24, 2024
1 parent af056c1 commit a71b404
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
hr->set_containing_set(nullptr);
hr->clear_cardtable();
_g1h->concurrent_mark()->clear_statistics(hr);
G1HeapRegionPrinter::mark_reclaim(hr);
_g1h->free_humongous_region(hr, _local_cleanup_list);
};

Expand All @@ -1263,6 +1264,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
hr->set_containing_set(nullptr);
hr->clear_cardtable();
_g1h->concurrent_mark()->clear_statistics(hr);
G1HeapRegionPrinter::mark_reclaim(hr);
_g1h->free_region(hr, _local_cleanup_list);
}

Expand Down Expand Up @@ -1317,8 +1319,6 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
~G1UpdateRegionLivenessAndSelectForRebuildTask() {
if (!_cleanup_list.is_empty()) {
log_debug(gc)("Reclaimed %u empty regions", _cleanup_list.length());
// Now print the empty regions list.
G1HeapRegionPrinter::mark_reclaim(&_cleanup_list);
// And actually make them available.
_g1h->prepend_to_freelist(&_cleanup_list);
}
Expand Down
38 changes: 0 additions & 38 deletions src/hotspot/share/gc/g1/g1HeapRegionPrinter.cpp

This file was deleted.

6 changes: 1 addition & 5 deletions src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class G1HeapRegionPrinter : public AllStatic {
action, hr->get_type_str(), p2i(hr->bottom()), p2i(hr->top()), p2i(hr->end()));
}

static void mark_reclaim(HeapRegion* hr) {
print("MARK-RECLAIM", hr);
}

public:
// In some places we iterate over a list in order to generate output
// for the list's elements. By exposing this we can avoid this
Expand All @@ -61,7 +57,7 @@ class G1HeapRegionPrinter : public AllStatic {

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ class G1FreeHumongousRegionClosure : public HeapRegionIndexClosure {
_freed_bytes += r->used();
r->set_containing_set(nullptr);
_humongous_regions_reclaimed++;
_g1h->free_humongous_region(r, nullptr);
G1HeapRegionPrinter::eager_reclaim(r);
_g1h->free_humongous_region(r, nullptr);
};

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

G1HeapRegionPrinter::evac_reclaim(r);
// Free the region and its remembered set.
_g1h->free_region(r, nullptr);
G1HeapRegionPrinter::evac_reclaim(r);
}

void handle_failed_region(HeapRegion* r) {
Expand Down

1 comment on commit a71b404

@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.