RFR: Make sure bitmap is marked incomplete before bitmap resets

Aleksey Shipilev shade at redhat.com
Wed Sep 19 10:07:09 UTC 2018


ShHeap::mark_incomplete_marking_context() appears to be unused. It was supposed to mark the context
as incomplete, so that ShHeap::complete_marking_context() would assert in erroneous conditions.
Except that I forgot to actually call it.

This patch puts it where it belongs, and does a few other asserts to verify the placement:

diff -r 4a4a23717517 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Wed Sep 19 11:42:05 2018 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Wed Sep 19 11:52:55 2018 +0200
@@ -432,4 +432,5 @@
 void ShenandoahHeap::reset_mark_bitmap() {
   assert_gc_workers(_workers->active_workers());
+  mark_incomplete_marking_context();

   ShenandoahResetBitmapTask task;
@@ -1471,4 +1472,5 @@

   assert(marking_context()->is_bitmap_clear(), "need clear marking bitmap");
+  assert(!marking_context()->is_complete(), "should not be complete");

   if (ShenandoahVerify) {
diff -r 4a4a23717517 src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp Wed Sep 19 11:42:05 2018 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp Wed Sep 19 11:52:55 2018 +0200
@@ -109,4 +109,5 @@
     heap->reset_mark_bitmap();
     assert(heap->marking_context()->is_bitmap_clear(), "sanity");
+    assert(!heap->marking_context()->is_complete(), "sanity");

     // d. Abandon reference discovery and clear all discovered references.
diff -r 4a4a23717517 src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp Wed Sep 19 11:42:05 2018 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp Wed Sep 19 11:52:55 2018 +0200
@@ -382,4 +382,5 @@

   assert(_heap->marking_context()->is_bitmap_clear(), "need clean mark bitmap");
+  assert(!_heap->marking_context()->is_complete(), "should not be complete");

   ShenandoahFreeSet* free_set = _heap->free_set();

Testing: tier3_gc_shenandoah

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list