8240076: Shenandoah: pacer should cover reset and preclean phases

Reviewed-by: zgu
This commit is contained in:
Aleksey Shipilev 2020-02-26 19:36:56 +01:00
parent d26dadef43
commit 6913bbc200
3 changed files with 34 additions and 0 deletions

View File

@ -1814,10 +1814,16 @@ void ShenandoahHeap::op_roots() {
}
void ShenandoahHeap::op_reset() {
if (ShenandoahPacing) {
pacer()->setup_for_reset();
}
reset_mark_bitmap();
}
void ShenandoahHeap::op_preclean() {
if (ShenandoahPacing) {
pacer()->setup_for_preclean();
}
concurrent_mark()->preclean_weak_refs();
}

View File

@ -177,6 +177,31 @@ void ShenandoahPacer::setup_for_idle() {
tax);
}
/*
* There is no useful notion of progress for these operations. To avoid stalling
* the allocators unnecessarily, allow them to run unimpeded.
*/
void ShenandoahPacer::setup_for_preclean() {
assert(ShenandoahPacing, "Only be here when pacing is enabled");
size_t initial = _heap->max_capacity();
restart_with(initial, 1.0);
log_info(gc, ergo)("Pacer for Precleaning. Non-Taxable: " SIZE_FORMAT "%s",
byte_size_in_proper_unit(initial), proper_unit_for_byte_size(initial));
}
void ShenandoahPacer::setup_for_reset() {
assert(ShenandoahPacing, "Only be here when pacing is enabled");
size_t initial = _heap->max_capacity();
restart_with(initial, 1.0);
log_info(gc, ergo)("Pacer for Reset. Non-Taxable: " SIZE_FORMAT "%s",
byte_size_in_proper_unit(initial), proper_unit_for_byte_size(initial));
}
size_t ShenandoahPacer::update_and_get_progress_history() {
if (_progress == -1) {
// First initialization, report some prior

View File

@ -74,6 +74,9 @@ public:
void setup_for_updaterefs();
void setup_for_traversal();
void setup_for_reset();
void setup_for_preclean();
inline void report_mark(size_t words);
inline void report_evac(size_t words);
inline void report_updaterefs(size_t words);