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

Thomas Schatzl tschatzl at openjdk.java.net
Fri Jan 8 11:29:02 UTC 2021


On Fri, 1 Jan 2021 10:02:10 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this fix to the parallel WeakProcessor's computation of the
> number of worker threads to use.  It was previously limited by the current
> value of active_workers(), whatever that happens to be.  It should be
> limited by total_workers(), just as with the parallel ReferenceProcessor.
> (Both are subject to ReferencesPerThread.)
> 
> Testing
> mach5 tier1
> Some hand testing (Linux-x64) to verify the expected number of threads are
> being used.
> 
> Note: That hand testing suggests some further tuning of ReferencesPerThread
> might be in order. With the current default of 1000, I often saw in testing
> that some threads were started late enough that no work was left for them.
> I'll file a separate RFE for that.

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.

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

Marked as reviewed by tschatzl (Reviewer).

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



More information about the hotspot-gc-dev mailing list