RFR: 8345217: Parallel: Refactor PSParallelCompact::next_src_region

Thomas Schatzl tschatzl at openjdk.org
Mon Dec 2 10:00:39 UTC 2024


On Thu, 28 Nov 2024 15:22:33 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple removing some unnecessary calculations in locating the next source-region during full-gc.
> 
> Test: tier1-5

I think I understood the changes, I added this understanding, hopefully making it easier for other reviewers.

src/hotspot/share/gc/parallel/psParallelCompact.cpp line 2142:

> 2140:     // Found the first non-empty region in the same space.
> 2141:     src_region_idx = sd.region(src_region_ptr);
> 2142:     closure.set_source(sd.region_to_addr(src_region_idx));

Just to make sure I understand: the only change here is the removal of the condition `src_region_addr > closure.source()` because at worst we can set the same value into `closure._source` anyway, and the additional check is kind of superfluous.

src/hotspot/share/gc/parallel/psParallelCompact.cpp line 2169:

> 2167:         src_space_id = SpaceId(space_id);
> 2168:         src_space_top = top;
> 2169:         closure.set_source(region_start_addr);

The reason for removing the search for the first live word is because all callers will scan the bitmap anyway?

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

Marked as reviewed by tschatzl (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22441#pullrequestreview-2472240795
PR Review Comment: https://git.openjdk.org/jdk/pull/22441#discussion_r1865554912
PR Review Comment: https://git.openjdk.org/jdk/pull/22441#discussion_r1865555787


More information about the hotspot-gc-dev mailing list