Fri, 16 Dec 2011 02:14:27 -0500
7113012: G1: rename not-fully-young GCs as "mixed"
Summary: Renamed partially-young GCs as mixed and fully-young GCs as young. Change all external output that includes those terms (GC log and GC ergo log) as well as any comments, fields, methods, etc. The changeset also includes very minor code tidying up (added some curly brackets).
Reviewed-by: johnc, brutisso
1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Dec 14 17:43:55 2011 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Dec 16 02:14:27 2011 -0500 1.3 @@ -1294,7 +1294,7 @@ 1.4 g1_policy()->stop_incremental_cset_building(); 1.5 1.6 tear_down_region_sets(false /* free_list_only */); 1.7 - g1_policy()->set_full_young_gcs(true); 1.8 + g1_policy()->set_gcs_are_young(true); 1.9 1.10 // See the comments in g1CollectedHeap.hpp and 1.11 // G1CollectedHeap::ref_processing_init() about 1.12 @@ -3526,20 +3526,19 @@ 1.13 // for the duration of this pause. 1.14 g1_policy()->decide_on_conc_mark_initiation(); 1.15 1.16 - // We do not allow initial-mark to be piggy-backed on a 1.17 - // partially-young GC. 1.18 + // We do not allow initial-mark to be piggy-backed on a mixed GC. 1.19 assert(!g1_policy()->during_initial_mark_pause() || 1.20 - g1_policy()->full_young_gcs(), "sanity"); 1.21 - 1.22 - // We also do not allow partially-young GCs during marking. 1.23 - assert(!mark_in_progress() || g1_policy()->full_young_gcs(), "sanity"); 1.24 + g1_policy()->gcs_are_young(), "sanity"); 1.25 + 1.26 + // We also do not allow mixed GCs during marking. 1.27 + assert(!mark_in_progress() || g1_policy()->gcs_are_young(), "sanity"); 1.28 1.29 char verbose_str[128]; 1.30 sprintf(verbose_str, "GC pause "); 1.31 - if (g1_policy()->full_young_gcs()) { 1.32 + if (g1_policy()->gcs_are_young()) { 1.33 strcat(verbose_str, "(young)"); 1.34 } else { 1.35 - strcat(verbose_str, "(partial)"); 1.36 + strcat(verbose_str, "(mixed)"); 1.37 } 1.38 if (g1_policy()->during_initial_mark_pause()) { 1.39 strcat(verbose_str, " (initial-mark)");
2.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Wed Dec 14 17:43:55 2011 -0800 2.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Dec 16 02:14:27 2011 -0500 2.3 @@ -50,7 +50,7 @@ 2.4 }; 2.5 2.6 // all the same 2.7 -static double fully_young_cards_per_entry_ratio_defaults[] = { 2.8 +static double young_cards_per_entry_ratio_defaults[] = { 2.9 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 2.10 }; 2.11 2.12 @@ -168,11 +168,10 @@ 2.13 _pending_card_diff_seq(new TruncatedSeq(TruncatedSeqLength)), 2.14 _rs_length_diff_seq(new TruncatedSeq(TruncatedSeqLength)), 2.15 _cost_per_card_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.16 - _fully_young_cards_per_entry_ratio_seq(new TruncatedSeq(TruncatedSeqLength)), 2.17 - _partially_young_cards_per_entry_ratio_seq( 2.18 - new TruncatedSeq(TruncatedSeqLength)), 2.19 + _young_cards_per_entry_ratio_seq(new TruncatedSeq(TruncatedSeqLength)), 2.20 + _mixed_cards_per_entry_ratio_seq(new TruncatedSeq(TruncatedSeqLength)), 2.21 _cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.22 - _partially_young_cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.23 + _mixed_cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.24 _cost_per_byte_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.25 _cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)), 2.26 _constant_other_time_ms_seq(new TruncatedSeq(TruncatedSeqLength)), 2.27 @@ -185,9 +184,9 @@ 2.28 2.29 _pause_time_target_ms((double) MaxGCPauseMillis), 2.30 2.31 - _full_young_gcs(true), 2.32 - _full_young_pause_num(0), 2.33 - _partial_young_pause_num(0), 2.34 + _gcs_are_young(true), 2.35 + _young_pause_num(0), 2.36 + _mixed_pause_num(0), 2.37 2.38 _during_marking(false), 2.39 _in_marking_window(false), 2.40 @@ -198,7 +197,8 @@ 2.41 2.42 _young_gc_eff_seq(new TruncatedSeq(TruncatedSeqLength)), 2.43 2.44 - _recent_prev_end_times_for_all_gcs_sec(new TruncatedSeq(NumPrevPausesForHeuristics)), 2.45 + _recent_prev_end_times_for_all_gcs_sec( 2.46 + new TruncatedSeq(NumPrevPausesForHeuristics)), 2.47 2.48 _recent_avg_pause_time_ratio(0.0), 2.49 2.50 @@ -206,8 +206,9 @@ 2.51 2.52 _initiate_conc_mark_if_possible(false), 2.53 _during_initial_mark_pause(false), 2.54 - _should_revert_to_full_young_gcs(false), 2.55 - _last_full_young_gc(false), 2.56 + _should_revert_to_young_gcs(false), 2.57 + _last_young_gc(false), 2.58 + _last_gc_was_young(false), 2.59 2.60 _eden_bytes_before_gc(0), 2.61 _survivor_bytes_before_gc(0), 2.62 @@ -308,8 +309,8 @@ 2.63 _pending_card_diff_seq->add(0.0); 2.64 _rs_length_diff_seq->add(rs_length_diff_defaults[index]); 2.65 _cost_per_card_ms_seq->add(cost_per_card_ms_defaults[index]); 2.66 - _fully_young_cards_per_entry_ratio_seq->add( 2.67 - fully_young_cards_per_entry_ratio_defaults[index]); 2.68 + _young_cards_per_entry_ratio_seq->add( 2.69 + young_cards_per_entry_ratio_defaults[index]); 2.70 _cost_per_entry_ms_seq->add(cost_per_entry_ms_defaults[index]); 2.71 _cost_per_byte_ms_seq->add(cost_per_byte_ms_defaults[index]); 2.72 _constant_other_time_ms_seq->add(constant_other_time_ms_defaults[index]); 2.73 @@ -606,7 +607,7 @@ 2.74 2.75 size_t young_list_target_length = 0; 2.76 if (adaptive_young_list_length()) { 2.77 - if (full_young_gcs()) { 2.78 + if (gcs_are_young()) { 2.79 young_list_target_length = 2.80 calculate_young_list_target_length(rs_lengths, 2.81 base_min_length, 2.82 @@ -619,10 +620,10 @@ 2.83 // possible to maximize how many old regions we can add to it. 2.84 } 2.85 } else { 2.86 - if (full_young_gcs()) { 2.87 + if (gcs_are_young()) { 2.88 young_list_target_length = _young_list_fixed_length; 2.89 } else { 2.90 - // A bit arbitrary: during partially-young GCs we allocate half 2.91 + // A bit arbitrary: during mixed GCs we allocate half 2.92 // the young regions to try to add old regions to the CSet. 2.93 young_list_target_length = _young_list_fixed_length / 2; 2.94 // We choose to accept that we might go under the desired min 2.95 @@ -655,7 +656,7 @@ 2.96 size_t desired_min_length, 2.97 size_t desired_max_length) { 2.98 assert(adaptive_young_list_length(), "pre-condition"); 2.99 - assert(full_young_gcs(), "only call this for fully-young GCs"); 2.100 + assert(gcs_are_young(), "only call this for young GCs"); 2.101 2.102 // In case some edge-condition makes the desired max length too small... 2.103 if (desired_max_length <= desired_min_length) { 2.104 @@ -858,12 +859,11 @@ 2.105 2.106 _g1->clear_full_collection(); 2.107 2.108 - // "Nuke" the heuristics that control the fully/partially young GC 2.109 - // transitions and make sure we start with fully young GCs after the 2.110 - // Full GC. 2.111 - set_full_young_gcs(true); 2.112 - _last_full_young_gc = false; 2.113 - _should_revert_to_full_young_gcs = false; 2.114 + // "Nuke" the heuristics that control the young/mixed GC 2.115 + // transitions and make sure we start with young GCs after the Full GC. 2.116 + set_gcs_are_young(true); 2.117 + _last_young_gc = false; 2.118 + _should_revert_to_young_gcs = false; 2.119 clear_initiate_conc_mark_if_possible(); 2.120 clear_during_initial_mark_pause(); 2.121 _known_garbage_bytes = 0; 2.122 @@ -892,7 +892,7 @@ 2.123 if (PrintGCDetails) { 2.124 gclog_or_tty->stamp(PrintGCTimeStamps); 2.125 gclog_or_tty->print("[GC pause"); 2.126 - gclog_or_tty->print(" (%s)", full_young_gcs() ? "young" : "partial"); 2.127 + gclog_or_tty->print(" (%s)", gcs_are_young() ? "young" : "mixed"); 2.128 } 2.129 2.130 // We only need to do this here as the policy will only be applied 2.131 @@ -951,7 +951,7 @@ 2.132 // the evacuation pause if marking is in progress. 2.133 _cur_satb_drain_time_ms = 0.0; 2.134 2.135 - _last_young_gc_full = false; 2.136 + _last_gc_was_young = false; 2.137 2.138 // do that for any other surv rate groups 2.139 _short_lived_surv_rate_group->stop_adding_regions(); 2.140 @@ -988,8 +988,8 @@ 2.141 } 2.142 2.143 void G1CollectorPolicy::record_concurrent_mark_cleanup_completed() { 2.144 - _should_revert_to_full_young_gcs = false; 2.145 - _last_full_young_gc = true; 2.146 + _should_revert_to_young_gcs = false; 2.147 + _last_young_gc = true; 2.148 _in_marking_window = false; 2.149 } 2.150 2.151 @@ -1153,7 +1153,7 @@ 2.152 size_t marking_initiating_used_threshold = 2.153 (_g1->capacity() / 100) * InitiatingHeapOccupancyPercent; 2.154 2.155 - if (!_g1->mark_in_progress() && !_last_full_young_gc) { 2.156 + if (!_g1->mark_in_progress() && !_last_young_gc) { 2.157 assert(!last_pause_included_initial_mark, "invariant"); 2.158 if (cur_used_bytes > marking_initiating_used_threshold) { 2.159 if (cur_used_bytes > _prev_collection_pause_used_at_end_bytes) { 2.160 @@ -1458,57 +1458,57 @@ 2.161 new_in_marking_window_im = true; 2.162 } 2.163 2.164 - if (_last_full_young_gc) { 2.165 + if (_last_young_gc) { 2.166 if (!last_pause_included_initial_mark) { 2.167 - ergo_verbose2(ErgoPartiallyYoungGCs, 2.168 - "start partially-young GCs", 2.169 + ergo_verbose2(ErgoMixedGCs, 2.170 + "start mixed GCs", 2.171 ergo_format_byte_perc("known garbage"), 2.172 _known_garbage_bytes, _known_garbage_ratio * 100.0); 2.173 - set_full_young_gcs(false); 2.174 + set_gcs_are_young(false); 2.175 } else { 2.176 - ergo_verbose0(ErgoPartiallyYoungGCs, 2.177 - "do not start partially-young GCs", 2.178 + ergo_verbose0(ErgoMixedGCs, 2.179 + "do not start mixed GCs", 2.180 ergo_format_reason("concurrent cycle is about to start")); 2.181 } 2.182 - _last_full_young_gc = false; 2.183 + _last_young_gc = false; 2.184 } 2.185 2.186 - if ( !_last_young_gc_full ) { 2.187 - if (_should_revert_to_full_young_gcs) { 2.188 - ergo_verbose2(ErgoPartiallyYoungGCs, 2.189 - "end partially-young GCs", 2.190 - ergo_format_reason("partially-young GCs end requested") 2.191 + if (!_last_gc_was_young) { 2.192 + if (_should_revert_to_young_gcs) { 2.193 + ergo_verbose2(ErgoMixedGCs, 2.194 + "end mixed GCs", 2.195 + ergo_format_reason("mixed GCs end requested") 2.196 ergo_format_byte_perc("known garbage"), 2.197 _known_garbage_bytes, _known_garbage_ratio * 100.0); 2.198 - set_full_young_gcs(true); 2.199 + set_gcs_are_young(true); 2.200 } else if (_known_garbage_ratio < 0.05) { 2.201 - ergo_verbose3(ErgoPartiallyYoungGCs, 2.202 - "end partially-young GCs", 2.203 + ergo_verbose3(ErgoMixedGCs, 2.204 + "end mixed GCs", 2.205 ergo_format_reason("known garbage percent lower than threshold") 2.206 ergo_format_byte_perc("known garbage") 2.207 ergo_format_perc("threshold"), 2.208 _known_garbage_bytes, _known_garbage_ratio * 100.0, 2.209 0.05 * 100.0); 2.210 - set_full_young_gcs(true); 2.211 + set_gcs_are_young(true); 2.212 } else if (adaptive_young_list_length() && 2.213 (get_gc_eff_factor() * cur_efficiency < predict_young_gc_eff())) { 2.214 - ergo_verbose5(ErgoPartiallyYoungGCs, 2.215 - "end partially-young GCs", 2.216 + ergo_verbose5(ErgoMixedGCs, 2.217 + "end mixed GCs", 2.218 ergo_format_reason("current GC efficiency lower than " 2.219 - "predicted fully-young GC efficiency") 2.220 + "predicted young GC efficiency") 2.221 ergo_format_double("GC efficiency factor") 2.222 ergo_format_double("current GC efficiency") 2.223 - ergo_format_double("predicted fully-young GC efficiency") 2.224 + ergo_format_double("predicted young GC efficiency") 2.225 ergo_format_byte_perc("known garbage"), 2.226 get_gc_eff_factor(), cur_efficiency, 2.227 predict_young_gc_eff(), 2.228 _known_garbage_bytes, _known_garbage_ratio * 100.0); 2.229 - set_full_young_gcs(true); 2.230 + set_gcs_are_young(true); 2.231 } 2.232 } 2.233 - _should_revert_to_full_young_gcs = false; 2.234 - 2.235 - if (_last_young_gc_full && !_during_marking) { 2.236 + _should_revert_to_young_gcs = false; 2.237 + 2.238 + if (_last_gc_was_young && !_during_marking) { 2.239 _young_gc_eff_seq->add(cur_efficiency); 2.240 } 2.241 2.242 @@ -1534,19 +1534,21 @@ 2.243 double cost_per_entry_ms = 0.0; 2.244 if (cards_scanned > 10) { 2.245 cost_per_entry_ms = scan_rs_time / (double) cards_scanned; 2.246 - if (_last_young_gc_full) 2.247 + if (_last_gc_was_young) { 2.248 _cost_per_entry_ms_seq->add(cost_per_entry_ms); 2.249 - else 2.250 - _partially_young_cost_per_entry_ms_seq->add(cost_per_entry_ms); 2.251 + } else { 2.252 + _mixed_cost_per_entry_ms_seq->add(cost_per_entry_ms); 2.253 + } 2.254 } 2.255 2.256 if (_max_rs_lengths > 0) { 2.257 double cards_per_entry_ratio = 2.258 (double) cards_scanned / (double) _max_rs_lengths; 2.259 - if (_last_young_gc_full) 2.260 - _fully_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 2.261 - else 2.262 - _partially_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 2.263 + if (_last_gc_was_young) { 2.264 + _young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 2.265 + } else { 2.266 + _mixed_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 2.267 + } 2.268 } 2.269 2.270 // It turns out that, sometimes, _max_rs_lengths can get smaller 2.271 @@ -1563,10 +1565,11 @@ 2.272 double cost_per_byte_ms = 0.0; 2.273 if (copied_bytes > 0) { 2.274 cost_per_byte_ms = obj_copy_time / (double) copied_bytes; 2.275 - if (_in_marking_window) 2.276 + if (_in_marking_window) { 2.277 _cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms); 2.278 - else 2.279 + } else { 2.280 _cost_per_byte_ms_seq->add(cost_per_byte_ms); 2.281 + } 2.282 } 2.283 2.284 double all_other_time_ms = pause_time_ms - 2.285 @@ -1722,10 +1725,11 @@ 2.286 size_t rs_lengths = g1h->young_list()->sampled_rs_lengths() + 2.287 predict_rs_length_diff(); 2.288 size_t card_num; 2.289 - if (full_young_gcs()) 2.290 + if (gcs_are_young()) { 2.291 card_num = predict_young_card_num(rs_lengths); 2.292 - else 2.293 + } else { 2.294 card_num = predict_non_young_card_num(rs_lengths); 2.295 + } 2.296 size_t young_byte_size = young_num * HeapRegion::GrainBytes; 2.297 double accum_yg_surv_rate = 2.298 _short_lived_surv_rate_group->accum_surv_rate(adjustment); 2.299 @@ -1745,10 +1749,11 @@ 2.300 G1CollectorPolicy::predict_base_elapsed_time_ms(size_t pending_cards) { 2.301 size_t rs_length = predict_rs_length_diff(); 2.302 size_t card_num; 2.303 - if (full_young_gcs()) 2.304 + if (gcs_are_young()) { 2.305 card_num = predict_young_card_num(rs_length); 2.306 - else 2.307 + } else { 2.308 card_num = predict_non_young_card_num(rs_length); 2.309 + } 2.310 return predict_base_elapsed_time_ms(pending_cards, card_num); 2.311 } 2.312 2.313 @@ -1766,10 +1771,11 @@ 2.314 bool young) { 2.315 size_t rs_length = hr->rem_set()->occupied(); 2.316 size_t card_num; 2.317 - if (full_young_gcs()) 2.318 + if (gcs_are_young()) { 2.319 card_num = predict_young_card_num(rs_length); 2.320 - else 2.321 + } else { 2.322 card_num = predict_non_young_card_num(rs_length); 2.323 + } 2.324 size_t bytes_to_copy = predict_bytes_to_copy(hr); 2.325 2.326 double region_elapsed_time_ms = 2.327 @@ -1817,14 +1823,14 @@ 2.328 // I don't think we need to do this when in young GC mode since 2.329 // marking will be initiated next time we hit the soft limit anyway... 2.330 if (predicted_time_ms > _expensive_region_limit_ms) { 2.331 - ergo_verbose2(ErgoPartiallyYoungGCs, 2.332 - "request partially-young GCs end", 2.333 + ergo_verbose2(ErgoMixedGCs, 2.334 + "request mixed GCs end", 2.335 ergo_format_reason("predicted region time higher than threshold") 2.336 ergo_format_ms("predicted region time") 2.337 ergo_format_ms("threshold"), 2.338 predicted_time_ms, _expensive_region_limit_ms); 2.339 - // no point in doing another partial one 2.340 - _should_revert_to_full_young_gcs = true; 2.341 + // no point in doing another mixed GC 2.342 + _should_revert_to_young_gcs = true; 2.343 } 2.344 } 2.345 2.346 @@ -2033,8 +2039,8 @@ 2.347 print_summary_sd(0, "Total", _all_pause_times_ms); 2.348 gclog_or_tty->print_cr(""); 2.349 gclog_or_tty->print_cr(""); 2.350 - gclog_or_tty->print_cr(" Full Young GC Pauses: %8d", _full_young_pause_num); 2.351 - gclog_or_tty->print_cr(" Partial Young GC Pauses: %8d", _partial_young_pause_num); 2.352 + gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); 2.353 + gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); 2.354 gclog_or_tty->print_cr(""); 2.355 2.356 gclog_or_tty->print_cr("EVACUATION PAUSES"); 2.357 @@ -2188,11 +2194,11 @@ 2.358 // initiate a new cycle. 2.359 2.360 set_during_initial_mark_pause(); 2.361 - // We do not allow non-full young GCs during marking. 2.362 - if (!full_young_gcs()) { 2.363 - set_full_young_gcs(true); 2.364 - ergo_verbose0(ErgoPartiallyYoungGCs, 2.365 - "end partially-young GCs", 2.366 + // We do not allow mixed GCs during marking. 2.367 + if (!gcs_are_young()) { 2.368 + set_gcs_are_young(true); 2.369 + ergo_verbose0(ErgoMixedGCs, 2.370 + "end mixed GCs", 2.371 ergo_format_reason("concurrent cycle is about to start")); 2.372 } 2.373 2.374 @@ -2623,12 +2629,12 @@ 2.375 double young_start_time_sec = os::elapsedTime(); 2.376 2.377 _collection_set_bytes_used_before = 0; 2.378 - _last_young_gc_full = full_young_gcs() ? true : false; 2.379 - 2.380 - if (_last_young_gc_full) { 2.381 - ++_full_young_pause_num; 2.382 + _last_gc_was_young = gcs_are_young() ? true : false; 2.383 + 2.384 + if (_last_gc_was_young) { 2.385 + ++_young_pause_num; 2.386 } else { 2.387 - ++_partial_young_pause_num; 2.388 + ++_mixed_pause_num; 2.389 } 2.390 2.391 // The young list is laid with the survivor regions from the previous 2.392 @@ -2675,7 +2681,7 @@ 2.393 // We are doing young collections so reset this. 2.394 non_young_start_time_sec = young_end_time_sec; 2.395 2.396 - if (!full_young_gcs()) { 2.397 + if (!gcs_are_young()) { 2.398 bool should_continue = true; 2.399 NumberSeq seq; 2.400 double avg_prediction = 100000000000000000.0; // something very large 2.401 @@ -2732,14 +2738,14 @@ 2.402 } while (should_continue); 2.403 2.404 if (!adaptive_young_list_length() && 2.405 - cset_region_length() < _young_list_fixed_length) { 2.406 + cset_region_length() < _young_list_fixed_length) { 2.407 ergo_verbose2(ErgoCSetConstruction, 2.408 - "request partially-young GCs end", 2.409 + "request mixed GCs end", 2.410 ergo_format_reason("CSet length lower than target") 2.411 ergo_format_region("CSet") 2.412 ergo_format_region("young target"), 2.413 cset_region_length(), _young_list_fixed_length); 2.414 - _should_revert_to_full_young_gcs = true; 2.415 + _should_revert_to_young_gcs = true; 2.416 } 2.417 2.418 ergo_verbose2(ErgoCSetConstruction | ErgoHigh,
3.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Wed Dec 14 17:43:55 2011 -0800 3.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Dec 16 02:14:27 2011 -0500 3.3 @@ -164,8 +164,8 @@ 3.4 // times for a given worker thread. 3.5 double* _par_last_gc_worker_other_times_ms; 3.6 3.7 - // indicates whether we are in full young or partially young GC mode 3.8 - bool _full_young_gcs; 3.9 + // indicates whether we are in young or mixed GC mode 3.10 + bool _gcs_are_young; 3.11 3.12 // if true, then it tries to dynamically adjust the length of the 3.13 // young list 3.14 @@ -178,10 +178,10 @@ 3.15 // locker is active. This should be >= _young_list_target_length; 3.16 size_t _young_list_max_length; 3.17 3.18 - bool _last_young_gc_full; 3.19 + bool _last_gc_was_young; 3.20 3.21 - unsigned _full_young_pause_num; 3.22 - unsigned _partial_young_pause_num; 3.23 + unsigned _young_pause_num; 3.24 + unsigned _mixed_pause_num; 3.25 3.26 bool _during_marking; 3.27 bool _in_marking_window; 3.28 @@ -211,10 +211,10 @@ 3.29 TruncatedSeq* _pending_card_diff_seq; 3.30 TruncatedSeq* _rs_length_diff_seq; 3.31 TruncatedSeq* _cost_per_card_ms_seq; 3.32 - TruncatedSeq* _fully_young_cards_per_entry_ratio_seq; 3.33 - TruncatedSeq* _partially_young_cards_per_entry_ratio_seq; 3.34 + TruncatedSeq* _young_cards_per_entry_ratio_seq; 3.35 + TruncatedSeq* _mixed_cards_per_entry_ratio_seq; 3.36 TruncatedSeq* _cost_per_entry_ms_seq; 3.37 - TruncatedSeq* _partially_young_cost_per_entry_ms_seq; 3.38 + TruncatedSeq* _mixed_cost_per_entry_ms_seq; 3.39 TruncatedSeq* _cost_per_byte_ms_seq; 3.40 TruncatedSeq* _constant_other_time_ms_seq; 3.41 TruncatedSeq* _young_other_cost_per_region_ms_seq; 3.42 @@ -322,20 +322,22 @@ 3.43 3.44 size_t predict_pending_card_diff() { 3.45 double prediction = get_new_neg_prediction(_pending_card_diff_seq); 3.46 - if (prediction < 0.00001) 3.47 + if (prediction < 0.00001) { 3.48 return 0; 3.49 - else 3.50 + } else { 3.51 return (size_t) prediction; 3.52 + } 3.53 } 3.54 3.55 size_t predict_pending_cards() { 3.56 size_t max_pending_card_num = _g1->max_pending_card_num(); 3.57 size_t diff = predict_pending_card_diff(); 3.58 size_t prediction; 3.59 - if (diff > max_pending_card_num) 3.60 + if (diff > max_pending_card_num) { 3.61 prediction = max_pending_card_num; 3.62 - else 3.63 + } else { 3.64 prediction = max_pending_card_num - diff; 3.65 + } 3.66 3.67 return prediction; 3.68 } 3.69 @@ -356,57 +358,62 @@ 3.70 return (double) pending_cards * predict_cost_per_card_ms(); 3.71 } 3.72 3.73 - double predict_fully_young_cards_per_entry_ratio() { 3.74 - return get_new_prediction(_fully_young_cards_per_entry_ratio_seq); 3.75 + double predict_young_cards_per_entry_ratio() { 3.76 + return get_new_prediction(_young_cards_per_entry_ratio_seq); 3.77 } 3.78 3.79 - double predict_partially_young_cards_per_entry_ratio() { 3.80 - if (_partially_young_cards_per_entry_ratio_seq->num() < 2) 3.81 - return predict_fully_young_cards_per_entry_ratio(); 3.82 - else 3.83 - return get_new_prediction(_partially_young_cards_per_entry_ratio_seq); 3.84 + double predict_mixed_cards_per_entry_ratio() { 3.85 + if (_mixed_cards_per_entry_ratio_seq->num() < 2) { 3.86 + return predict_young_cards_per_entry_ratio(); 3.87 + } else { 3.88 + return get_new_prediction(_mixed_cards_per_entry_ratio_seq); 3.89 + } 3.90 } 3.91 3.92 size_t predict_young_card_num(size_t rs_length) { 3.93 return (size_t) ((double) rs_length * 3.94 - predict_fully_young_cards_per_entry_ratio()); 3.95 + predict_young_cards_per_entry_ratio()); 3.96 } 3.97 3.98 size_t predict_non_young_card_num(size_t rs_length) { 3.99 return (size_t) ((double) rs_length * 3.100 - predict_partially_young_cards_per_entry_ratio()); 3.101 + predict_mixed_cards_per_entry_ratio()); 3.102 } 3.103 3.104 double predict_rs_scan_time_ms(size_t card_num) { 3.105 - if (full_young_gcs()) 3.106 + if (gcs_are_young()) { 3.107 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq); 3.108 - else 3.109 - return predict_partially_young_rs_scan_time_ms(card_num); 3.110 + } else { 3.111 + return predict_mixed_rs_scan_time_ms(card_num); 3.112 + } 3.113 } 3.114 3.115 - double predict_partially_young_rs_scan_time_ms(size_t card_num) { 3.116 - if (_partially_young_cost_per_entry_ms_seq->num() < 3) 3.117 + double predict_mixed_rs_scan_time_ms(size_t card_num) { 3.118 + if (_mixed_cost_per_entry_ms_seq->num() < 3) { 3.119 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq); 3.120 - else 3.121 - return (double) card_num * 3.122 - get_new_prediction(_partially_young_cost_per_entry_ms_seq); 3.123 + } else { 3.124 + return (double) (card_num * 3.125 + get_new_prediction(_mixed_cost_per_entry_ms_seq)); 3.126 + } 3.127 } 3.128 3.129 double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) { 3.130 - if (_cost_per_byte_ms_during_cm_seq->num() < 3) 3.131 - return 1.1 * (double) bytes_to_copy * 3.132 - get_new_prediction(_cost_per_byte_ms_seq); 3.133 - else 3.134 + if (_cost_per_byte_ms_during_cm_seq->num() < 3) { 3.135 + return (1.1 * (double) bytes_to_copy) * 3.136 + get_new_prediction(_cost_per_byte_ms_seq); 3.137 + } else { 3.138 return (double) bytes_to_copy * 3.139 - get_new_prediction(_cost_per_byte_ms_during_cm_seq); 3.140 + get_new_prediction(_cost_per_byte_ms_during_cm_seq); 3.141 + } 3.142 } 3.143 3.144 double predict_object_copy_time_ms(size_t bytes_to_copy) { 3.145 - if (_in_marking_window && !_in_marking_window_im) 3.146 + if (_in_marking_window && !_in_marking_window_im) { 3.147 return predict_object_copy_time_ms_during_cm(bytes_to_copy); 3.148 - else 3.149 + } else { 3.150 return (double) bytes_to_copy * 3.151 - get_new_prediction(_cost_per_byte_ms_seq); 3.152 + get_new_prediction(_cost_per_byte_ms_seq); 3.153 + } 3.154 } 3.155 3.156 double predict_constant_other_time_ms() { 3.157 @@ -414,15 +421,13 @@ 3.158 } 3.159 3.160 double predict_young_other_time_ms(size_t young_num) { 3.161 - return 3.162 - (double) young_num * 3.163 - get_new_prediction(_young_other_cost_per_region_ms_seq); 3.164 + return (double) young_num * 3.165 + get_new_prediction(_young_other_cost_per_region_ms_seq); 3.166 } 3.167 3.168 double predict_non_young_other_time_ms(size_t non_young_num) { 3.169 - return 3.170 - (double) non_young_num * 3.171 - get_new_prediction(_non_young_other_cost_per_region_ms_seq); 3.172 + return (double) non_young_num * 3.173 + get_new_prediction(_non_young_other_cost_per_region_ms_seq); 3.174 } 3.175 3.176 void check_if_region_is_too_expensive(double predicted_time_ms); 3.177 @@ -456,7 +461,7 @@ 3.178 double predict_survivor_regions_evac_time(); 3.179 3.180 void cset_regions_freed() { 3.181 - bool propagate = _last_young_gc_full && !_in_marking_window; 3.182 + bool propagate = _last_gc_was_young && !_in_marking_window; 3.183 _short_lived_surv_rate_group->all_surviving_words_recorded(propagate); 3.184 _survivor_surv_rate_group->all_surviving_words_recorded(propagate); 3.185 // also call it on any more surv rate groups 3.186 @@ -628,8 +633,8 @@ 3.187 // initial-mark work. 3.188 volatile bool _during_initial_mark_pause; 3.189 3.190 - bool _should_revert_to_full_young_gcs; 3.191 - bool _last_full_young_gc; 3.192 + bool _should_revert_to_young_gcs; 3.193 + bool _last_young_gc; 3.194 3.195 // This set of variables tracks the collector efficiency, in order to 3.196 // determine whether we should initiate a new marking. 3.197 @@ -985,11 +990,11 @@ 3.198 return _young_list_max_length; 3.199 } 3.200 3.201 - bool full_young_gcs() { 3.202 - return _full_young_gcs; 3.203 + bool gcs_are_young() { 3.204 + return _gcs_are_young; 3.205 } 3.206 - void set_full_young_gcs(bool full_young_gcs) { 3.207 - _full_young_gcs = full_young_gcs; 3.208 + void set_gcs_are_young(bool gcs_are_young) { 3.209 + _gcs_are_young = gcs_are_young; 3.210 } 3.211 3.212 bool adaptive_young_list_length() {
4.1 --- a/src/share/vm/gc_implementation/g1/g1ErgoVerbose.cpp Wed Dec 14 17:43:55 2011 -0800 4.2 +++ b/src/share/vm/gc_implementation/g1/g1ErgoVerbose.cpp Fri Dec 16 02:14:27 2011 -0500 4.3 @@ -52,14 +52,13 @@ 4.4 const char* G1ErgoVerbose::to_string(int tag) { 4.5 ErgoHeuristic n = extract_heuristic(tag); 4.6 switch (n) { 4.7 - case ErgoHeapSizing: return "Heap Sizing"; 4.8 - case ErgoCSetConstruction: return "CSet Construction"; 4.9 - case ErgoConcCycles: return "Concurrent Cycles"; 4.10 - case ErgoPartiallyYoungGCs: return "Partially-Young GCs"; 4.11 + case ErgoHeapSizing: return "Heap Sizing"; 4.12 + case ErgoCSetConstruction: return "CSet Construction"; 4.13 + case ErgoConcCycles: return "Concurrent Cycles"; 4.14 + case ErgoMixedGCs: return "Mixed GCs"; 4.15 default: 4.16 ShouldNotReachHere(); 4.17 // Keep the Windows compiler happy 4.18 return NULL; 4.19 } 4.20 } 4.21 -
5.1 --- a/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp Wed Dec 14 17:43:55 2011 -0800 5.2 +++ b/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp Fri Dec 16 02:14:27 2011 -0500 5.3 @@ -69,7 +69,7 @@ 5.4 ErgoHeapSizing = 0, 5.5 ErgoCSetConstruction, 5.6 ErgoConcCycles, 5.7 - ErgoPartiallyYoungGCs, 5.8 + ErgoMixedGCs, 5.9 5.10 ErgoHeuristicNum 5.11 } ErgoHeuristic;
6.1 --- a/src/share/vm/gc_implementation/g1/g1MonitoringSupport.hpp Wed Dec 14 17:43:55 2011 -0800 6.2 +++ b/src/share/vm/gc_implementation/g1/g1MonitoringSupport.hpp Fri Dec 16 02:14:27 2011 -0500 6.3 @@ -119,7 +119,7 @@ 6.4 G1CollectedHeap* _g1h; 6.5 6.6 // jstat performance counters 6.7 - // incremental collections both fully and partially young 6.8 + // incremental collections both young and mixed 6.9 CollectorCounters* _incremental_collection_counters; 6.10 // full stop-the-world collections 6.11 CollectorCounters* _full_collection_counters;