RFR: Implement arraycopy post-processing in GC threads for Traversal GC
Roman Kennke
rkennke at redhat.com
Tue Jun 19 08:05:34 UTC 2018
This implements an optimization for arraycopy/clone post-processing for
Traversal GC. The idea is that what our arraycopy/clone post-barrier
does for Traversal GC is exactly the same that GC threads do for any
object or array: load-ref, evac(for cset), mark, store-ref. This means
that instead of processing the array/clone in-place (and delaying
mutators with yet another sweep over the array/obj), we can offload that
task to the GC.
This implementation is very simple: it adds a shared+locked queue
(GrowableArray-based), the post-barriers push appropriate tasks there if
size of array/object exceeds a certain threshold, GC threads query the
queue regularily (much the same as SATB queues) and process them.
The threshold is chosen so that traffic on this queue is low-ish to
avoid contention on the lock, but still offload significant tasks to GC.
It doesn't seem worth to do the hassle for small objects.
This makes arraycopy+clone effectively a constant operation GC-wise
(still got the actual copy to do though, which is obviously O(n) )
http://cr.openjdk.java.net/~rkennke/traversal-arraycopy/webrev.01/
Testing: passes tier3_gc_shenandoah
WDYT?
Roman
More information about the shenandoah-dev
mailing list