RFR: 8327452: G1: Improve scalability of Merge Log Buffers
Kim Barrett
kbarrett at openjdk.org
Wed Mar 6 18:31:45 UTC 2024
On Wed, 6 Mar 2024 11:18:03 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
> Hi all,
>
> Please review this change to reduce contention on the DCQS. The parallel work done by the worker threads is very small, therefore contention on the DCQS dominates the Merge Log Buffers phase. In this change, we add a sequential phase to distribute the Log Buffers to the worker threads. This removes the DCQS bottleneck in the highly contended case, at a small cost to the cases with low contention.
>
> Testing Tier 1-3
>
> The graphs below are using Bigramtester at 20gb, "Distribute and Avg Log Buffers" combines the duration of the sequential distribute phase and the avg duration of the parallel `Merge Log Buffers` phase.
> | Time (ms) | # Cards |
> | ------------- | ------------- |
> |  | |
> | | |
> |  | |
> |  |  |
> |  |  |
> |  |  |
Looks good. Just one suggestion for a possible(?) improvement.
src/hotspot/share/gc/g1/g1RemSet.cpp line 1302:
> 1300:
> 1301: uint worker = 0;
> 1302: while (cur != nullptr) {
Rather than transferring buffers one-by-one (with a somewhat expensive though uncontended push
for each), one could use `buffers._entry_count` and `num_workers` to get the number of buffers to
put in each slot, and peel off that many from the list for each slot. That's maybe a little bit more
complicated than the current code? And probably needs a lot of buffers to be noticeable.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18134#pullrequestreview-1920493822
PR Review Comment: https://git.openjdk.org/jdk/pull/18134#discussion_r1514956801
More information about the hotspot-gc-dev
mailing list