RFR: 8375541: G1: Race in G1BarrierSet::write_ref_field_post()

Thomas Schatzl tschatzl at openjdk.org
Tue Jan 20 08:23:49 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

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

Commit messages:
 - 8375541

Changes: https://git.openjdk.org/jdk/pull/29311/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29311&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8375541
  Stats: 5 lines in 1 file changed: 4 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