RFR: Fix allocate aligned [v3]

Kelvin Nilsen kdnilsen at openjdk.org
Thu Jan 5 14:19:25 UTC 2023


On Thu, 5 Jan 2023 07:59:06 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:
>> 
>>   Remove redundant test for result != nullptr
>
> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 317:
> 
>> 315:       assert(result != nullptr, "Allocation cannot fail");
>> 316:       assert(r->top() <= r->end(), "Allocation cannot span end of region");
>> 317:       assert(req.actual_size() % CardTable::card_size_in_words() == 0, "PLAB start must align with card boundary");
> 
> "PLAB should be card size multiple"
> 
> (the next assert checks alignment)

This allows us to register objects in PLABs without acquiring a lock.  Otherwise, we need a lock because two threads might be registering objects within the same card in parallel.

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

PR: https://git.openjdk.org/shenandoah/pull/192


More information about the shenandoah-dev mailing list