8017070: G1: assert(_card_counts[card_num] <= G1ConcRSHotCardLimit) failed
authorjohnc
Mon, 01 Jul 2013 09:30:23 -0700
changeset 18496 78b3897aa229
parent 18495 65a0d2ae4b22
child 18497 9ff60555fcd3
8017070: G1: assert(_card_counts[card_num] <= G1ConcRSHotCardLimit) failed Summary: The assert is invalid when a card is being refined by two different threads and its count crosses the hot threshold - the refinement count will be updated once by each thread triggering the assert. Remove the assert and update the count using a bounded expression. Reviewed-by: jmasa, tamao, brutisso
hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Sun Jun 30 21:42:07 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Mon Jul 01 09:30:23 2013 -0700
@@ -152,12 +152,9 @@
     if (card_num < _committed_max_card_num) {
       count = (uint) _card_counts[card_num];
       if (count < G1ConcRSHotCardLimit) {
-        _card_counts[card_num] += 1;
+        _card_counts[card_num] =
+          (jubyte)(MIN2((uintx)(_card_counts[card_num] + 1), G1ConcRSHotCardLimit));
       }
-      assert(_card_counts[card_num] <= G1ConcRSHotCardLimit,
-             err_msg("Refinement count overflow? "
-                     "new count: "UINT32_FORMAT,
-                     (uint) _card_counts[card_num]));
     }
   }
   return count;