RFR: 8336463: Parallel: Add PSOldGen::expand_and_allocate

Zhengyu Gu zgu at openjdk.org
Tue Jul 16 14:41:51 UTC 2024


On Tue, 16 Jul 2024 14:00:06 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psOldGen.cpp line 129:
>> 
>>> 127:     expand(word_size*HeapWordSize);
>>> 128:   }
>>> 129:   return cas_allocate_noexpand(word_size);
>> 
>> This implies a race and `cas_allocate_noexpand()` can fail prematurely due to the race. Is it an acceptable case?
>
> Can you elaborate what are racing here?

Okay, let me ask in a different way: why use `cas_allocate_noexpand()` here, which implies there may be other threads (e.g. GC threads) that may perform allocation concurrently at this moment?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20189#discussion_r1679541551


More information about the hotspot-gc-dev mailing list