diff --git a/src/hotspot/share/gc/g1/g1Analytics.cpp b/src/hotspot/share/gc/g1/g1Analytics.cpp index f1d032061dc..5809bfa2b6c 100644 --- a/src/hotspot/share/gc/g1/g1Analytics.cpp +++ b/src/hotspot/share/gc/g1/g1Analytics.cpp @@ -83,7 +83,7 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) : _cost_per_code_root_ms_seq(TruncatedSeqLength), _cost_per_byte_copied_ms_seq(TruncatedSeqLength), _pending_cards_seq(TruncatedSeqLength), - _rs_length_seq(TruncatedSeqLength), + _card_rs_length_seq(TruncatedSeqLength), _code_root_rs_length_seq(TruncatedSeqLength), _constant_other_time_ms_seq(TruncatedSeqLength), _young_other_cost_per_region_ms_seq(TruncatedSeqLength), @@ -105,7 +105,7 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) : _card_scan_to_merge_ratio_seq.set_initial(young_card_scan_to_merge_ratio_defaults[index]); _cost_per_card_scan_ms_seq.set_initial(young_only_cost_per_card_scan_ms_defaults[index]); - _rs_length_seq.set_initial(0); + _card_rs_length_seq.set_initial(0); _code_root_rs_length_seq.set_initial(0); _cost_per_byte_copied_ms_seq.set_initial(cost_per_byte_ms_defaults[index]); @@ -217,8 +217,8 @@ void G1Analytics::report_pending_cards(double pending_cards, bool for_young_only _pending_cards_seq.add(pending_cards, for_young_only_phase); } -void G1Analytics::report_rs_length(double rs_length, bool for_young_only_phase) { - _rs_length_seq.add(rs_length, for_young_only_phase); +void G1Analytics::report_card_rs_length(double card_rs_length, bool for_young_only_phase) { + _card_rs_length_seq.add(card_rs_length, for_young_only_phase); } void G1Analytics::report_code_root_rs_length(double code_root_rs_length, bool for_young_only_phase) { @@ -245,8 +245,8 @@ size_t G1Analytics::predict_dirtied_cards_in_thread_buffers() const { return predict_size(&_dirtied_cards_in_thread_buffers_seq); } -size_t G1Analytics::predict_scan_card_num(size_t rs_length, bool for_young_only_phase) const { - return rs_length * predict_in_unit_interval(&_card_scan_to_merge_ratio_seq, for_young_only_phase); +size_t G1Analytics::predict_scan_card_num(size_t card_rs_length, bool for_young_only_phase) const { + return card_rs_length * predict_in_unit_interval(&_card_scan_to_merge_ratio_seq, for_young_only_phase); } double G1Analytics::predict_card_merge_time_ms(size_t card_num, bool for_young_only_phase) const { @@ -285,8 +285,8 @@ double G1Analytics::predict_cleanup_time_ms() const { return predict_zero_bounded(&_concurrent_mark_cleanup_times_ms); } -size_t G1Analytics::predict_rs_length(bool for_young_only_phase) const { - return predict_size(&_rs_length_seq, for_young_only_phase); +size_t G1Analytics::predict_card_rs_length(bool for_young_only_phase) const { + return predict_size(&_card_rs_length_seq, for_young_only_phase); } size_t G1Analytics::predict_code_root_rs_length(bool for_young_only_phase) const { diff --git a/src/hotspot/share/gc/g1/g1Analytics.hpp b/src/hotspot/share/gc/g1/g1Analytics.hpp index fa9bb59bb7a..d4c6463b486 100644 --- a/src/hotspot/share/gc/g1/g1Analytics.hpp +++ b/src/hotspot/share/gc/g1/g1Analytics.hpp @@ -63,7 +63,7 @@ class G1Analytics: public CHeapObj { G1PhaseDependentSeq _cost_per_byte_copied_ms_seq; G1PhaseDependentSeq _pending_cards_seq; - G1PhaseDependentSeq _rs_length_seq; + G1PhaseDependentSeq _card_rs_length_seq; G1PhaseDependentSeq _code_root_rs_length_seq; TruncatedSeq _constant_other_time_ms_seq; @@ -132,13 +132,12 @@ public: void report_cost_per_card_merge_ms(double cost_per_card_ms, bool for_young_only_phase); void report_cost_per_code_root_scan_ms(double cost_per_code_root_ms, bool for_young_only_phase); void report_card_scan_to_merge_ratio(double cards_per_entry_ratio, bool for_young_only_phase); - void report_rs_length_diff(double rs_length_diff, bool for_young_only_phase); void report_cost_per_byte_ms(double cost_per_byte_ms, bool for_young_only_phase); void report_young_other_cost_per_region_ms(double other_cost_per_region_ms); void report_non_young_other_cost_per_region_ms(double other_cost_per_region_ms); void report_constant_other_time_ms(double constant_other_time_ms); void report_pending_cards(double pending_cards, bool for_young_only_phase); - void report_rs_length(double rs_length, bool for_young_only_phase); + void report_card_rs_length(double card_rs_length, bool for_young_only_phase); void report_code_root_rs_length(double code_root_rs_length, bool for_young_only_phase); double predict_alloc_rate_ms() const; @@ -148,9 +147,9 @@ public: double predict_dirtied_cards_rate_ms() const; size_t predict_dirtied_cards_in_thread_buffers() const; - // Predict how many of the given remembered set of length rs_length will add to + // Predict how many of the given remembered set of length card_rs_length will add to // the number of total cards scanned. - size_t predict_scan_card_num(size_t rs_length, bool for_young_only_phase) const; + size_t predict_scan_card_num(size_t card_rs_length, bool for_young_only_phase) const; double predict_card_merge_time_ms(size_t card_num, bool for_young_only_phase) const; double predict_card_scan_time_ms(size_t card_num, bool for_young_only_phase) const; @@ -169,7 +168,7 @@ public: double predict_cleanup_time_ms() const; - size_t predict_rs_length(bool for_young_only_phase) const; + size_t predict_card_rs_length(bool for_young_only_phase) const; size_t predict_code_root_rs_length(bool for_young_only_phase) const; size_t predict_pending_cards(bool for_young_only_phase) const; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp index 9aab42afc45..aebdd2c43f5 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp @@ -279,21 +279,21 @@ uint64_t G1ConcurrentRefine::adjust_threads_wait_ms() const { class G1ConcurrentRefine::RemSetSamplingClosure : public HeapRegionClosure { G1CollectionSet* _cset; - size_t _sampled_rs_length; + size_t _sampled_card_rs_length; size_t _sampled_code_root_rs_length; public: explicit RemSetSamplingClosure(G1CollectionSet* cset) : - _cset(cset), _sampled_rs_length(0), _sampled_code_root_rs_length(0) {} + _cset(cset), _sampled_card_rs_length(0), _sampled_code_root_rs_length(0) {} bool do_heap_region(HeapRegion* r) override { HeapRegionRemSet* rem_set = r->rem_set(); - _sampled_rs_length += rem_set->occupied(); + _sampled_card_rs_length += rem_set->occupied(); _sampled_code_root_rs_length += rem_set->code_roots_list_length(); return false; } - size_t sampled_rs_length() const { return _sampled_rs_length; } + size_t sampled_card_rs_length() const { return _sampled_card_rs_length; } size_t sampled_code_root_rs_length() const { return _sampled_code_root_rs_length; } }; @@ -314,7 +314,7 @@ void G1ConcurrentRefine::adjust_young_list_target_length() { G1CollectionSet* cset = G1CollectedHeap::heap()->collection_set(); RemSetSamplingClosure cl{cset}; cset->iterate(&cl); - _policy->revise_young_list_target_length(cl.sampled_rs_length(), cl.sampled_code_root_rs_length()); + _policy->revise_young_list_target_length(cl.sampled_card_rs_length(), cl.sampled_code_root_rs_length()); } } diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp index 4990dd64217..33e8ad79754 100644 --- a/src/hotspot/share/gc/g1/g1Policy.cpp +++ b/src/hotspot/share/gc/g1/g1Policy.cpp @@ -70,7 +70,7 @@ G1Policy::G1Policy(STWGCTimer* gc_timer) : _reserve_regions(0), _young_gen_sizer(), _free_regions_at_end_of_collection(0), - _rs_length(0), + _card_rs_length(0), _pending_cards_at_gc_start(0), _concurrent_start_to_mixed(), _collection_set(nullptr), @@ -189,20 +189,20 @@ void G1Policy::update_young_length_bounds() { assert(!Universe::is_fully_initialized() || SafepointSynchronize::is_at_safepoint(), "must be"); bool for_young_only_phase = collector_state()->in_young_only_phase(); update_young_length_bounds(_analytics->predict_pending_cards(for_young_only_phase), - _analytics->predict_rs_length(for_young_only_phase), + _analytics->predict_card_rs_length(for_young_only_phase), _analytics->predict_code_root_rs_length(for_young_only_phase)); } -void G1Policy::update_young_length_bounds(size_t pending_cards, size_t rs_length, size_t code_root_rs_length) { +void G1Policy::update_young_length_bounds(size_t pending_cards, size_t card_rs_length, size_t code_root_rs_length) { uint old_young_list_target_length = young_list_target_length(); - uint new_young_list_desired_length = calculate_young_desired_length(pending_cards, rs_length, code_root_rs_length); + uint new_young_list_desired_length = calculate_young_desired_length(pending_cards, card_rs_length, code_root_rs_length); uint new_young_list_target_length = calculate_young_target_length(new_young_list_desired_length); uint new_young_list_max_length = calculate_young_max_length(new_young_list_target_length); - log_trace(gc, ergo, heap)("Young list length update: pending cards %zu rs_length %zu old target %u desired: %u target: %u max: %u", + log_trace(gc, ergo, heap)("Young list length update: pending cards %zu card_rs_length %zu old target %u desired: %u target: %u max: %u", pending_cards, - rs_length, + card_rs_length, old_young_list_target_length, new_young_list_desired_length, new_young_list_target_length, @@ -236,7 +236,7 @@ void G1Policy::update_young_length_bounds(size_t pending_cards, size_t rs_length // This return value is only an expectation. // uint G1Policy::calculate_young_desired_length(size_t pending_cards, - size_t rs_length, + size_t card_rs_length, size_t code_root_rs_length) const { uint min_young_length_by_sizer = _young_gen_sizer.min_desired_young_length(); uint max_young_length_by_sizer = _young_gen_sizer.max_desired_young_length(); @@ -270,7 +270,7 @@ uint G1Policy::calculate_young_desired_length(size_t pending_cards, if (use_adaptive_young_list_length()) { desired_eden_length_by_mmu = calculate_desired_eden_length_by_mmu(); - double base_time_ms = predict_base_time_ms(pending_cards, rs_length, code_root_rs_length); + double base_time_ms = predict_base_time_ms(pending_cards, card_rs_length, code_root_rs_length); double retained_time_ms = predict_retained_regions_evac_time(); double total_time_ms = base_time_ms + retained_time_ms; @@ -553,13 +553,13 @@ G1GCPhaseTimes* G1Policy::phase_times() const { return _phase_times; } -void G1Policy::revise_young_list_target_length(size_t rs_length, size_t code_root_rs_length) { +void G1Policy::revise_young_list_target_length(size_t card_rs_length, size_t code_root_rs_length) { guarantee(use_adaptive_young_list_length(), "should not call this otherwise" ); size_t thread_buffer_cards = _analytics->predict_dirtied_cards_in_thread_buffers(); G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set(); size_t pending_cards = dcqs.num_cards() + thread_buffer_cards; - update_young_length_bounds(pending_cards, rs_length, code_root_rs_length); + update_young_length_bounds(pending_cards, card_rs_length, code_root_rs_length); } void G1Policy::record_full_collection_start() { @@ -925,7 +925,7 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar _analytics->report_constant_other_time_ms(constant_other_time_ms(pause_time_ms)); _analytics->report_pending_cards((double)pending_cards_at_gc_start(), is_young_only_pause); - _analytics->report_rs_length((double)_rs_length, is_young_only_pause); + _analytics->report_card_rs_length((double)_card_rs_length, is_young_only_pause); _analytics->report_code_root_rs_length((double)total_code_roots_scanned, is_young_only_pause); } @@ -1048,16 +1048,16 @@ void G1Policy::record_young_gc_pause_end(bool evacuation_failed) { } double G1Policy::predict_base_time_ms(size_t pending_cards, - size_t rs_length, + size_t card_rs_length, size_t code_root_rs_length) const { bool in_young_only_phase = collector_state()->in_young_only_phase(); - size_t unique_cards_from_rs = _analytics->predict_scan_card_num(rs_length, in_young_only_phase); + size_t unique_cards_from_rs = _analytics->predict_scan_card_num(card_rs_length, in_young_only_phase); // Assume that all cards from the log buffers will be scanned, i.e. there are no // duplicates in that set. size_t effective_scanned_cards = unique_cards_from_rs + pending_cards; - double card_merge_time = _analytics->predict_card_merge_time_ms(pending_cards + rs_length, in_young_only_phase); + double card_merge_time = _analytics->predict_card_merge_time_ms(pending_cards + card_rs_length, in_young_only_phase); double card_scan_time = _analytics->predict_card_scan_time_ms(effective_scanned_cards, in_young_only_phase); double code_root_scan_time = _analytics->predict_code_root_scan_time_ms(code_root_rs_length, in_young_only_phase); double constant_other_time = _analytics->predict_constant_other_time_ms(); @@ -1065,10 +1065,10 @@ double G1Policy::predict_base_time_ms(size_t pending_cards, double total_time = card_merge_time + card_scan_time + code_root_scan_time + constant_other_time + survivor_evac_time; - log_trace(gc, ergo, heap)("Predicted base time: total %f lb_cards %zu rs_length %zu effective_scanned_cards %zu " + log_trace(gc, ergo, heap)("Predicted base time: total %f lb_cards %zu card_rs_length %zu effective_scanned_cards %zu " "card_merge_time %f card_scan_time %f code_root_rs_length %zu code_root_scan_time %f " "constant_other_time %f survivor_evac_time %f", - total_time, pending_cards, rs_length, effective_scanned_cards, + total_time, pending_cards, card_rs_length, effective_scanned_cards, card_merge_time, card_scan_time, code_root_rs_length, code_root_scan_time, constant_other_time, survivor_evac_time); return total_time; @@ -1076,9 +1076,9 @@ double G1Policy::predict_base_time_ms(size_t pending_cards, double G1Policy::predict_base_time_ms(size_t pending_cards) const { bool for_young_only_phase = collector_state()->in_young_only_phase(); - size_t rs_length = _analytics->predict_rs_length(for_young_only_phase); + size_t card_rs_length = _analytics->predict_card_rs_length(for_young_only_phase); size_t code_root_rs_length = _analytics->predict_code_root_rs_length(for_young_only_phase); - return predict_base_time_ms(pending_cards, rs_length, code_root_rs_length); + return predict_base_time_ms(pending_cards, card_rs_length, code_root_rs_length); } size_t G1Policy::predict_bytes_to_copy(HeapRegion* hr) const { @@ -1112,11 +1112,11 @@ double G1Policy::predict_region_copy_time_ms(HeapRegion* hr, bool for_young_only } double G1Policy::predict_region_merge_scan_time(HeapRegion* hr, bool for_young_only_phase) const { - size_t rs_length = hr->rem_set()->occupied(); - size_t scan_card_num = _analytics->predict_scan_card_num(rs_length, for_young_only_phase); + size_t card_rs_length = hr->rem_set()->occupied(); + size_t scan_card_num = _analytics->predict_scan_card_num(card_rs_length, for_young_only_phase); return - _analytics->predict_card_merge_time_ms(rs_length, for_young_only_phase) + + _analytics->predict_card_merge_time_ms(card_rs_length, for_young_only_phase) + _analytics->predict_card_scan_time_ms(scan_card_num, for_young_only_phase); } diff --git a/src/hotspot/share/gc/g1/g1Policy.hpp b/src/hotspot/share/gc/g1/g1Policy.hpp index e478f7ebcdb..7ecfc4dd2f7 100644 --- a/src/hotspot/share/gc/g1/g1Policy.hpp +++ b/src/hotspot/share/gc/g1/g1Policy.hpp @@ -103,7 +103,7 @@ class G1Policy: public CHeapObj { uint _free_regions_at_end_of_collection; - size_t _rs_length; + size_t _card_rs_length; size_t _pending_cards_at_gc_start; @@ -132,8 +132,8 @@ public: hr->install_surv_rate_group(_survivor_surv_rate_group); } - void record_rs_length(size_t rs_length) { - _rs_length = rs_length; + void record_card_rs_length(size_t card_rs_length) { + _card_rs_length = card_rs_length; } double predict_base_time_ms(size_t pending_cards) const; @@ -142,7 +142,7 @@ private: // Base time contains handling remembered sets and constant other time of the // whole young gen, refinement buffers, and copying survivors. // Basically everything but copying eden regions. - double predict_base_time_ms(size_t pending_cards, size_t rs_length, size_t code_root_length) const; + double predict_base_time_ms(size_t pending_cards, size_t card_rs_length, size_t code_root_length) const; // Copy time for a region is copying live data. double predict_region_copy_time_ms(HeapRegion* hr, bool for_young_only_phase) const; @@ -213,15 +213,14 @@ private: // If no parameters are passed, predict pending cards, card set remset length and // code root remset length using the prediction model. void update_young_length_bounds(); - void update_young_length_bounds(size_t pending_cards, size_t rs_length, size_t code_root_rs_length); + void update_young_length_bounds(size_t pending_cards, size_t card_rs_length, size_t code_root_rs_length); // Calculate and return the minimum desired eden length based on the MMU target. uint calculate_desired_eden_length_by_mmu() const; // Calculate the desired eden length meeting the pause time goal. - // The parameters are: rs_length represents the prediction of how large the - // young RSet lengths will be, min_eden_length and max_eden_length are the bounds - // (inclusive) within eden can grow. + // Min_eden_length and max_eden_length are the bounds + // (inclusive) within which eden can grow. uint calculate_desired_eden_length_by_pause(double base_time_ms, uint min_eden_length, uint max_eden_length) const; @@ -241,7 +240,7 @@ private: // Calculate desired young length based on current situation without taking actually // available free regions into account. - uint calculate_young_desired_length(size_t pending_cards, size_t rs_length, size_t code_root_rs_length) const; + uint calculate_young_desired_length(size_t pending_cards, size_t card_rs_length, size_t code_root_rs_length) const; // Limit the given desired young length to available free regions. uint calculate_young_target_length(uint desired_young_length) const; // The GCLocker might cause us to need more regions than the target. Calculate @@ -304,7 +303,7 @@ public: // Check the current value of the young list RSet length and // compare it against the last prediction. If the current value is // higher, recalculate the young list target length prediction. - void revise_young_list_target_length(size_t rs_length, size_t code_root_rs_length); + void revise_young_list_target_length(size_t card_rs_length, size_t code_root_rs_length); // This should be called after the heap is resized. void record_new_heap_size(uint new_number_of_regions); diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index 798e6f3c604..02820869148 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -434,7 +434,7 @@ class FreeCSetStats { size_t _bytes_allocated_in_old_since_last_gc; // Size of young regions turned into old size_t _failure_used_words; // Live size in failed regions size_t _failure_waste_words; // Wasted size in failed regions - size_t _rs_length; // Remembered set size + size_t _card_rs_length; // (Card Set) Remembered set size uint _regions_freed; // Number of regions freed public: @@ -444,7 +444,7 @@ public: _bytes_allocated_in_old_since_last_gc(0), _failure_used_words(0), _failure_waste_words(0), - _rs_length(0), + _card_rs_length(0), _regions_freed(0) { } void merge_stats(FreeCSetStats* other) { @@ -454,7 +454,7 @@ public: _bytes_allocated_in_old_since_last_gc += other->_bytes_allocated_in_old_since_last_gc; _failure_used_words += other->_failure_used_words; _failure_waste_words += other->_failure_waste_words; - _rs_length += other->_rs_length; + _card_rs_length += other->_card_rs_length; _regions_freed += other->_regions_freed; } @@ -468,7 +468,7 @@ public: G1Policy *policy = g1h->policy(); policy->old_gen_alloc_tracker()->add_allocated_bytes_since_last_gc(_bytes_allocated_in_old_since_last_gc); - policy->record_rs_length(_rs_length); + policy->record_card_rs_length(_card_rs_length); policy->cset_regions_freed(); } @@ -495,8 +495,8 @@ public: _regions_freed += 1; } - void account_rs_length(HeapRegion* r) { - _rs_length += r->rem_set()->occupied(); + void account_card_rs_length(HeapRegion* r) { + _card_rs_length += r->rem_set()->occupied(); } }; @@ -617,7 +617,7 @@ public: JFREventForRegion event(r, _worker_id); TimerForRegion timer(timer_for_region(r)); - stats()->account_rs_length(r); + stats()->account_card_rs_length(r); if (r->is_young()) { assert_tracks_surviving_words(r);