RFR: 8369814: G1: Relax card mark and store ordering [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue Oct 14 11:48:05 UTC 2025


On Tue, 14 Oct 2025 11:27:20 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more.
>> 
>> Test: tier1-5
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/shared/cardTableBarrierSet.cpp line 116:

> 114:   }
> 115:   if (new_obj->is_typeArray() || _card_table->is_in_young(new_obj)) {
> 116:     // Arrays of non-references don't need a post-barrier.

Pre-existing: Maybe `CardTable::is_in_young()` can be made `protected` instead of `public`.

src/hotspot/share/gc/shared/cardTableBarrierSet.cpp line 117:

> 115:   if (new_obj->is_typeArray() || _card_table->is_in_young(new_obj)) {
> 116:     // Arrays of non-references don't need a post-barrier.
> 117:     // The deferred_card_mark region should be empty

The `Thread::_deferred_card_mark` member and related can also be removed, because nobody writes to it afaict.

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

PR Review: https://git.openjdk.org/jdk/pull/27794#pullrequestreview-3335148410
PR Review Comment: https://git.openjdk.org/jdk/pull/27794#discussion_r2428845167
PR Review Comment: https://git.openjdk.org/jdk/pull/27794#discussion_r2428847124


More information about the hotspot-gc-dev mailing list