RFR: 8324649: Shenandoah: refactor implementation of free set [v2]

William Kemper wkemper at openjdk.org
Fri Jan 26 20:44:34 UTC 2024


On Fri, 26 Jan 2024 19:48:01 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 550:
>> 
>>> 548:   }
>>> 549: 
>>> 550:   if (alloc_capacity(r) < PLAB::min_size() * HeapWordSize) {
>> 
>> Why not `TLAB::min_size`?
>
> Good question.  You've caused me to dig a little to respond:
> 
> size_t PLAB::min_size() {
>   // Make sure that we return something that is larger than AlignmentReserve                                                                                 
>   return align_object_size(MAX2(MinTLABSize / HeapWordSize, (size_t)oopDesc::header_size())) + CollectedHeap::lab_alignment_reserve();
> }
> 
> There is no TLAB::min_size() as far as I can tell.  There is MinTLABSize (default 2K unless redefined on command line), but that value appears to get rounded up by alignment in the definition of PLAB::min_size().  I think PLAB:min_size() is what we want here (and elsewhere within this source file).
> 
> What do you think?

Interesting. Yeah, that looks like what we want.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17561#discussion_r1468127344


More information about the shenandoah-dev mailing list