# HG changeset patch # User ysr # Date 1264553549 28800 # Node ID 34fb2662f6c271233eeec7bc033e7fceb71ba8c8 # Parent c81fa70144aad60fb933530e033f8152e4658c12 6920090: G1: Disable ReduceInitialCardMarks at least until 6920109 is fixed Summary: G1 now answers "no" to the query can_elide_initializing_store_barrier() in the product build. A debug flag allows alternate behaviour in debug builds. Reviewed-by: iveresov, tonyp diff -r c81fa70144aa -r 34fb2662f6c2 src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Mon Jan 25 18:03:29 2010 -0500 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Jan 26 16:52:29 2010 -0800 @@ -1004,7 +1004,12 @@ // storage in the heap comes from a young region or not. // See ReduceInitialCardMarks. virtual bool can_elide_tlab_store_barriers() const { - return true; + // 6920090: Temporarily disabled, because of lingering + // instabilities related to RICM with G1. In the + // interim, the option ReduceInitialCardMarksForG1 + // below is left solely as a debugging device at least + // until 6920109 fixes the instabilities. + return ReduceInitialCardMarksForG1; } virtual bool card_mark_must_follow_store() const { @@ -1026,6 +1031,8 @@ // However, non-generational G1 (-XX:-G1Gen) appears to have // bit-rotted so was not tested below. virtual bool can_elide_initializing_store_barrier(oop new_obj) { + // Re 6920090, 6920109 above. + assert(ReduceInitialCardMarksForG1, "Else cannot be here"); assert(G1Gen || !is_in_young(new_obj), "Non-generational G1 should never return true below"); return is_in_young(new_obj); diff -r c81fa70144aa -r 34fb2662f6c2 src/share/vm/gc_implementation/g1/g1_globals.hpp --- a/src/share/vm/gc_implementation/g1/g1_globals.hpp Mon Jan 25 18:03:29 2010 -0500 +++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp Tue Jan 26 16:52:29 2010 -0800 @@ -291,6 +291,10 @@ "a particular entry exceeds this value.") \ \ develop(bool, G1VerifyCTCleanup, false, \ - "Verify card table cleanup.") + "Verify card table cleanup.") \ + \ + develop(bool, ReduceInitialCardMarksForG1, false, \ + "When ReduceInitialCardMarks is true, this flag setting " \ + " controls whether G1 allows the RICM optimization") G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG) diff -r c81fa70144aa -r 34fb2662f6c2 src/share/vm/gc_interface/collectedHeap.cpp --- a/src/share/vm/gc_interface/collectedHeap.cpp Mon Jan 25 18:03:29 2010 -0500 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Tue Jan 26 16:52:29 2010 -0800 @@ -66,7 +66,8 @@ // Used for ReduceInitialCardMarks (when COMPILER2 is used); // otherwise remains unused. #ifdef COMPLER2 - _defer_initial_card_mark = ReduceInitialCardMarks && (DeferInitialCardMark || card_mark_must_follow_store()); + _defer_initial_card_mark = ReduceInitialCardMarks && can_elide_tlab_store_barriers() + && (DeferInitialCardMark || card_mark_must_follow_store()); #else assert(_defer_initial_card_mark == false, "Who would set it?"); #endif