RFR: 8254739: G1: Optimize evacuation failure for regions with few failed objects [v19]

Albert Mingkun Yang ayang at openjdk.java.net
Fri Nov 5 09:43:15 UTC 2021


On Wed, 3 Nov 2021 12:39:46 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> This is a try to optimize evcuation failure for regions.
>> I record every evacuation failure object per region (by G1EvacuationFailureObjsInHR), and then iterate (which indeed includes compact/sort/iteration) these objects directly in RemoveSelfForwardPtrHRClosure.
>> 
>> I have tested it with following parameters, 
>> 
>> -   -XX:+ParallelGCThreads=1/32/64
>> -   -XX:G1EvacuationFailureALotInterval=1
>> -   -XX:G1EvacuationFailureALotCount=2/10/100/1000/10000/100000
>> 
>> It saves "Remove Self Forwards" time all the time ,and in most condition it saves "Evacuate Collection Set" time. 
>> 
>> It brings some performance degradation when -XX:G1EvacuationFailureALotCount is low, such as *2*. To improve this a little, we can record the number evacuation failure object per region, and not record these objects when the number hit some limit. But I'm not sure if it's necessary to do so, as I think such condition is so extreme to be met in real environment, although I'm not quite sure.
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move allocation/deallocation in one place

Only some subjective and minor comments.

src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp line 131:

> 129: 
> 130:   _offsets.drop_all();
> 131: }

Having some destructive operations (`drop_all`) inside a method named `iterate` could come as a surprise, IMO. If I understand this correctly, the following would be problematic.


evac_failed_objects.iterate(closure1);
...
evac_failed_objects.iterate(closure2);

src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp line 264:

> 262: template <class Elem, MEMFLAGS flag>
> 263: template <typename BufferClosure>
> 264: void G1SegmentedArray<Elem, flag>::iterate_nodes(BufferClosure& cloure) const {

Typo: `cloure`.

-------------

Marked as reviewed by ayang (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5181



More information about the hotspot-gc-dev mailing list