RFR: 8292194: G1 nmethod entry barrier disarm value wraps around too early

Thomas Schatzl tschatzl at openjdk.org
Wed Aug 24 10:08:24 UTC 2022


On Wed, 10 Aug 2022 14:53:06 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> The disarm value for G1 nmethod entry barriers assumes that a concurrent GC can be aborted at most once. However, it can happen many times. In order to avoid ABA issues in the nmethod entry barriers, the limit for wrapping around and reusing numbers needs to be higher. This patch changes that point to INT_MAX as there is little point in using lower values.

src/hotspot/share/gc/shared/barrierSetNMethod.cpp line 113:

> 111:   // aborted N times, that is when there could be ABA problems. If there are anything
> 112:   // close to INT_MAX - 1 GCs starting without being able to finish, something is
> 113:   // seriously wrong.

Unfortunately, "something is seriously wrong" is not true. I have seen benchmarks where G1 is stuck in Concurrent Undo cycles because the concurrent start gc always can always reclaim some humongous object that gets G1 below the concurrent marking threshold again. That can last for 100's of such occurrences.
Obviously idk if before INT_MAX such concurrent undo marks there will be at least one "full" marking cycle, but there does not seem to be a guarantee.

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

PR: https://git.openjdk.org/jdk/pull/9822


More information about the hotspot-dev mailing list