7089625: G1: policy for how many old regions to add to the CSet (when young gen is fixed) is broken
authortonyp
Tue, 13 Sep 2011 12:40:14 -0400
changeset 10535 891f353a95c0
parent 10534 d7fd2e3bfd5d
child 10536 28111f5acd64
7089625: G1: policy for how many old regions to add to the CSet (when young gen is fixed) is broken Summary: When refactoring the code for a previous fix, a condition was not correctly negated which prevents the G1 policy from adding the correct number of old regions to the CSet when the young gen size is fixed. The changeset also fixes a small syntactical issue in g1ErgoVerbose.hpp which is causing compiler warnings. Reviewed-by: brutisso, ysr
hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Sep 09 16:33:13 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Sep 13 12:40:14 2011 -0400
@@ -3042,10 +3042,10 @@
             should_continue = false;
           }
         } else {
-          if (_collection_set_size < _young_list_fixed_length) {
+          if (_collection_set_size >= _young_list_fixed_length) {
             ergo_verbose2(ErgoCSetConstruction,
                           "stop adding old regions to CSet",
-                          ergo_format_reason("CSet length lower than target")
+                          ergo_format_reason("CSet length reached target")
                           ergo_format_region("CSet")
                           ergo_format_region("young target"),
                           _collection_set_size, _young_list_fixed_length);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp	Fri Sep 09 16:33:13 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp	Tue Sep 13 12:40:14 2011 -0400
@@ -58,7 +58,7 @@
   // ErgoLow is 0 so that we don't have to explicitly or a heuristic
   // id with ErgoLow to keep its use simpler.
   ErgoLow = 0,
-  ErgoHigh = 1 << ErgoLevelShift,
+  ErgoHigh = 1 << ErgoLevelShift
 } ErgoLevel;
 
 // The available heuristics.