RFR: 8301116: Parallelize TLAB resizing in G1 [v2]

Albert Mingkun Yang ayang at openjdk.org
Mon Feb 6 08:45:01 UTC 2023


On Thu, 2 Feb 2023 10:38:02 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I get reviews for this change that moves TLAB resizing into the second parallel post evacuation phase?
>> 
>> The change is fairly straightforward except maybe for the following:
>> * there is a new claimer for `JavaThreads` because the `Threads::possibly_parallel_threads_do` method to parallelize does not work well with very little per-thread work. Actually with a moderate amount of threads (~20) performance would already be many times slower than doing things serially.
>> * moving the TLAB resizing out of `G1CollectedHeap::prepare_tlabs_for_mutator` made that method and the enclosing timing a bit obsolete, so I repurposed it as a "do preparatory work for the mutator during young gc" phase. That resulted in minor cleanup and regularization of what is done during that phase (wrt to what the corresponding method for full gc does).
>> 
>> Testing: gha, local perf testing, tier1
>> 
>> Thanks,
>>   Thomas
>
> Thomas Schatzl has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - fix indentation :(
>  - daholmes review, remove unnecessary change

Two minor suggestions:

1. I think "inlining" the logic of `G1JavaThreadsListClaimer` makes the flow in the caller more transparent.

2. `ResizeThreadLABs` -> `ResizeTLABs`, just to be consistent with other *TLAB occurrences.

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

Marked as reviewed by ayang (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12360


More information about the hotspot-gc-dev mailing list