Skip to content

Commit 82b0276

Browse files
author
tschatzl
committed
8197968: [Backout] JDK-8196883 G1RemSet::refine_card_concurrently doesn't need to check for cards in collection set
Reviewed-by: kbarrett
1 parent 680b2a9 commit 82b0276

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/hotspot/share/gc/g1/g1RemSet.cpp

+16-1
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,20 @@ void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
586586
return;
587587
}
588588

589+
// While we are processing RSet buffers during the collection, we
590+
// actually don't want to scan any cards on the collection set,
591+
// since we don't want to update remembered sets with entries that
592+
// point into the collection set, given that live objects from the
593+
// collection set are about to move and such entries will be stale
594+
// very soon. This change also deals with a reliability issue which
595+
// involves scanning a card in the collection set and coming across
596+
// an array that was being chunked and looking malformed. Note,
597+
// however, that if evacuation fails, we have to scan any objects
598+
// that were not moved and create any missing entries.
599+
if (r->in_collection_set()) {
600+
return;
601+
}
602+
589603
// The result from the hot card cache insert call is either:
590604
// * pointer to the current card
591605
// (implying that the current card is not 'hot'),
@@ -610,7 +624,8 @@ void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
610624

611625
// Check whether the region formerly in the cache should be
612626
// ignored, as discussed earlier for the original card. The
613-
// region could have been freed while in the cache.
627+
// region could have been freed while in the cache. The cset is
628+
// not relevant here, since we're in concurrent phase.
614629
if (!r->is_old_or_humongous()) {
615630
return;
616631
}

0 commit comments

Comments
 (0)