< prev index next >

src/hotspot/share/gc/g1/g1CollectionSet.cpp

Print this page
rev 56992 : imported patch 8227739-merge-scan-rs-update-rs-cost
rev 56999 : imported patch 8233998-new-young-regions-registered-too-early
rev 57000 : imported patch 8233919-incrementally-calc-num-occupied
rev 57002 : imported patch 8233588-cleanup-survrategroup
rev 57003 : [mq]: 8233588-kbarrett-review
rev 57004 : imported patch 8231579-incremental-calculation-wrong
rev 57005 : [mq]: 8231579-sjohanss-review


 228     if (cur_pos == len) {
 229       cur_pos = 0;
 230     }
 231   } while (cur_pos != start_pos);
 232 }
 233 
 234 void G1CollectionSet::update_young_region_prediction(HeapRegion* hr,
 235                                                      size_t new_rs_length) {
 236   // Update the CSet information that is dependent on the new RS length
 237   assert(hr->is_young(), "Precondition");
 238   assert(!SafepointSynchronize::is_at_safepoint(), "should not be at a safepoint");
 239 
 240   size_t old_rs_length = hr->recorded_rs_length();
 241   assert(old_rs_length <= new_rs_length,
 242          "Remembered set sizes must increase (changed from " SIZE_FORMAT " to " SIZE_FORMAT " region %u type %s)",
 243          old_rs_length, new_rs_length, hr->hrm_index(), hr->get_short_type_str());
 244   size_t rs_length_diff = new_rs_length - old_rs_length;
 245   hr->set_recorded_rs_length(new_rs_length);
 246   _inc_recorded_rs_length_diff += rs_length_diff;
 247 
 248   double old_elapsed_time_ms = hr->predicted_non_copy_time_ms();
 249   double new_region_elapsed_time_ms = predict_region_non_copy_time_ms(hr);
 250   double non_copy_time_ms_diff = new_region_elapsed_time_ms - old_elapsed_time_ms;
 251   hr->set_predicted_non_copy_time_ms(new_region_elapsed_time_ms);
 252   _inc_predicted_non_copy_time_ms_diff += non_copy_time_ms_diff;
 253 }
 254 
 255 void G1CollectionSet::add_young_region_common(HeapRegion* hr) {
 256   assert(hr->is_young(), "invariant");
 257   assert(_inc_build_state == Active, "Precondition");
 258 
 259   // This routine is used when:
 260   // * adding survivor regions to the incremental cset at the end of an
 261   //   evacuation pause or
 262   // * adding the current allocation region to the incremental cset
 263   //   when it is retired.
 264   // Therefore this routine may be called at a safepoint by the
 265   // VM thread, or in-between safepoints by mutator threads (when
 266   // retiring the current allocation region)
 267   // We need to clear and set the cached recorded/cached collection set
 268   // information in the heap region here (before the region gets added
 269   // to the collection set). An individual heap region's cached values
 270   // are calculated, aggregated with the policy collection set info,
 271   // and cached in the heap region here (initially) and (subsequently)




 228     if (cur_pos == len) {
 229       cur_pos = 0;
 230     }
 231   } while (cur_pos != start_pos);
 232 }
 233 
 234 void G1CollectionSet::update_young_region_prediction(HeapRegion* hr,
 235                                                      size_t new_rs_length) {
 236   // Update the CSet information that is dependent on the new RS length
 237   assert(hr->is_young(), "Precondition");
 238   assert(!SafepointSynchronize::is_at_safepoint(), "should not be at a safepoint");
 239 
 240   size_t old_rs_length = hr->recorded_rs_length();
 241   assert(old_rs_length <= new_rs_length,
 242          "Remembered set sizes must increase (changed from " SIZE_FORMAT " to " SIZE_FORMAT " region %u type %s)",
 243          old_rs_length, new_rs_length, hr->hrm_index(), hr->get_short_type_str());
 244   size_t rs_length_diff = new_rs_length - old_rs_length;
 245   hr->set_recorded_rs_length(new_rs_length);
 246   _inc_recorded_rs_length_diff += rs_length_diff;
 247 
 248   double old_non_copy_time = hr->predicted_non_copy_time_ms();
 249   double new_non_copy_time = predict_region_non_copy_time_ms(hr);
 250   double non_copy_time_ms_diff = new_non_copy_time - old_non_copy_time;
 251   hr->set_predicted_non_copy_time_ms(new_non_copy_time);
 252   _inc_predicted_non_copy_time_ms_diff += non_copy_time_ms_diff;
 253 }
 254 
 255 void G1CollectionSet::add_young_region_common(HeapRegion* hr) {
 256   assert(hr->is_young(), "invariant");
 257   assert(_inc_build_state == Active, "Precondition");
 258 
 259   // This routine is used when:
 260   // * adding survivor regions to the incremental cset at the end of an
 261   //   evacuation pause or
 262   // * adding the current allocation region to the incremental cset
 263   //   when it is retired.
 264   // Therefore this routine may be called at a safepoint by the
 265   // VM thread, or in-between safepoints by mutator threads (when
 266   // retiring the current allocation region)
 267   // We need to clear and set the cached recorded/cached collection set
 268   // information in the heap region here (before the region gets added
 269   // to the collection set). An individual heap region's cached values
 270   // are calculated, aggregated with the policy collection set info,
 271   // and cached in the heap region here (initially) and (subsequently)


< prev index next >