RFR: 8345732: Provide helpers for using PartialArrayState

Kim Barrett kbarrett at openjdk.org
Fri Dec 6 23:33:26 UTC 2024


Please review this change that introduces two new helper classes to simplify
the usage of PartialArrayStates to manage splitting the processing of large
object arrays into parallelizable chunks.  G1 and Parallel young GCs are
changed to use this new mechanism.

PartialArrayTaskStats is used to collect and report statistics related to
array splitting.  It replaces the direct implementation in PSPromotionManager,
and is now also used by G1 young GCs.

PartialArraySplitter packages up most of the work involved in splitting and
processing tasks. It provides task allocation and release, enqueuing, chunk
claiming, and statistics tracking. It does this by encapsulating existing
objects and functionality. Using array splitting is mostly reduced to calling
the splitter's start function and then calling it's step function to process
partial states. This substantially reduces the amount of code for each client
to perform this work.

Testing: mach5 tier1-5

Manually ran some test programs with each of G1 and Parallel, with taskqueue
stats logging enabled, and checked that the logged statistics looked okay.

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

Commit messages:
 - parallel uses PartialArraySplitter
 - g1 uses PartialArraySplitter
 - add PartialArraySplitter
 - add PartialArrayTaskStats

Changes: https://git.openjdk.org/jdk/pull/22622/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22622&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8345732
  Stats: 667 lines in 13 files changed: 496 ins; 109 del; 62 mod
  Patch: https://git.openjdk.org/jdk/pull/22622.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22622/head:pull/22622

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


More information about the hotspot-dev mailing list