RFR: 8256265: G1: Improve parallelism in regions that failed evacuation

Hamlin Li mli at openjdk.java.net
Wed Jan 26 07:29:40 UTC 2022


On Wed, 12 Jan 2022 09:03:45 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Currently G1 assigns a thread per failed evacuated region. This can in effect serialize the whole process as often (particularly with region pinning) there is only one region to fix up.
> 
> This patch tries to improve parallelism when walking over the regions in chunks
> 
> Latest implementation scans regions in chunks to bring parallelism, it's based on JDK-8278917 which changes to uses prev bitmap to mark evacuation failure objs.
> 
> Here's the summary of performance data based on latest implementation, basically, it brings better and stable performance than baseline at "Post Evacuate Cleanup 1/remove self forwardee" phase. (Although some regression is spotted when calculate the results in geomean, becuase one pause time from baseline is far too small than others.)
> 
> The performance benefit trend is:
>  - pause time (Post Evacuate Cleanup 1) is decreased from 76.79% to 2.28% for average time, from 71.61% to 3.04% for geomean, when G1EvacuationFailureALotCSetPercent is changed from 2 to 90 (-XX:ParallelGCThreads=8)
>  - pause time (Post Evacuate Cleanup 1) is decreased from 63.84% to 15.16% for average time, from 55.41% to 12.45% for geomean, when G1EvacuationFailureALotCSetPercent is changed from 2 to 90 (-XX:ParallelGCThreads=<default=123>)
> ( Other common Evacuation Failure configurations are:
> -XX:+G1EvacuationFailureALot -XX:G1EvacuationFailureALotInterval=0 -XX:G1EvacuationFailureALotCount=0 )
> 
> For more detailed performance data, please check the related bug.

Thanks Thomas for the summary and logging code.
I attached related log output below.


[3.236s][debug][gc,phases] GC(0)     Post Evacuate Cleanup 1: 5.4ms
[3.236s][debug][gc,phases] GC(0)     Evac Fail Merge Live: 0.0ms
...
[3.236s][debug][gc,phases] GC(0)       Restore Retained Regions (ms): Min:  5.1, Avg:  5.1, Max:  5.3, Diff:  0.2, Sum: 41.0, Workers: 8
[3.236s][debug][gc,phases] GC(0)         Regions:                       Min: 1, Avg:  1.0, Max: 1, Diff: 0, Sum: 4, Workers: 4
[3.237s][debug][gc,phases] GC(0)         Prepared Retained Regions (ms): Min:  0.0, Avg:  0.0, Max:  0.0, Diff:  0.0, Sum:  0.0, Workers: 4
[3.237s][debug][gc,phases] GC(0)         Wait For Ready In Retained Regions (ms): Min:  0.0, Avg:  0.0, Max:  0.0, Diff:  0.0, Sum:  0.0, Workers: 8
[3.237s][debug][gc,phases] GC(0)         Prepare Chunks (ms):           Min:  0.0, Avg:  0.0, Max:  0.0, Diff:  0.0, Sum:  0.1, Workers: 8
[3.237s][debug][gc,phases] GC(0)         Remove Self Forwards In Chunks (ms): Min:  5.0, Avg:  5.1, Max:  5.2, Diff:  0.2, Sum: 40.6, Workers: 8
[3.237s][debug][gc,phases] GC(0)           Forward Chunks:                Min: 16, Avg: 16.0, Max: 16, Diff: 0, Sum: 128, Workers: 8
[3.237s][debug][gc,phases] GC(0)           Empty Forward Chunks:          Min: 32, Avg: 128.0, Max: 351, Diff: 319, Sum: 896, Workers: 7
[3.237s][debug][gc,phases] GC(0)           Forward Objects:               Min: 432330, Avg: 440400.4, Max: 449475, Diff: 17145, Sum: 3523203, Workers: 8
[3.237s][debug][gc,phases] GC(0)           Forward Bytes:                 Min: 13543912, Avg: 13680514.0, Max: 13779400, Diff: 235488, Sum: 109444112, Workers: 8

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

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



More information about the hotspot-gc-dev mailing list