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

G1 region remembered sets may contain non-coarse level PRTs for already coarsened regions

    Details

    • Type: Bug
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 15
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc

      Description

      The code in add_reference to add a remembered set looks as follows:

      X = ... from-region-of-added-card
      if (already coarsened(X)) {
        exit;
      }

      ...

      MutexLocker x(...)

      if (region X in sparse PRT) {
        add card for region X in sparse PRT
        exit
      }
      ...
      maybe coarsen PRT for region X

      The problem is that while one thread is in the mutex-guarded region, other threads that also want to add a card to PRT for region X might get blocked on the mutex. If the original thread now coarsens the PRT for region X, and the other threads for get into it, they will find that there is no fine and sparse PRT for X, so create a new one.

      The code in the mutex guarded section should also check whether the region X has already been coarsened or not.

      Apart from memory waste (and minor miscounting of occupied cards) this is benign.

      This is a day one bug afaik.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: