RFR: 8375541: G1: Race in G1BarrierSet::write_ref_field_post() [v3]

Thomas Schatzl tschatzl at openjdk.org
Wed Jan 21 14:02:31 UTC 2026


> Hi all,
> 
>   during conversion of card table code to use `Atomic<T>` I think I found the following error: the code in `G1BarrierSet::write_ref_field_post` is wrong in that it allows reload of the `_card_table` value, which is exactly what the existing code imo wrongly fails to ensure. even if it does not, making the load explicit improves reading.
> 
> To not let this change get lost in that conversion, and potentially for backport to 26, I factored it out in this change.
> 
> There is no known issue caused by this code in particular, one other bug I'm working on that just looks like what could be caused by this is not fixed.
> 
> Testing: gha
> 
> Thanks,
>   Thomas

Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:

  * walulyai review

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29311/files
  - new: https://git.openjdk.org/jdk/pull/29311/files/36e1b2bb..07e3f385

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

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

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


More information about the hotspot-gc-dev mailing list