1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Tue Jan 10 20:02:41 2012 +0100 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Tue Jan 10 18:58:13 2012 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -281,7 +281,7 @@ 1.11 1.12 _par_last_gc_worker_start_times_ms = new double[_parallel_gc_threads]; 1.13 _par_last_ext_root_scan_times_ms = new double[_parallel_gc_threads]; 1.14 - _par_last_mark_stack_scan_times_ms = new double[_parallel_gc_threads]; 1.15 + _par_last_satb_filtering_times_ms = new double[_parallel_gc_threads]; 1.16 1.17 _par_last_update_rs_times_ms = new double[_parallel_gc_threads]; 1.18 _par_last_update_rs_processed_buffers = new double[_parallel_gc_threads]; 1.19 @@ -905,10 +905,19 @@ 1.20 gclog_or_tty->print(" (%s)", gcs_are_young() ? "young" : "mixed"); 1.21 } 1.22 1.23 - // We only need to do this here as the policy will only be applied 1.24 - // to the GC we're about to start. so, no point is calculating this 1.25 - // every time we calculate / recalculate the target young length. 1.26 - update_survivors_policy(); 1.27 + if (!during_initial_mark_pause()) { 1.28 + // We only need to do this here as the policy will only be applied 1.29 + // to the GC we're about to start. so, no point is calculating this 1.30 + // every time we calculate / recalculate the target young length. 1.31 + update_survivors_policy(); 1.32 + } else { 1.33 + // The marking phase has a "we only copy implicitly live 1.34 + // objects during marking" invariant. The easiest way to ensure it 1.35 + // holds is not to allocate any survivor regions and tenure all 1.36 + // objects. In the future we might change this and handle survivor 1.37 + // regions specially during marking. 1.38 + tenure_all_objects(); 1.39 + } 1.40 1.41 assert(_g1->used() == _g1->recalculate_used(), 1.42 err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT, 1.43 @@ -939,7 +948,7 @@ 1.44 for (int i = 0; i < _parallel_gc_threads; ++i) { 1.45 _par_last_gc_worker_start_times_ms[i] = -1234.0; 1.46 _par_last_ext_root_scan_times_ms[i] = -1234.0; 1.47 - _par_last_mark_stack_scan_times_ms[i] = -1234.0; 1.48 + _par_last_satb_filtering_times_ms[i] = -1234.0; 1.49 _par_last_update_rs_times_ms[i] = -1234.0; 1.50 _par_last_update_rs_processed_buffers[i] = -1234.0; 1.51 _par_last_scan_rs_times_ms[i] = -1234.0; 1.52 @@ -1227,7 +1236,7 @@ 1.53 // of the PrintGCDetails output, in the non-parallel case. 1.54 1.55 double ext_root_scan_time = avg_value(_par_last_ext_root_scan_times_ms); 1.56 - double mark_stack_scan_time = avg_value(_par_last_mark_stack_scan_times_ms); 1.57 + double satb_filtering_time = avg_value(_par_last_satb_filtering_times_ms); 1.58 double update_rs_time = avg_value(_par_last_update_rs_times_ms); 1.59 double update_rs_processed_buffers = 1.60 sum_of_values(_par_last_update_rs_processed_buffers); 1.61 @@ -1236,7 +1245,7 @@ 1.62 double termination_time = avg_value(_par_last_termination_times_ms); 1.63 1.64 double known_time = ext_root_scan_time + 1.65 - mark_stack_scan_time + 1.66 + satb_filtering_time + 1.67 update_rs_time + 1.68 scan_rs_time + 1.69 obj_copy_time; 1.70 @@ -1282,7 +1291,7 @@ 1.71 body_summary->record_satb_drain_time_ms(_cur_satb_drain_time_ms); 1.72 1.73 body_summary->record_ext_root_scan_time_ms(ext_root_scan_time); 1.74 - body_summary->record_mark_stack_scan_time_ms(mark_stack_scan_time); 1.75 + body_summary->record_satb_filtering_time_ms(satb_filtering_time); 1.76 body_summary->record_update_rs_time_ms(update_rs_time); 1.77 body_summary->record_scan_rs_time_ms(scan_rs_time); 1.78 body_summary->record_obj_copy_time_ms(obj_copy_time); 1.79 @@ -1376,16 +1385,12 @@ 1.80 (last_pause_included_initial_mark) ? " (initial-mark)" : "", 1.81 elapsed_ms / 1000.0); 1.82 1.83 - if (print_marking_info) { 1.84 - print_stats(1, "SATB Drain Time", _cur_satb_drain_time_ms); 1.85 - } 1.86 - 1.87 if (parallel) { 1.88 print_stats(1, "Parallel Time", _cur_collection_par_time_ms); 1.89 print_par_stats(2, "GC Worker Start", _par_last_gc_worker_start_times_ms); 1.90 print_par_stats(2, "Ext Root Scanning", _par_last_ext_root_scan_times_ms); 1.91 if (print_marking_info) { 1.92 - print_par_stats(2, "Mark Stack Scanning", _par_last_mark_stack_scan_times_ms); 1.93 + print_par_stats(2, "SATB Filtering", _par_last_satb_filtering_times_ms); 1.94 } 1.95 print_par_stats(2, "Update RS", _par_last_update_rs_times_ms); 1.96 print_par_sizes(3, "Processed Buffers", _par_last_update_rs_processed_buffers); 1.97 @@ -1399,7 +1404,7 @@ 1.98 _par_last_gc_worker_times_ms[i] = _par_last_gc_worker_end_times_ms[i] - _par_last_gc_worker_start_times_ms[i]; 1.99 1.100 double worker_known_time = _par_last_ext_root_scan_times_ms[i] + 1.101 - _par_last_mark_stack_scan_times_ms[i] + 1.102 + _par_last_satb_filtering_times_ms[i] + 1.103 _par_last_update_rs_times_ms[i] + 1.104 _par_last_scan_rs_times_ms[i] + 1.105 _par_last_obj_copy_times_ms[i] + 1.106 @@ -1412,7 +1417,7 @@ 1.107 } else { 1.108 print_stats(1, "Ext Root Scanning", ext_root_scan_time); 1.109 if (print_marking_info) { 1.110 - print_stats(1, "Mark Stack Scanning", mark_stack_scan_time); 1.111 + print_stats(1, "SATB Filtering", satb_filtering_time); 1.112 } 1.113 print_stats(1, "Update RS", update_rs_time); 1.114 print_stats(2, "Processed Buffers", (int)update_rs_processed_buffers); 1.115 @@ -1983,11 +1988,10 @@ 1.116 if (summary->get_total_seq()->num() > 0) { 1.117 print_summary_sd(0, "Evacuation Pauses", summary->get_total_seq()); 1.118 if (body_summary != NULL) { 1.119 - print_summary(1, "SATB Drain", body_summary->get_satb_drain_seq()); 1.120 if (parallel) { 1.121 print_summary(1, "Parallel Time", body_summary->get_parallel_seq()); 1.122 print_summary(2, "Ext Root Scanning", body_summary->get_ext_root_scan_seq()); 1.123 - print_summary(2, "Mark Stack Scanning", body_summary->get_mark_stack_scan_seq()); 1.124 + print_summary(2, "SATB Filtering", body_summary->get_satb_filtering_seq()); 1.125 print_summary(2, "Update RS", body_summary->get_update_rs_seq()); 1.126 print_summary(2, "Scan RS", body_summary->get_scan_rs_seq()); 1.127 print_summary(2, "Object Copy", body_summary->get_obj_copy_seq()); 1.128 @@ -1996,7 +2000,7 @@ 1.129 { 1.130 NumberSeq* other_parts[] = { 1.131 body_summary->get_ext_root_scan_seq(), 1.132 - body_summary->get_mark_stack_scan_seq(), 1.133 + body_summary->get_satb_filtering_seq(), 1.134 body_summary->get_update_rs_seq(), 1.135 body_summary->get_scan_rs_seq(), 1.136 body_summary->get_obj_copy_seq(), 1.137 @@ -2009,7 +2013,7 @@ 1.138 } 1.139 } else { 1.140 print_summary(1, "Ext Root Scanning", body_summary->get_ext_root_scan_seq()); 1.141 - print_summary(1, "Mark Stack Scanning", body_summary->get_mark_stack_scan_seq()); 1.142 + print_summary(1, "SATB Filtering", body_summary->get_satb_filtering_seq()); 1.143 print_summary(1, "Update RS", body_summary->get_update_rs_seq()); 1.144 print_summary(1, "Scan RS", body_summary->get_scan_rs_seq()); 1.145 print_summary(1, "Object Copy", body_summary->get_obj_copy_seq()); 1.146 @@ -2036,7 +2040,7 @@ 1.147 body_summary->get_satb_drain_seq(), 1.148 body_summary->get_update_rs_seq(), 1.149 body_summary->get_ext_root_scan_seq(), 1.150 - body_summary->get_mark_stack_scan_seq(), 1.151 + body_summary->get_satb_filtering_seq(), 1.152 body_summary->get_scan_rs_seq(), 1.153 body_summary->get_obj_copy_seq() 1.154 }; 1.155 @@ -2433,9 +2437,6 @@ 1.156 assert(_inc_cset_build_state == Active, "Precondition"); 1.157 assert(!hr->is_young(), "non-incremental add of young region"); 1.158 1.159 - if (_g1->mark_in_progress()) 1.160 - _g1->concurrent_mark()->registerCSetRegion(hr); 1.161 - 1.162 assert(!hr->in_collection_set(), "should not already be in the CSet"); 1.163 hr->set_in_collection_set(true); 1.164 hr->set_next_in_collection_set(_collection_set); 1.165 @@ -2705,9 +2706,6 @@ 1.166 // Clear the fields that point to the survivor list - they are all young now. 1.167 young_list->clear_survivors(); 1.168 1.169 - if (_g1->mark_in_progress()) 1.170 - _g1->concurrent_mark()->register_collection_set_finger(_inc_cset_max_finger); 1.171 - 1.172 _collection_set = _inc_cset_head; 1.173 _collection_set_bytes_used_before = _inc_cset_bytes_used_before; 1.174 time_remaining_ms -= _inc_cset_predicted_elapsed_time_ms;