RFR (XS) 8212005: Epsilon elastic TLAB sizing may cause misalignment

Per Liden per.liden at oracle.com
Thu Oct 11 10:03:58 UTC 2018


On 10/11/2018 12:00 PM, Aleksey Shipilev wrote:
> On 10/11/2018 11:48 AM, Per Liden wrote:
>> I think you want to make sure that _max_tlab_size also ends up being aligned to MinObjectAlignment
>> here:
>>
>>    50   _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), EpsilonMaxTLABSize / HeapWordSize);
>>
>> Otherwise you risk allocating a TLAB larger than _max_tlab_size here:
>>
>>   214   // Always honor boundaries
>>   215   size = MAX2(min_size, MIN2(_max_tlab_size, size));
>>   216
>>   217   // Always honor alignment
>>   218   size = align_up(size, MinObjAlignment);
>>
>> Right?
> 
> Right. Or this means that EpsilonMaxTLABSize has to be additionally checked for alignment before
> use. If EpsilonMaxTLABSize is proper, then size is always aligned too, even if it gets capped by
> _max_tlab_size, right?

Right.

> 
> Unfortunately, I have already pushed the fix, and can follow up on this in a separate RFE.

Ok.

/Per


More information about the hotspot-gc-dev mailing list