Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8314972

GenShen: promote_in_place needs to prepare remembered set before it enables old allocations within region

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • repo-shenandoah
    • hotspot
    • gc

      As currently implemented: ShenandoahHeapRegion::promote_in_place() performs the following steps:

      1. Obtains the heap lock
      2. Restores region top (which had been artificially set to end() to prevent young allocations within region)
      3. Decreases used for young
      4. Forces transfer of 1 region from young to old
      5. Sets affiliation of this region to OLD
      6. Increases used for OLD
      7. Adds this region to the old_collector free set
      8. Releases the heap lock

      9. Now, a different thread allocates a PLAB within this region, and fills an alignment pad, and registers the alignment pad

      10. Resume the promote_in_place() worker thread
      11. Clears the remembered set object register for all objects between bottom and top()
      12. Iterates over all objects from bottom to tams within the region to register them with the remembered set

      This causes us to lose registration of the PLAB pad object which had been placed by the preempting thread.

      An rr recording of this problem is available here: https://pernos.co/debug/l1b0ckFoTvhdIv00OLq_Jg/index.html

      The fix is to move steps 11-12 before step 1

            kdnilsen Kelvin Nilsen
            kdnilsen Kelvin Nilsen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: