--- old/src/hotspot/share/gc/g1/g1Analytics.cpp 2019-11-20 17:15:52.327618249 +0100 +++ new/src/hotspot/share/gc/g1/g1Analytics.cpp 2019-11-20 17:15:51.983607602 +0100 @@ -124,12 +124,16 @@ return seq->num() >= 3; } -double G1Analytics::get_new_prediction(TruncatedSeq const* seq) const { - return _predictor->get_new_prediction(seq); +double G1Analytics::get_new_unit_prediction(TruncatedSeq const* seq) const { + return _predictor->get_new_unit_prediction(seq); } size_t G1Analytics::get_new_size_prediction(TruncatedSeq const* seq) const { - return (size_t)get_new_prediction(seq); + return (size_t)get_new_lower_zero_bound_prediction(seq); +} + +double G1Analytics::get_new_lower_zero_bound_prediction(TruncatedSeq const* seq) const { + return _predictor->get_new_lower_zero_bound_prediction(seq); } int G1Analytics::num_alloc_rate_ms() const { @@ -232,50 +236,50 @@ } double G1Analytics::predict_alloc_rate_ms() const { - return get_new_prediction(_alloc_rate_ms_seq); + return get_new_lower_zero_bound_prediction(_alloc_rate_ms_seq); } double G1Analytics::predict_concurrent_refine_rate_ms() const { - return get_new_prediction(_concurrent_refine_rate_ms_seq); + return get_new_lower_zero_bound_prediction(_concurrent_refine_rate_ms_seq); } double G1Analytics::predict_logged_cards_rate_ms() const { - return get_new_prediction(_logged_cards_rate_ms_seq); + return get_new_lower_zero_bound_prediction(_logged_cards_rate_ms_seq); } double G1Analytics::predict_young_card_merge_to_scan_ratio() const { - return get_new_prediction(_young_card_merge_to_scan_ratio_seq); + return get_new_unit_prediction(_young_card_merge_to_scan_ratio_seq); } size_t G1Analytics::predict_scan_card_num(size_t rs_length, bool for_young_gc) const { if (for_young_gc || !enough_samples_available(_mixed_card_merge_to_scan_ratio_seq)) { - return (size_t) (rs_length * predict_young_card_merge_to_scan_ratio()); + return (size_t)(rs_length * predict_young_card_merge_to_scan_ratio()); } else { - return (size_t) (rs_length * get_new_prediction(_mixed_card_merge_to_scan_ratio_seq)); + return (size_t)(rs_length * get_new_unit_prediction(_mixed_card_merge_to_scan_ratio_seq)); } } double G1Analytics::predict_card_merge_time_ms(size_t card_num, bool for_young_gc) const { if (for_young_gc || !enough_samples_available(_mixed_cost_per_card_merge_ms_seq)) { - return card_num * get_new_prediction(_young_cost_per_card_merge_ms_seq); + return card_num * get_new_lower_zero_bound_prediction(_young_cost_per_card_merge_ms_seq); } else { - return card_num * get_new_prediction(_mixed_cost_per_card_merge_ms_seq); + return card_num * get_new_lower_zero_bound_prediction(_mixed_cost_per_card_merge_ms_seq); } } double G1Analytics::predict_card_scan_time_ms(size_t card_num, bool for_young_gc) const { if (for_young_gc || !enough_samples_available(_mixed_cost_per_card_scan_ms_seq)) { - return card_num * get_new_prediction(_young_cost_per_card_scan_ms_seq); + return card_num * get_new_lower_zero_bound_prediction(_young_cost_per_card_scan_ms_seq); } else { - return card_num * get_new_prediction(_mixed_cost_per_card_scan_ms_seq); + return card_num * get_new_lower_zero_bound_prediction(_mixed_cost_per_card_scan_ms_seq); } } double G1Analytics::predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) const { if (!enough_samples_available(_cost_per_byte_ms_during_cm_seq)) { - return (1.1 * bytes_to_copy) * get_new_prediction(_copy_cost_per_byte_ms_seq); + return (1.1 * bytes_to_copy) * get_new_lower_zero_bound_prediction(_copy_cost_per_byte_ms_seq); } else { - return bytes_to_copy * get_new_prediction(_cost_per_byte_ms_during_cm_seq); + return bytes_to_copy * get_new_lower_zero_bound_prediction(_cost_per_byte_ms_during_cm_seq); } } @@ -283,32 +287,32 @@ if (during_concurrent_mark) { return predict_object_copy_time_ms_during_cm(bytes_to_copy); } else { - return bytes_to_copy * get_new_prediction(_copy_cost_per_byte_ms_seq); + return bytes_to_copy * get_new_lower_zero_bound_prediction(_copy_cost_per_byte_ms_seq); } } double G1Analytics::predict_constant_other_time_ms() const { - return get_new_prediction(_constant_other_time_ms_seq); + return get_new_lower_zero_bound_prediction(_constant_other_time_ms_seq); } double G1Analytics::predict_young_other_time_ms(size_t young_num) const { - return young_num * get_new_prediction(_young_other_cost_per_region_ms_seq); + return young_num * get_new_lower_zero_bound_prediction(_young_other_cost_per_region_ms_seq); } double G1Analytics::predict_non_young_other_time_ms(size_t non_young_num) const { - return non_young_num * get_new_prediction(_non_young_other_cost_per_region_ms_seq); + return non_young_num * get_new_lower_zero_bound_prediction(_non_young_other_cost_per_region_ms_seq); } double G1Analytics::predict_remark_time_ms() const { - return get_new_prediction(_concurrent_mark_remark_times_ms); + return get_new_lower_zero_bound_prediction(_concurrent_mark_remark_times_ms); } double G1Analytics::predict_cleanup_time_ms() const { - return get_new_prediction(_concurrent_mark_cleanup_times_ms); + return get_new_lower_zero_bound_prediction(_concurrent_mark_cleanup_times_ms); } size_t G1Analytics::predict_rs_length() const { - return get_new_size_prediction(_rs_length_seq) + get_new_prediction(_rs_length_diff_seq); + return get_new_size_prediction(_rs_length_seq) + get_new_size_prediction(_rs_length_diff_seq); } size_t G1Analytics::predict_pending_cards() const {