RFR: 8265116: ZGC: Steal local stacks instead of flushing them
Stefan Johansson
sjohanss at openjdk.java.net
Mon Apr 26 11:38:29 UTC 2021
On Tue, 13 Apr 2021 08:18:29 GMT, Per Liden <pliden at openjdk.org> wrote:
> As part of addressing the issue of excessive mark stack usage, it was observed that sometimes mark stack utilization can be very low. For example, casparcwang at tencent.com reported that when running Apache Zookeeper, mark stack utilization was ~10%.
>
> The problem is that GC workers are a bit too eager to flush mark stacks. Currently, whenever a GC worker has drained its home stripe it will always flush all remaining mark stacks. This causes non-full mark stacks to be flushed. This in turn means that the GC worker who receives that non-full stack (small amount of work) tends to also produce non-full stacks (small amount of work) for other GC workers. This can lead to a vicious cycle, which results in excessive mark stack memory usage.
>
> The solution proposed here is to not let GC workers flush non-full stacks. After draining the home stripe, a GC worker will instead try to steal any non-full local stack belonging to a different stripe, and if no such stacks exist it will (as it does today) try to steal a global stack belonging to a different stripe.
>
> (Note: This PR only addresses one part of the mark stack usage problem. Other improvements, such as the discussed "mark before push"-patch will be a separate PR).
>
> Testing:
> * Tier1-7.
> * SPECjbb2015, score and mark times unaffected.
> * casparcwang at tencent.com reports that this patch (in combination with the "mark before push"-patch) solves the problem for Apache Zookeeper.
Looks good.
-------------
Marked as reviewed by sjohanss (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3455
More information about the hotspot-gc-dev
mailing list