-
Task
-
Resolution: Fixed
-
P4
-
repo-shenandoah
-
b02
ReduceInitialCardMarks was introduced around JDK 6 as a means of eliding card-marking barriers for generational collectors for initializing stores to objects. When objects are created in Eden, card marking isn't needed for any of our current collectors (G1's global marking is a more complicated case that I won't consider since it's different from GenShen's SATB). However, if these objects are not allocated in Eden, the card marks are needed for initializing stores. For stop-world collectors, such as Parallel GC or Serial GC, these card marks for initializing stores to objects allocated in the old generation can be deferred until the next subsequent safepoint. This defering allows card-marks to be batched, reducing writes to the card table, although repeated writes to the same card will find it in the L1D$.
In current GenShen code, we use the same controls to elide card marks for initializing writes to objects, which will always start life in the younger Generation by construction/design. Thus, eliding the card marks should be safe, and indeed we should never need to compensate for this elision by deferring the card marks as described above for Serial and Parallel GC which can slow-path-allocate directly into the old generation. The promotion of objects to the old generation by GenShen dirties the cards that have cross-generational pointers.
However, the code for ReduceInitialCardMarks has undergone a few changes since it was first introduced into HotSpot/C2 almost 15 or more years ago, and GenShen uses some aspects of the shared card marking code. We should review the code to understand its current state, determine if it is appropriate in its current form for GenShen to use ReduceInitialCardMarks to elide the card marks for initializing stores, and check if it helps performance.
This ticket is to review its correctness for GenShen, and collect performance data & document any observed benefits or otherwise.
Backlink to Aleksey's review comment that prompted this rereview: https://github.com/openjdk/jdk/pull/21273#discussion_r1839969170
In current GenShen code, we use the same controls to elide card marks for initializing writes to objects, which will always start life in the younger Generation by construction/design. Thus, eliding the card marks should be safe, and indeed we should never need to compensate for this elision by deferring the card marks as described above for Serial and Parallel GC which can slow-path-allocate directly into the old generation. The promotion of objects to the old generation by GenShen dirties the cards that have cross-generational pointers.
However, the code for ReduceInitialCardMarks has undergone a few changes since it was first introduced into HotSpot/C2 almost 15 or more years ago, and GenShen uses some aspects of the shared card marking code. We should review the code to understand its current state, determine if it is appropriate in its current form for GenShen to use ReduceInitialCardMarks to elide the card marks for initializing stores, and check if it helps performance.
This ticket is to review its correctness for GenShen, and collect performance data & document any observed benefits or otherwise.
Backlink to Aleksey's review comment that prompted this rereview: https://github.com/openjdk/jdk/pull/21273#discussion_r1839969170
- relates to
-
JDK-8337511 Implement JEP 404: Generational Shenandoah (Experimental)
- Resolved
- links to
-
Commit(master) openjdk/jdk/a97dca52
-
Review(master) openjdk/jdk/22507