RFR: 8307816: Add missing STS to ZGC

Roman Kennke rkennke at openjdk.org
Wed May 10 18:46:17 UTC 2023


On Wed, 10 May 2023 18:12:52 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> So far single generation ZGC has not had any need for the STS joiner, so we have barely used it at all. I think only some class unloading code uses it. With generational ZGC we have added such mechanisms all over the place to allow the generations to synchronize w.r.t. each other in safepoints. So I think in generational ZGC there are no changes required in this regard. However, in single generation ZGC, the change you have made will cause the JVM to hang if a load barrier executed in a safepoint hits a relocation stall due to memory shortage. That code assumes the concurrent GC thread will make progress with compaction from within the safepoint. In generational ZGC we went through the trouble of adding an STS like mechanism that is aware of relocation stalls, and allows them to be solved from within safepoints, on the mutator's behalf. You would need something like that for single generation ZGC as well. Other than that, there are probably other places requiring STS that reads the
  klass pointer, such as during marking and probably reference processing, etc. Perhaps since this is going to be experimental and mostly aiming towards hitting production in the future, a pragmatic solution is to support only generational ZGC, which shouldn't really require any changes like this. What do you think?

Ok, if generational ZGC comes with all the relevant synchronizations, then I will wait for that, and withdraw this PR. Thanks for the explanations.

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

PR Comment: https://git.openjdk.org/jdk/pull/13904#issuecomment-1542632281


More information about the hotspot-gc-dev mailing list