RFR: 8376531: Genshen: Missing volatile modifier on multiple fields of ShenandoahOldGeneration [v2]

Xiaolong Peng xpeng at openjdk.org
Tue Jan 27 23:49:18 UTC 2026


> 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
> - [ ] GHA

Xiaolong Peng has updated the pull request incrementally with one additional commit since the last revision:

  Use `1UL` instead of `static_cast<size_t>(1)`

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29456/files
  - new: https://git.openjdk.org/jdk/pull/29456/files/e6087ad1..76675c54

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29456&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29456&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/29456.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29456/head:pull/29456

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


More information about the hotspot-gc-dev mailing list