RFR: 8253286: Use expand_exact() instead of expand_at() for fixed requests in G1

Albert Mingkun Yang ayang at openjdk.java.net
Fri Sep 18 10:54:27 UTC 2020


On Fri, 18 Sep 2020 06:59:34 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> Hi all,
> 
> Please review this small cleanup that uses `expand_exact()` rather than `expand_at()` when requesting a specific
> region. This will ensure that we get exactly the requested region.
> Testing:
> tier1-2 alone and 3-5 with other changes.

src/hotspot/share/gc/g1/heapRegionManager.cpp line 466:

> 464:     HeapRegion *hr = _regions.get_by_index(curr);
> 465:     if (hr == NULL || !is_available(curr)) {
> 466:       expand_exact(curr, 1, NULL);

It seems that the original code handles the expansion failure case, but the new one doesn't. Better to have comments
explaining why expansion should always success here.

It's not covered in this PR, but the documentation for `expand_exact` function is quite abstract, which could also be
addressed in this PR, if you feel like it.

-------------

PR: https://git.openjdk.java.net/jdk/pull/235



More information about the hotspot-gc-dev mailing list