RFR: 8274987 G1: reuse the newly allocated G1SegmentedArrayBuffer even if current thread failed the race [v3]

Hamlin Li mli at openjdk.java.net
Thu Oct 21 04:01:05 UTC 2021


On Wed, 20 Oct 2021 09:48:35 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> This is a follow-up of JDK-8273626.
>> 
>> Current (original) implementation just drops the newly allocated G1SegmentedArrayBuffer if current thread fails race, but seems reuse (e.g adding to freelist) will bring some benefit.
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix cransh on Mac; remove unnecessary code

src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp line 144:

> 142:     next->set_next(nullptr);
> 143:     // reuse the newly allocated or poped buffer by adding it into free buffer list.
> 144:     _free_buffer_list->add(*next);

Should we add GlobalCounter::write_synchronize() here?

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

PR: https://git.openjdk.java.net/jdk/pull/6034



More information about the hotspot-gc-dev mailing list