RFR: 8254167 G1: Record regions where evacuation failed to provide targeted iteration [v9]
Hamlin Li
mli at openjdk.java.net
Wed Sep 8 01:43:08 UTC 2021
On Tue, 7 Sep 2021 18:24:49 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> 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.
In fact, this method is just moved from G1CollectionSet::iterate_part_from which is deleted, the movement is to simply reuse its logic in both G1CollectionSet and G1EvacFailureRegions.
Your suggestion seems reasonable to me, thanks for catching this.
As this is an refinement to existing code, I wonder if we could do this in another issue? And as I know Thomas is starting another refactoring in G1's related code, so I hope this can be pushed eariler to avoid further merge conflicting in either pr.
How do you think about it? I'll create an issue to track this code refinement if you agree.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5272
More information about the hotspot-gc-dev
mailing list