JDK-8244684 : G1 abuses StarTask to also include partial objarray scan tasks
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-05-10
  • Updated: 2020-05-27
  • Resolved: 2020-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b24Fixed
Related Reports
Relates :  
Relates :  
Description
G1 non-full collections use a compact representation of a partial objarray scan, so that normal object scan tasks (oop* and narrowOop*) and partial objarray scan tasks can co-exist in the same taskqueue.  (This is similar to ParallelGC young collections, but differs from G1 full collections, ParallelGC, and SerialGC, which all use ObjArrayTasks segregated into separate queues from the reference tasks.)

The way this is presently implemented involves some nasty type manipulations, using casting between oop and oop* and using misalinged oop* values.  This is so the queues can use the existing StarTask element type, with the oop* from there doing double duty as either an actual oop* or as a partial array scan, depending on an additional low tag bit.  (Which assumes knowledge of the low tag bit used in StarTask.)

We can do better, making the code easier to understand and improving type safety, without affecting performance.  To do so,

(1) add a new class for the partial array tasks,

(2) add a new class for the union of oop*, narrowOop*, and partial array tasks, discriminated based on a 2bit low tag,

(3) and use the new task union class as the element type for the queues.

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/6b9d41cd75e3 User: kbarrett Date: 2020-05-14 12:53:51 +0000
14-05-2020

It seems that ParallelGC does something similar; see PSPromotionManager::mask_chunked_array_oop and friends.
10-05-2020