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

Improve G1CardSetInlinePtr::add()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b11

      Description

      Currently the method to add entries to the inline pointers is somewhat inefficient:

        // Check if the card is already stored in the pointer.
        if (contains(card_idx, bits_per_card)) {
          return Found;
        }
        // Check if there is actually enough space.
        if (card_pos_for(num_elems + 1, bits_per_card) >= BitsInValue) {
          return Overflow;
        }

      I.e. contains() could actually return how many elements are already in the card set container.
      Also, in the cmpxchg loop we start work looking for whether the element is already stored in there always from the beginning. That's not necessary, there is no overwriting of already inserted values in the inline pointer, only the recently added ones need to be looked at again.

      Improve this.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iwalulya Ivan Walulya
              Reporter:
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: