RFR: 8254167 G1: Record regions where evacuation failed to provide targeted iteration [v9]
Albert Mingkun Yang
ayang at openjdk.java.net
Tue Sep 7 18:35:36 UTC 2021
On Tue, 7 Sep 2021 04:27:01 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> This is another try to optimize evcuation failure for regions.
>> I record evacuation failed regions, and iterate these regions directly rather than iterate the whole cset.
>> The implementation reuses and refactors some of the existing data in g1CollectedHeap (_regions_failed_evacuation, _num_regions_failed_evacuation), and records these regions in an array, and iterate this array later in post evacuation phase.
>>
>> I have 2 implementations:
>>
>> - 1) CHT (Initial version)
>> - 2) bitmap (latest version, reuse _regions_failed_evacuation in g1CollectedHeap)
>>
>> This implementation does not consider work distribution as mentioned in JDK-8254167 yet. But seems it already get better&stable performance gain than origin. We could improve it further later if work distribution is necessary.
>>
>> I will attach the perf data in JBS.
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix merging issues
src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 2329:
> 2327: }
> 2328:
> 2329: void G1CollectedHeap::par_iterate_regions_array_part_from(HeapRegionClosure* cl,
This method essentially apply a closure to all elements in `[offset, length)` of `regions`. I wonder if we can pass `®ions[offset]` and `length-offset` to this method. Then this method can work on the whole array, and figuring out the starting index for each worker becomes trivial, `worker_id * array_len / #workers`. It's not obvious to me why the calculation in this patch guarantees balanced start index.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5272
More information about the hotspot-gc-dev
mailing list