RFR: 8374692: ZGC: Convert zRemembered to use Atomic<T>

Stefan Karlsson stefank at openjdk.org
Fri Jan 16 09:22:41 UTC 2026


On Fri, 16 Jan 2026 09:04:38 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> Convert usages of AtomicAccess to Atomic<T> in zRemembered.
> 
> Testing:
>  * GHA
>  * HotSpot GC tests with ZGC linux x64 and linux aarch64

Looks good. Added a possible simplification.

src/hotspot/share/gc/z/zRemembered.cpp line 419:

> 417:     }
> 418: 
> 419:     const BitMap::idx_t res = _claimed.compare_exchange(prev, page_index + 1, memory_order_relaxed);

If this were changed to `compare_set` then we could get rid of the `res` local.

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

Marked as reviewed by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29269#pullrequestreview-3669725250
PR Review Comment: https://git.openjdk.org/jdk/pull/29269#discussion_r2697634900


More information about the hotspot-gc-dev mailing list