8274264: Not all of G1 young collection verification honors the verification type

Reviewed-by: ayang, tschatzl
(cherry picked from commit 34a92466a6)
This commit is contained in:
Ahmed Muhsin
2023-03-09 09:39:39 +00:00
committed by Vitaly Provodin
parent 2eb2c301ae
commit 3cd14b6e28
4 changed files with 27 additions and 15 deletions

View File

@@ -970,8 +970,11 @@ void G1CollectedHeap::verify_before_full_collection(bool explicit_gc) {
if (!VerifyBeforeGC) {
return;
}
if (!G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull)) {
return;
}
_verifier->verify_region_sets_optional();
_verifier->verify_before_gc(G1HeapVerifier::G1VerifyFull);
_verifier->verify_before_gc();
_verifier->verify_bitmap_clear(true /* above_tams_only */);
}
@@ -1009,9 +1012,12 @@ void G1CollectedHeap::verify_after_full_collection() {
if (!VerifyAfterGC) {
return;
}
if (!G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull)) {
return;
}
_hrm.verify_optional();
_verifier->verify_region_sets_optional();
_verifier->verify_after_gc(G1HeapVerifier::G1VerifyFull);
_verifier->verify_after_gc();
_verifier->verify_bitmap_clear(false /* above_tams_only */);
// At this point there should be no regions in the
@@ -2596,11 +2602,14 @@ void G1CollectedHeap::verify_before_young_collection(G1HeapVerifier::G1VerifyTyp
if (!VerifyBeforeGC) {
return;
}
if (!G1HeapVerifier::should_verify(type)) {
return;
}
Ticks start = Ticks::now();
_verifier->prepare_for_verify();
_verifier->verify_region_sets_optional();
_verifier->verify_dirty_young_regions();
_verifier->verify_before_gc(type);
_verifier->verify_before_gc();
verify_numa_regions("GC Start");
phase_times()->record_verify_before_time_ms((Ticks::now() - start).seconds() * MILLIUNITS);
}
@@ -2609,8 +2618,11 @@ void G1CollectedHeap::verify_after_young_collection(G1HeapVerifier::G1VerifyType
if (!VerifyAfterGC) {
return;
}
if (!G1HeapVerifier::should_verify(type)) {
return;
}
Ticks start = Ticks::now();
_verifier->verify_after_gc(type);
_verifier->verify_after_gc();
verify_numa_regions("GC End");
_verifier->verify_region_sets_optional();
phase_times()->record_verify_after_time_ms((Ticks::now() - start).seconds() * MILLIUNITS);

View File

@@ -1071,14 +1071,14 @@ void G1ConcurrentMark::verify_during_pause(G1HeapVerifier::G1VerifyType type,
const char* caller = verify_location_string(location);
if (VerifyDuringGC) {
if (VerifyDuringGC && G1HeapVerifier::should_verify(type)) {
GCTraceTime(Debug, gc, phases) debug(caller, _gc_timer_cm);
size_t const BufLen = 512;
char buffer[BufLen];
jio_snprintf(buffer, BufLen, "During GC (%s)", caller);
verifier->verify(type, VerifyOption::G1UseConcMarking, buffer);
verifier->verify(VerifyOption::G1UseConcMarking, buffer);
// Only check bitmap in Remark, and not at After-Verification because the regions
// already have their TAMS'es reset.

View File

@@ -551,19 +551,19 @@ void G1HeapVerifier::prepare_for_verify() {
}
}
void G1HeapVerifier::verify(G1VerifyType type, VerifyOption vo, const char* msg) {
if (should_verify(type) && _g1h->total_collections() >= VerifyGCStartAt) {
void G1HeapVerifier::verify(VerifyOption vo, const char* msg) {
if (_g1h->total_collections() >= VerifyGCStartAt) {
prepare_for_verify();
Universe::verify(vo, msg);
}
}
void G1HeapVerifier::verify_before_gc(G1VerifyType type) {
verify(type, VerifyOption::G1UseConcMarking, "Before GC");
void G1HeapVerifier::verify_before_gc() {
verify(VerifyOption::G1UseConcMarking, "Before GC");
}
void G1HeapVerifier::verify_after_gc(G1VerifyType type) {
verify(type, VerifyOption::G1UseConcMarking, "After GC");
void G1HeapVerifier::verify_after_gc() {
verify(VerifyOption::G1UseConcMarking, "After GC");
}
void G1HeapVerifier::verify_bitmap_clear(bool from_tams) {

View File

@@ -66,9 +66,9 @@ public:
void verify_region_sets_optional() { DEBUG_ONLY(verify_region_sets();) }
void prepare_for_verify();
void verify(G1VerifyType type, VerifyOption vo, const char* msg);
void verify_before_gc(G1VerifyType type);
void verify_after_gc(G1VerifyType type);
void verify(VerifyOption vo, const char* msg);
void verify_before_gc();
void verify_after_gc();
void verify_bitmap_clear(bool above_tams_only);