ZGC: C2 allocation deopt race

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 21
    • Component/s: hotspot
    • None
    • gc

      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 flip 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, should the conditions be right (or wrong depending on how you look at it).

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

              Created:
              Updated: