RFR: JDK-8078904 : CMS: Assert failed: Ctl pt invariant

Thomas Schatzl thomas.schatzl at oracle.com
Tue May 19 11:30:40 UTC 2015

Hi Eric,

On Wed, 2015-05-13 at 15:17 -0400, Eric Caspole wrote:
> Hi everybody,
> Could I have a review for fixing JDK-8078904. That is an assert in CMS 
> where the setup of the survivor chunk array used for setting up the CMS 
> rescan did not completely scan all the per-thread chunk arrays. This 
> would happen if the TLAB size is set very large on the cmd line, for 
> example, because of the way the survivor chunk array structures were set 
> up. In product builds this would result in uneven distribution of 
> parallel work where the last task might get 100x as much region to scan 
> as the others.
> The size of those PLABs depends on YoungPLABSize so I changed the setup 
> code to only consider the YoungPLABSize when creating the survivor chunk 
> array. I can see with this change there is even distribution of parallel 
> work in the rescan tasks with various YoungPLABSize and ParallelGCThread 
> count.
> https://bugs.openjdk.java.net/browse/JDK-8078904
> http://cr.openjdk.java.net/~ecaspole/JDK-8078904/00/webrev/

The problem is not the uneven distribution of the work - there is
already enough potential in VM options to shoot yourselves into your own
feet, so another does not really hurt imo.

Also, the actual PLAB size might go below YoungPLABSize due to resizing
in both CMS and G1(!), so the size of the array will not be sufficient
anyway, leading to the same problem, just not at startup.

The issue is that YoungPLABSize and PLAB[Stats]::min_size() (e.g.
MinTLABSize) are not synchronized.

I.e. with this change, if you set YoungPLABSize to something larger than
MinTLABSize, the arrays are not sufficient.
Without this change, the same error occurs if YoungPLABSize is set to
something smaller than MinTLABSize.

The only solution to prevent either problem is to guarantee that at
initialization, before the first PLABs are allocated, YoungPLABSize (and
also OldPLABSize!) is within [PLAB::min_size(), PLAB::max_size()] (not
sure about whether the upper bound can be inclusive, please check), and
simply use PLAB[Stats]::min_size() as

Also, PLAB::desizred_sz() should always return a value within
PLAB::min_size(), PLAB::max_size()].

The change should also verify that PLAB::max_size() >= PLAB::min_size().


More information about the hotspot-gc-dev mailing list