ZGC: C2 allocation reloc promotion deopt race

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P2
    • 26
    • Affects Version/s: 21
    • Component/s: hotspot
    • gc
    • 21

      When C2 allocates in the slow path, it performs a safepoint poll on the way back to the compiled code. In this safepoint poll, objects can racingly become relocation promoted to the old generation. Such objects would require write barriers to track remembered set changes. But the C2 compiled code speculatively assumes that just allocated objects do not require such write barriers.

      The code in ZBarrierSet::on_slowpath_allocation_exit tries to guard against that and detect such races, and deoptimize the frame should it happen.

      Unfortunately, the check is racy when the tenuring threshold gets lowered, making the checks insufficient. The result is potentially lost remembered set entries.

      This bug relates a lot to JDK-8371200 which fixed this race for flip promoted pages. This bug fixes a related issue for relocation promoted pages.

            Assignee:
            Erik Ă–sterlund
            Reporter:
            Erik Ă–sterlund
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: