[jdk16] RFR: 8258985: Parallel WeakProcessor may use too few threads [v2]

Kim Barrett kim.barrett at oracle.com
Fri Jan 8 13:18:35 UTC 2021


> On Jan 8, 2021, at 8:01 AM, Albert Mingkun Yang <ayang at openjdk.java.net> wrote:
> 
> On Fri, 8 Jan 2021 12:45:12 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> 
>>> Lgtm although the comments in the documentation for both `static void weak_oops_do` method declarations mentions:
>>> 
>>>  // Parallel version.  Uses ergo_workers(), active workers, and
>>>  // phase_time's max_threads to determine the number of threads to use.
>>> which should be fixed.
>>> 
>>> One option is to put something like "Uses max workers and the total number of weak references to determine the number of threads to use" as description for `ergo_workers` and remove the details in the description of the `weak_oops_do` descriptions, but just removing the mention of `active_workers` there could be fine too.
>> 
>> Thanks @tschatzl . I've updated the descriptions of the weak_oops_do functions, and also added a description for ergo_workers.
> 
> What's the argument for using `total_workers()` here? BTW, `G1ConcurrentMark::weak_refs_work` is in the caller chain. According to its name, it happens outside a pause.

active_workers is semi-random from the POV of being used here.  It’s value is whatever
was set by the last call to update_active_workers, which was probably for some entirely
different usage context.  Using total_workers is consistent with, for example,
ReferenceProcessor usage by G1 and ParallelGC.

weak_refs_work is called in the remark pause.

> -------------
> 
> PR: https://git.openjdk.java.net/jdk16/pull/75





More information about the hotspot-gc-dev mailing list