8186571: Implementation: JEP 307: Parallel Full GC for G1

Improve G1 worst-case latencies by making the full GC parallel.

Reviewed-by: tschatzl, sangheki, ehelin
This commit is contained in:
Stefan Johansson 2017-11-14 11:33:23 +01:00
parent fdab870aff
commit 6929e0f05a
71 changed files with 2799 additions and 903 deletions

View file

@ -327,9 +327,7 @@ bool HeapRegionManager::allocate_containing_regions(MemRegion range, size_t* com
return true;
}
void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, HeapRegionClaimer* hrclaimer) const {
const uint start_index = hrclaimer->start_region_for_worker(worker_id);
void HeapRegionManager::par_iterate(HeapRegionClosure* blk, HeapRegionClaimer* hrclaimer, const uint start_index) const {
// Every worker will actually look at all regions, skipping over regions that
// are currently not committed.
// This also (potentially) iterates over regions newly allocated during GC. This
@ -493,7 +491,7 @@ HeapRegionClaimer::~HeapRegionClaimer() {
}
}
uint HeapRegionClaimer::start_region_for_worker(uint worker_id) const {
uint HeapRegionClaimer::offset_for_worker(uint worker_id) const {
assert(worker_id < _n_workers, "Invalid worker_id.");
return _n_regions * worker_id / _n_workers;
}