RFR: 8210857: Allow retiring TLABs and collecting statistics in parallel

Per Liden per.liden at oracle.com
Tue Sep 18 20:13:56 UTC 2018

There is currently no good way of retiring TLABs and collecting their 
statistics in parallel. The current code for doing this also traverses 
the thread list twice, which is unnecessary. I propose that we adjust 
the TLAB API to allow this to be done in parallel, in a single pass.

A few notes on this patch:

* The GlobalTLABStats class is restructured into the 
ThreadLocalAllocStats class to allow for a more flexible way of 
collected statistics when retiring TLABs (flexible in the sense that it 
allows for parallel operations).

* The TLAB API is slightly adjusted. The "make_parsable(bool 
retire_tlab)" is broken into two functions, "make_parsable()" to just 
make a TLAB parsable, and "retire(ThreadLocalAllocStats* stats)" to 
retire and optionally collects statistics.

* GCs are unaffected by this change, in the sense that they continue to 
call CollectedHeap::ensure_parsability(). However, all GCs will benefit 
from now doing a single pass over the thread list instead of two to 
retire and collect stats.

* This is the last patch in my series of TLAB related patches. The 
remaining patches only touch ZGC to actually retire/resize/remap TLABs 
in parallel.

Bug: https://bugs.openjdk.java.net/browse/JDK-8210857
Webrev: http://cr.openjdk.java.net/~pliden/8210857/webrev.0


More information about the hotspot-gc-dev mailing list