RFR: 8327097: GenShen: Align PLAB sizes down rather than up [v7]

Kelvin Nilsen kdnilsen at openjdk.org
Fri Mar 22 18:00:41 UTC 2024


On Wed, 20 Mar 2024 07:29:55 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix up a few other places where PLAB min size or current size gets set
>>   
>>   This may explain how unaligned sizes were being detected by existing
>>   assertions.
>
> src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp line 46:
> 
>> 44:   inline size_t plab_min_size() { return _min_plab_size; }
>> 45:   inline size_t plab_max_size() { return _max_plab_size; }
>> 46: 
> 
> If we never expect to change min and max, I'd make them const, and set them in the constructor.

Good suggestions.  Done.

> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 1115:
> 
>> 1113:   // available evacuation budget between the many threads that are coordinating in the evacuation effort.
>> 1114:   future_size = MIN2(future_size, generational_heap->plab_max_size());
>> 1115:   assert (future_size % CardTable::card_size_in_words() == 0, "Should align by design");
> 
> You can use
> 
> assert(is_aligned(future_size, CardTable::card_size_in_words(), "Aligned by construction");

Thanks.  Done.

-------------

PR Review Comment: https://git.openjdk.org/shenandoah/pull/401#discussion_r1535986812
PR Review Comment: https://git.openjdk.org/shenandoah/pull/401#discussion_r1535988852


More information about the shenandoah-dev mailing list