G1: Missing load_acquire() in G1 allocation path

XMLWordPrintable

    • gc
    • master

      In G1AllocRegion::attempt_allocation(size_t, size_t, size_t) it looks like the read to _alloc_region misses a load_acquire, as the subsequent G1HeapRegion::par_allocate() reads `_top` and `_end` from the `G1HeapRegion` instance. These may be a mix of the new values and the ones from the dummy region (or earlier regions?), and in case we get an `end()` < `top()`, g1 will allocate wrongly.

      There is a storestore when doing the `G1AllocRegion::update_alloc_region()` call, but the reader side seems to miss synchronization.

      There may be a similar argument to accesses to `MutatorAllocRegion::_retained_alloc_region`.

      There are no known failures due to that (or assertion failures that would trigger in that case).

      Does not affect x86.

            Assignee:
            Thomas Schatzl
            Reporter:
            Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: