RFR: 8314100: G1: Improve collection set candidate selection code
Albert Mingkun Yang
ayang at openjdk.org
Fri Aug 11 14:25:35 UTC 2023
On Fri, 11 Aug 2023 07:36:23 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> discussions during review of [JDK-8140326](https://bugs.openjdk.org/browse/JDK-8140326) indicated that he code surrounding selecting candidates after marking/rebuild for the collection set could be improved.
>
> Testing: gha
>
> Thanks,
> Thomas
src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp line 161:
> 159: !G1CollectedHeap::heap()->is_old_gc_alloc_region(r) &&
> 160: G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes()) &&
> 161: r->rem_set()->is_complete();
Does this work?
assert(!r->rem_set()->is_updating(), "inv");
if (!r->rem_set()->is_complete()) {
return false;
}
if (G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes())) {
add_region(r);
} else {
r->rem_set()->clear(true /* only_cardset */);
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15243#discussion_r1291394499
More information about the hotspot-gc-dev
mailing list