G1: refine G1CollectedHeap::par_iterate_regions_array_part_from

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 18
    • Affects Version/s: 18
    • Component/s: hotspot
    • gc
    • b15

      G1CollectedHeap::par_iterate_regions_array_part_from is moved from G1CollectionSet::iterate_part_from in JDK-8254167.
      The parameters and logic of this method could be refined a bit to make it more straight.

      "This method essentially apply a closure to all elements in [offset, length) of regions. I wonder if we can pass &regions[offset] and length-offset to this method. Then this method can work on the whole array, and figuring out the starting index for each worker becomes trivial, worker_id * array_len / #workers. It's not obvious to me why the calculation in this patch guarantees balanced start index."

            Assignee:
            Hamlin Li
            Reporter:
            Hamlin Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: