openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

Loom: GC collection of Continuations

Open LinHu2016 opened this issue 2 years ago • 1 comments

Virtual threads are not part of the root set. They are only alive if they are mounted on a carrier thread or if there is a strong reference to them (ie scheduler, blocking queue, etc.)

GC would maintain a "global continuation Object List", via function continuationObjectCreated() add the Continuation Object into the list, refresh the list during clearable phase of GC(walk through the old list, rebuild the new list for survived Continuation Objects, clean up (free/recycle related J9vmContinuation structure) the dead Objects, also provide an iterating callback for vm/jvmti/ddr usage.

- new vm-gc api j9mm_iterate_all_continuation_objects(),
continuationObjectCreated()
- the Continuation Object List is designed as the similar way as
 Unfinalized Object List.
 via hidden field continuationLink to connect next Continuation Obj
 Thread base buffer for reducing thread contention
 an array of the lists per region for maximum parallel processing
 and avoiding unnecessary processing

- for fix-up and compaction case(there is no clean-up), the rebuilding
the list has optimized to piggy-back scanning processing.
- for scavenge back-out, if the related J9vmContinuation structure has
been cleaned up, there is no rollback for J9vmContinuation, but the
vmref, which points to J9vmContinuation would remain NULL.

#depends on https://github.com/eclipse-openj9/openj9/pull/15603 #fix: https://github.com/eclipse-openj9/openj9/issues/15180

Signed-off-by: Lin Hu [email protected]

LinHu2016 avatar Jul 25 '22 17:07 LinHu2016

@amicic @dmitripivkine please review the changes, Thanks

LinHu2016 avatar Jul 27 '22 15:07 LinHu2016

personal build: https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/14116/

LinHu2016 avatar Sep 08 '22 15:09 LinHu2016

Jenkins sanity all jdk17

amicic avatar Sep 13 '22 13:09 amicic

Jenkins test sanity all jdk17

amicic avatar Sep 13 '22 13:09 amicic

Sanity tests just prior last minor commit were all green: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/2675/

amicic avatar Sep 13 '22 21:09 amicic