RFR: 8375643: G1: Convert G1RegionMarkStatsCache to use Atomic<T>

Thomas Schatzl tschatzl at openjdk.org
Tue Jan 20 10:40:21 UTC 2026


On Tue, 20 Jan 2026 10:16:27 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this change to make `G1RegionMarkStatsCache` use `Atomic<T>`.
>> 
>> The only unusual part is that I added two getters to that class to avoid the repeated `.load_relaxed()` typing.
>> 
>> Testing: gha
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp line 124:
> 
>> 122:   void inc_incoming_refs(uint region_idx) {
>> 123:     G1RegionMarkStatsCacheEntry* const cur = find_for_add(region_idx);
>> 124:     cur->_stats._incoming_refs.store_relaxed(cur->_stats.incoming_refs() + 1u);
> 
> Same, `add_then_fetch`?

See above.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29303#discussion_r2707763600


More information about the hotspot-gc-dev mailing list