Integrated: 8376531: Genshen: Convert ShenandoahOldGeneration to use Atomic<T>
Xiaolong Peng
xpeng at openjdk.org
Wed Jan 28 21:31:30 UTC 2026
On Tue, 27 Jan 2026 22:19:15 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
> Came across the source code of ShenandoahOldGeneration, and noticed that we use AtomicAccess to read/write to fields `_promoted_expended`, `_promotion_failure_count`, `_promotion_failure_words` but non of them is declared with volatile modifier.
>
> Given that OpenJDK has introduced `Atomic<T>` to replace the idiom of volatile var plus AtomicAccess:: operations(see details [here](https://bugs.openjdk.org/browse/JDK-8367013), I decided to convert these fields to `Atomic<T>` instead of adding `volatile`.
>
> ### Test
> - [x] hotshpot_gc_shenandoah
> - [x] GHA
This pull request has now been integrated.
Changeset: 09ed8e66
Author: Xiaolong Peng <xpeng at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/09ed8e66dc7a788763a2c7c24f54e93ec8eafedb
Stats: 16 lines in 2 files changed: 0 ins; 0 del; 16 mod
8376531: Genshen: Convert ShenandoahOldGeneration to use Atomic<T>
Reviewed-by: wkemper, shade
-------------
PR: https://git.openjdk.org/jdk/pull/29456
More information about the hotspot-gc-dev
mailing list