RFR: 8344665: Refactor PartialArrayState allocation for reuse [v4]

Kim Barrett kbarrett at openjdk.org
Tue Dec 3 15:53:43 UTC 2024


On Tue, 3 Dec 2024 15:15:10 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove phase invariant checks
>
> src/hotspot/share/gc/shared/partialArrayState.cpp line 96:
> 
>> 94: 
>> 95: void PartialArrayStateAllocator::release(PartialArrayState* state) {
>> 96:   size_t refcount = Atomic::sub(&state->_refcount, size_t(1), memory_order_release);
> 
> Could you explain why `release` order is needed here?

This is part of the usual reference counting dance. Except, where did the
acquire disappear to? There should be an acquire on the refcount == 0 branch!
Looks like I accidentally deleted it. Sigh. Not too surprisingly, lots of
tests were run without noticing that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22287#discussion_r1867980602


More information about the hotspot-gc-dev mailing list