--- a/src/hotspot/share/gc/g1/g1CollectionSet.hpp Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectionSet.hpp Thu Oct 17 20:53:35 2019 +0100
@@ -36,6 +36,7 @@
class G1Policy;
class G1SurvivorRegions;
class HeapRegion;
+class HeapRegionClaimer;
class HeapRegionClosure;
// The collection set.
@@ -163,7 +164,7 @@
// The number of cards in the remembered set in the collection set. Set from
// the incrementally built collection set at the start of an evacuation
// pause, and updated as more regions are added to the collection set.
- size_t _recorded_rs_lengths;
+ size_t _recorded_rs_length;
enum CSetBuildType {
Active, // We are actively building the collection set
@@ -187,25 +188,25 @@
// only one thread can be allocating a new CSet region (currently,
// it does so after taking the Heap_lock) hence no need to
// synchronize updates to this field.
- size_t _inc_recorded_rs_lengths;
+ size_t _inc_recorded_rs_length;
// A concurrent refinement thread periodically samples the young
- // region RSets and needs to update _inc_recorded_rs_lengths as
+ // region RSets and needs to update _inc_recorded_rs_length as
// the RSets grow. Instead of having to synchronize updates to that
// field we accumulate them in this field and add it to
- // _inc_recorded_rs_lengths_diffs at the start of a GC.
- ssize_t _inc_recorded_rs_lengths_diffs;
+ // _inc_recorded_rs_length_diff at the start of a GC.
+ ssize_t _inc_recorded_rs_length_diff;
// The predicted elapsed time it will take to collect the regions in
// the CSet. This is updated by the thread that adds a new region to
- // the CSet. See the comment for _inc_recorded_rs_lengths about
+ // the CSet. See the comment for _inc_recorded_rs_length about
// MT-safety assumptions.
double _inc_predicted_elapsed_time_ms;
- // See the comment for _inc_recorded_rs_lengths_diffs.
- double _inc_predicted_elapsed_time_ms_diffs;
+ // See the comment for _inc_recorded_rs_length_diff.
+ double _inc_predicted_elapsed_time_ms_diff;
- void set_recorded_rs_lengths(size_t rs_lengths);
+ void set_recorded_rs_length(size_t rs_length);
G1CollectorState* collector_state();
G1GCPhaseTimes* phase_times();
@@ -279,7 +280,12 @@
// Iterate over the current collection set increment applying the given HeapRegionClosure
// from a starting position determined by the given worker id.
- void iterate_incremental_part_from(HeapRegionClosure* cl, uint worker_id, uint total_workers) const;
+ void iterate_incremental_part_from(HeapRegionClosure* cl, HeapRegionClaimer* hr_claimer, uint worker_id, uint total_workers) const;
+
+ // Returns the length of the current increment in number of regions.
+ size_t increment_length() const { return _collection_set_cur_length - _inc_part_start; }
+ // Returns the length of the whole current collection set in number of regions
+ size_t cur_length() const { return _collection_set_cur_length; }
// Iterate over the entire collection set (all increments calculated so far), applying
// the given HeapRegionClosure on all of them.
@@ -287,7 +293,7 @@
void iterate_optional(HeapRegionClosure* cl) const;
- size_t recorded_rs_lengths() { return _recorded_rs_lengths; }
+ size_t recorded_rs_length() { return _recorded_rs_length; }
size_t bytes_used_before() const {
return _bytes_used_before;