RFR: 8260574: Remove parallel constructs in GenCollectedHeap::process_roots [v2]

Thomas Schatzl tschatzl at openjdk.java.net
Fri Jan 29 10:06:42 UTC 2021


On Thu, 28 Jan 2021 13:49:05 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> This PR is broken into two commits for easier reviewing, one for removing the usage of `SubTasksDone` in `GenCollectedHeap`, and the other for removing `StrongRootsScope` in the call chain of `GenCollectedHeap::process_roots`.
>> 
>> Tested: hotspot_gc
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   statically known sequential

Marked as reviewed by tschatzl (Reviewer).

src/hotspot/share/gc/serial/serialHeap.cpp line 101:

> 99: 
> 100:   rem_set()->at_younger_refs_iterate();
> 101:   old_gen()->younger_refs_iterate(old_gen_closure, 0);

A more complete fix of this issue (failures when setting `StrongRootsScope::n_threads == 1`) would probably be ripping out this second parameter and see what it ripples down to. This extends quite a bit through to `CardGeneration` and `CardTableRS` since serial gc is the only user of this after CMS removal and the parallel code can be removed.
Feel free to create another CR for this though.

src/hotspot/share/gc/serial/genMarkSweep.cpp line 188:

> 186: 
> 187:     gch->full_process_roots(&srs,
> 188:                             false, // not the adjust phase

The `srs` parameter is also only used to get the number of threads in the callees.
It might be better to remove this parameter similar to the other comment in `serialHeap.cpp` as all that and related code is only used in Serial GC and all the parallel paths here can be removed since CMS is no more.

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

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



More information about the hotspot-gc-dev mailing list