comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @ 4710:41406797186b

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
author tonyp
date Fri, 16 Dec 2011 02:14:27 -0500
parents dc467e8b2c5e
children 67fdcb391461
comparison
equal deleted inserted replaced
4709:fd2b426c30db 4710:41406797186b
162 // Each workers 'other' time i.e. the elapsed time of the parallel 162 // Each workers 'other' time i.e. the elapsed time of the parallel
163 // phase of the pause minus the sum of the individual sub-phase 163 // phase of the pause minus the sum of the individual sub-phase
164 // times for a given worker thread. 164 // times for a given worker thread.
165 double* _par_last_gc_worker_other_times_ms; 165 double* _par_last_gc_worker_other_times_ms;
166 166
167 // indicates whether we are in full young or partially young GC mode 167 // indicates whether we are in young or mixed GC mode
168 bool _full_young_gcs; 168 bool _gcs_are_young;
169 169
170 // if true, then it tries to dynamically adjust the length of the 170 // if true, then it tries to dynamically adjust the length of the
171 // young list 171 // young list
172 bool _adaptive_young_list_length; 172 bool _adaptive_young_list_length;
173 size_t _young_list_target_length; 173 size_t _young_list_target_length;
176 176
177 // The max number of regions we can extend the eden by while the GC 177 // The max number of regions we can extend the eden by while the GC
178 // locker is active. This should be >= _young_list_target_length; 178 // locker is active. This should be >= _young_list_target_length;
179 size_t _young_list_max_length; 179 size_t _young_list_max_length;
180 180
181 bool _last_young_gc_full; 181 bool _last_gc_was_young;
182 182
183 unsigned _full_young_pause_num; 183 unsigned _young_pause_num;
184 unsigned _partial_young_pause_num; 184 unsigned _mixed_pause_num;
185 185
186 bool _during_marking; 186 bool _during_marking;
187 bool _in_marking_window; 187 bool _in_marking_window;
188 bool _in_marking_window_im; 188 bool _in_marking_window_im;
189 189
209 double _prev_collection_pause_end_ms; 209 double _prev_collection_pause_end_ms;
210 210
211 TruncatedSeq* _pending_card_diff_seq; 211 TruncatedSeq* _pending_card_diff_seq;
212 TruncatedSeq* _rs_length_diff_seq; 212 TruncatedSeq* _rs_length_diff_seq;
213 TruncatedSeq* _cost_per_card_ms_seq; 213 TruncatedSeq* _cost_per_card_ms_seq;
214 TruncatedSeq* _fully_young_cards_per_entry_ratio_seq; 214 TruncatedSeq* _young_cards_per_entry_ratio_seq;
215 TruncatedSeq* _partially_young_cards_per_entry_ratio_seq; 215 TruncatedSeq* _mixed_cards_per_entry_ratio_seq;
216 TruncatedSeq* _cost_per_entry_ms_seq; 216 TruncatedSeq* _cost_per_entry_ms_seq;
217 TruncatedSeq* _partially_young_cost_per_entry_ms_seq; 217 TruncatedSeq* _mixed_cost_per_entry_ms_seq;
218 TruncatedSeq* _cost_per_byte_ms_seq; 218 TruncatedSeq* _cost_per_byte_ms_seq;
219 TruncatedSeq* _constant_other_time_ms_seq; 219 TruncatedSeq* _constant_other_time_ms_seq;
220 TruncatedSeq* _young_other_cost_per_region_ms_seq; 220 TruncatedSeq* _young_other_cost_per_region_ms_seq;
221 TruncatedSeq* _non_young_other_cost_per_region_ms_seq; 221 TruncatedSeq* _non_young_other_cost_per_region_ms_seq;
222 222
320 _max_rs_lengths = rs_lengths; 320 _max_rs_lengths = rs_lengths;
321 } 321 }
322 322
323 size_t predict_pending_card_diff() { 323 size_t predict_pending_card_diff() {
324 double prediction = get_new_neg_prediction(_pending_card_diff_seq); 324 double prediction = get_new_neg_prediction(_pending_card_diff_seq);
325 if (prediction < 0.00001) 325 if (prediction < 0.00001) {
326 return 0; 326 return 0;
327 else 327 } else {
328 return (size_t) prediction; 328 return (size_t) prediction;
329 }
329 } 330 }
330 331
331 size_t predict_pending_cards() { 332 size_t predict_pending_cards() {
332 size_t max_pending_card_num = _g1->max_pending_card_num(); 333 size_t max_pending_card_num = _g1->max_pending_card_num();
333 size_t diff = predict_pending_card_diff(); 334 size_t diff = predict_pending_card_diff();
334 size_t prediction; 335 size_t prediction;
335 if (diff > max_pending_card_num) 336 if (diff > max_pending_card_num) {
336 prediction = max_pending_card_num; 337 prediction = max_pending_card_num;
337 else 338 } else {
338 prediction = max_pending_card_num - diff; 339 prediction = max_pending_card_num - diff;
340 }
339 341
340 return prediction; 342 return prediction;
341 } 343 }
342 344
343 size_t predict_rs_length_diff() { 345 size_t predict_rs_length_diff() {
354 356
355 double predict_rs_update_time_ms(size_t pending_cards) { 357 double predict_rs_update_time_ms(size_t pending_cards) {
356 return (double) pending_cards * predict_cost_per_card_ms(); 358 return (double) pending_cards * predict_cost_per_card_ms();
357 } 359 }
358 360
359 double predict_fully_young_cards_per_entry_ratio() { 361 double predict_young_cards_per_entry_ratio() {
360 return get_new_prediction(_fully_young_cards_per_entry_ratio_seq); 362 return get_new_prediction(_young_cards_per_entry_ratio_seq);
361 } 363 }
362 364
363 double predict_partially_young_cards_per_entry_ratio() { 365 double predict_mixed_cards_per_entry_ratio() {
364 if (_partially_young_cards_per_entry_ratio_seq->num() < 2) 366 if (_mixed_cards_per_entry_ratio_seq->num() < 2) {
365 return predict_fully_young_cards_per_entry_ratio(); 367 return predict_young_cards_per_entry_ratio();
366 else 368 } else {
367 return get_new_prediction(_partially_young_cards_per_entry_ratio_seq); 369 return get_new_prediction(_mixed_cards_per_entry_ratio_seq);
370 }
368 } 371 }
369 372
370 size_t predict_young_card_num(size_t rs_length) { 373 size_t predict_young_card_num(size_t rs_length) {
371 return (size_t) ((double) rs_length * 374 return (size_t) ((double) rs_length *
372 predict_fully_young_cards_per_entry_ratio()); 375 predict_young_cards_per_entry_ratio());
373 } 376 }
374 377
375 size_t predict_non_young_card_num(size_t rs_length) { 378 size_t predict_non_young_card_num(size_t rs_length) {
376 return (size_t) ((double) rs_length * 379 return (size_t) ((double) rs_length *
377 predict_partially_young_cards_per_entry_ratio()); 380 predict_mixed_cards_per_entry_ratio());
378 } 381 }
379 382
380 double predict_rs_scan_time_ms(size_t card_num) { 383 double predict_rs_scan_time_ms(size_t card_num) {
381 if (full_young_gcs()) 384 if (gcs_are_young()) {
382 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq); 385 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
383 else 386 } else {
384 return predict_partially_young_rs_scan_time_ms(card_num); 387 return predict_mixed_rs_scan_time_ms(card_num);
385 } 388 }
386 389 }
387 double predict_partially_young_rs_scan_time_ms(size_t card_num) { 390
388 if (_partially_young_cost_per_entry_ms_seq->num() < 3) 391 double predict_mixed_rs_scan_time_ms(size_t card_num) {
392 if (_mixed_cost_per_entry_ms_seq->num() < 3) {
389 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq); 393 return (double) card_num * get_new_prediction(_cost_per_entry_ms_seq);
390 else 394 } else {
391 return (double) card_num * 395 return (double) (card_num *
392 get_new_prediction(_partially_young_cost_per_entry_ms_seq); 396 get_new_prediction(_mixed_cost_per_entry_ms_seq));
397 }
393 } 398 }
394 399
395 double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) { 400 double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) {
396 if (_cost_per_byte_ms_during_cm_seq->num() < 3) 401 if (_cost_per_byte_ms_during_cm_seq->num() < 3) {
397 return 1.1 * (double) bytes_to_copy * 402 return (1.1 * (double) bytes_to_copy) *
398 get_new_prediction(_cost_per_byte_ms_seq); 403 get_new_prediction(_cost_per_byte_ms_seq);
399 else 404 } else {
400 return (double) bytes_to_copy * 405 return (double) bytes_to_copy *
401 get_new_prediction(_cost_per_byte_ms_during_cm_seq); 406 get_new_prediction(_cost_per_byte_ms_during_cm_seq);
407 }
402 } 408 }
403 409
404 double predict_object_copy_time_ms(size_t bytes_to_copy) { 410 double predict_object_copy_time_ms(size_t bytes_to_copy) {
405 if (_in_marking_window && !_in_marking_window_im) 411 if (_in_marking_window && !_in_marking_window_im) {
406 return predict_object_copy_time_ms_during_cm(bytes_to_copy); 412 return predict_object_copy_time_ms_during_cm(bytes_to_copy);
407 else 413 } else {
408 return (double) bytes_to_copy * 414 return (double) bytes_to_copy *
409 get_new_prediction(_cost_per_byte_ms_seq); 415 get_new_prediction(_cost_per_byte_ms_seq);
416 }
410 } 417 }
411 418
412 double predict_constant_other_time_ms() { 419 double predict_constant_other_time_ms() {
413 return get_new_prediction(_constant_other_time_ms_seq); 420 return get_new_prediction(_constant_other_time_ms_seq);
414 } 421 }
415 422
416 double predict_young_other_time_ms(size_t young_num) { 423 double predict_young_other_time_ms(size_t young_num) {
417 return 424 return (double) young_num *
418 (double) young_num * 425 get_new_prediction(_young_other_cost_per_region_ms_seq);
419 get_new_prediction(_young_other_cost_per_region_ms_seq);
420 } 426 }
421 427
422 double predict_non_young_other_time_ms(size_t non_young_num) { 428 double predict_non_young_other_time_ms(size_t non_young_num) {
423 return 429 return (double) non_young_num *
424 (double) non_young_num * 430 get_new_prediction(_non_young_other_cost_per_region_ms_seq);
425 get_new_prediction(_non_young_other_cost_per_region_ms_seq);
426 } 431 }
427 432
428 void check_if_region_is_too_expensive(double predicted_time_ms); 433 void check_if_region_is_too_expensive(double predicted_time_ms);
429 434
430 double predict_young_collection_elapsed_time_ms(size_t adjustment); 435 double predict_young_collection_elapsed_time_ms(size_t adjustment);
454 } 459 }
455 460
456 double predict_survivor_regions_evac_time(); 461 double predict_survivor_regions_evac_time();
457 462
458 void cset_regions_freed() { 463 void cset_regions_freed() {
459 bool propagate = _last_young_gc_full && !_in_marking_window; 464 bool propagate = _last_gc_was_young && !_in_marking_window;
460 _short_lived_surv_rate_group->all_surviving_words_recorded(propagate); 465 _short_lived_surv_rate_group->all_surviving_words_recorded(propagate);
461 _survivor_surv_rate_group->all_surviving_words_recorded(propagate); 466 _survivor_surv_rate_group->all_surviving_words_recorded(propagate);
462 // also call it on any more surv rate groups 467 // also call it on any more surv rate groups
463 } 468 }
464 469
626 // will stay true until the end of the initial-mark pause and it's 631 // will stay true until the end of the initial-mark pause and it's
627 // the condition that indicates that a pause is doing the 632 // the condition that indicates that a pause is doing the
628 // initial-mark work. 633 // initial-mark work.
629 volatile bool _during_initial_mark_pause; 634 volatile bool _during_initial_mark_pause;
630 635
631 bool _should_revert_to_full_young_gcs; 636 bool _should_revert_to_young_gcs;
632 bool _last_full_young_gc; 637 bool _last_young_gc;
633 638
634 // This set of variables tracks the collector efficiency, in order to 639 // This set of variables tracks the collector efficiency, in order to
635 // determine whether we should initiate a new marking. 640 // determine whether we should initiate a new marking.
636 double _cur_mark_stop_world_time_ms; 641 double _cur_mark_stop_world_time_ms;
637 double _mark_remark_start_sec; 642 double _mark_remark_start_sec;
983 988
984 size_t young_list_max_length() { 989 size_t young_list_max_length() {
985 return _young_list_max_length; 990 return _young_list_max_length;
986 } 991 }
987 992
988 bool full_young_gcs() { 993 bool gcs_are_young() {
989 return _full_young_gcs; 994 return _gcs_are_young;
990 } 995 }
991 void set_full_young_gcs(bool full_young_gcs) { 996 void set_gcs_are_young(bool gcs_are_young) {
992 _full_young_gcs = full_young_gcs; 997 _gcs_are_young = gcs_are_young;
993 } 998 }
994 999
995 bool adaptive_young_list_length() { 1000 bool adaptive_young_list_length() {
996 return _adaptive_young_list_length; 1001 return _adaptive_young_list_length;
997 } 1002 }