RFR: 8374679: ZGC: Convert zForwardingAllocator to use Atomic<T>

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Jan 14 08:36:20 UTC 2026


Convert usages of AtomicAccess to Atomic<T> in zForwardingAllocator.

We currently use  plain loads and stores which are synchronised and ordered with respect to the allocation by means of us starting worker threads which allocate and awaiting them to finish. This patch changes everything to have atomic semantics, but the loads and stores are still relaxed. 

Testing:
 * GHA
 * HotSpot GC tests with ZGC linux x64 and linux aarch64

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

Commit messages:
 - ZGC: Convert zForwardingAllocator to use Atomic<T>

Changes: https://git.openjdk.org/jdk/pull/29221/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29221&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374679
  Stats: 12 lines in 3 files changed: 2 ins; 1 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/29221.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29221/head:pull/29221

PR: https://git.openjdk.org/jdk/pull/29221


More information about the hotspot-gc-dev mailing list