RFR: 8310031: Parallel: Implement better work distribution for large object arrays in old gen [v5]
Richard Reingruber
rrich at openjdk.org
Thu Sep 14 15:41:48 UTC 2023
On Wed, 13 Sep 2023 19:30:33 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> I agree that the scalability issue on master should be addressed. However, the regression while using fewer gc-threads is too significant, IMO.
Thanks for the additional testing. You convinced me that the regression is too significant. So far I havn't found a bug that causes it. The work is dominated by scanning the elements of the large array. As I see it, it is devided into too many pieces.
In the last commit I've changed the sizing of the stripes to get 100 stripes per active worker thread. These are the results I get.
## baseline
$ baseline/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Xlog:gc=trace card_scan
[0.006s][info][gc] Using Parallel
[2.269s][trace][gc] GC(0) PSYoung generation size at maximum: 1048576K
[2.269s][info ][gc] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 553.722ms
[3.996s][trace][gc] GC(1) PSYoung generation size at maximum: 1048576K
[3.996s][info ][gc] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 556.092ms
$ baseline/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=4 -Xlog:gc=trace card_scan
[0.006s][info][gc] Using Parallel
[2.673s][trace][gc] GC(0) PSYoung generation size at maximum: 1048576K
[2.673s][info ][gc] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 977.355ms
[4.819s][trace][gc] GC(1) PSYoung generation size at maximum: 1048576K
[4.820s][info ][gc] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 986.606ms
$ baseline/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=8 -Xlog:gc=trace card_scan
[0.005s][info][gc] Using Parallel
[3.103s][trace][gc] GC(0) PSYoung generation size at maximum: 1048576K
[3.103s][info ][gc] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 1387.618ms
[5.688s][trace][gc] GC(1) PSYoung generation size at maximum: 1048576K
[5.688s][info ][gc] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 1398.658ms
## new
$ new/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Xlog:gc=trace -Xlog:gc+scavenge=trace card_scan
[0.006s][info][gc] Using Parallel
[1.710s][trace][gc,scavenge] stripe count:200 stripe size:5248K
[2.044s][trace][gc ] GC(0) PSYoung generation size at maximum: 1048576K
[2.044s][info ][gc ] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 334.022ms
[3.229s][trace][gc,scavenge] stripe count:200 stripe size:5248K
[3.562s][trace][gc ] GC(1) PSYoung generation size at maximum: 1048576K
[3.562s][info ][gc ] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 333.069ms
$ new/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=4 -Xlog:gc=trace -Xlog:gc+scavenge=trace card_scan
[0.006s][info][gc] Using Parallel
[1.689s][trace][gc,scavenge] stripe count:400 stripe size:2624K
[1.944s][trace][gc ] GC(0) PSYoung generation size at maximum: 1048576K
[1.944s][info ][gc ] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 255.195ms
[3.100s][trace][gc,scavenge] stripe count:400 stripe size:2624K
[3.347s][trace][gc ] GC(1) PSYoung generation size at maximum: 1048576K
[3.348s][info ][gc ] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 247.918ms
$ new/images/jdk/bin/java -Xms3g -Xmx3g -XX:+UseParallelGC -XX:ParallelGCThreads=8 -Xlog:gc=trace -Xlog:gc+scavenge=trace card_scan
[0.006s][info][gc] Using Parallel
[1.707s][trace][gc,scavenge] stripe count:800 stripe size:1312K
[1.920s][trace][gc ] GC(0) PSYoung generation size at maximum: 1048576K
[1.920s][info ][gc ] GC(0) Pause Young (Allocation Failure) 1793M->1025M(2944M) 213.508ms
[3.088s][trace][gc,scavenge] stripe count:800 stripe size:1312K
[3.297s][trace][gc ] GC(1) PSYoung generation size at maximum: 1048576K
[3.297s][info ][gc ] GC(1) Pause Young (Allocation Failure) 1793M->1025M(2944M) 209.769ms
I've tested on a server with Intel CPUs(*). Please let me know how it works for you.
(*) lscpu shows "Genuine Intel(R) CPU 0000%@" as model name. Maybe the Linux is too old.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14846#issuecomment-1719694789
More information about the hotspot-gc-dev
mailing list