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 09:20:09 UTC 2021


On Thu, 21 Oct 2021 08:08:23 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> 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? If it's true, I'm a little bit concern about the performance.
>
> I think you are right about needing `write_synchronize` here - I mixed this up with `G1CardSetAllocator` which has the intermediate `_pending_list` to avoid excessive `write_synchronize` calls.
> 
> If you think this is too expensive (it might well be!), let's just keep the `delete` for now. We can revisit this change when we have more measurements about this.
> 
> Thanks,
>   Thomas

Got it, Thanks

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

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



More information about the hotspot-gc-dev mailing list