RFR: 8371284: GenShen: Avoid unnecessary card marking [v2]

Aleksey Shipilev shade at openjdk.org
Mon Nov 10 11:43:04 UTC 2025


On Fri, 7 Nov 2025 23:09:47 GMT, Nityanand Rai <duke at openjdk.org> wrote:

>> Exclude young-young, old-old and honor UseCondCardMark in dirty card marking.
>
> Nityanand Rai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   early return of oop is null

Generally looks fine, just tighten up the comments.

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 197:

> 195:   if (_heap->is_in_young(field)) {
> 196:     return;
> 197:   }

Suggestion:

  if (_heap->is_in_young(field)) {
    // Young field stores do not require card mark.
    return;
  }

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 206:

> 204:   if (!_heap->is_in_young(obj)) {
> 205:     return;
> 206:   }

Suggestion:

  if (!_heap->is_in_young(obj)) {
    // Young object -> old field stores do not require card mark.
    return;
  }

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 207:

> 205:     return;
> 206:   }
> 207:   // Honor UseCondCardMark: check if card is already dirty before writing

Suggestion:

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

PR Review: https://git.openjdk.org/jdk/pull/28204#pullrequestreview-3442710354
PR Review Comment: https://git.openjdk.org/jdk/pull/28204#discussion_r2510147860
PR Review Comment: https://git.openjdk.org/jdk/pull/28204#discussion_r2510152910
PR Review Comment: https://git.openjdk.org/jdk/pull/28204#discussion_r2510153202


More information about the hotspot-gc-dev mailing list