src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 








  25 // Forward decl
  26 class ConcurrentG1RefineThread;
  27 class G1RemSet;
  28 
  29 class ConcurrentG1Refine: public CHeapObj {
  30   ConcurrentG1RefineThread** _threads;
  31   int _n_threads;
  32   int _n_worker_threads;
  33  /*
  34   * The value of the update buffer queue length falls into one of 3 zones:
  35   * green, yellow, red. If the value is in [0, green) nothing is
  36   * done, the buffers are left unprocessed to enable the caching effect of the
  37   * dirtied cards. In the yellow zone [green, yellow) the concurrent refinement
  38   * threads are gradually activated. In [yellow, red) all threads are
  39   * running. If the length becomes red (max queue length) the mutators start
  40   * processing the buffers.
  41   *
  42   * There are some interesting cases (when G1UseAdaptiveConcRefinement
  43   * is turned off):
  44   * 1) green = yellow = red = 0. In this case the mutator will process all


 206 
 207   void clear_and_record_card_counts();
 208 
 209   static int thread_num();
 210 
 211   void print_worker_threads_on(outputStream* st) const;
 212 
 213   void set_green_zone(int x)  { _green_zone = x;  }
 214   void set_yellow_zone(int x) { _yellow_zone = x; }
 215   void set_red_zone(int x)    { _red_zone = x;    }
 216 
 217   int green_zone() const      { return _green_zone;  }
 218   int yellow_zone() const     { return _yellow_zone; }
 219   int red_zone() const        { return _red_zone;    }
 220 
 221   int total_thread_num() const  { return _n_threads;        }
 222   int worker_thread_num() const { return _n_worker_threads; }
 223 
 224   int thread_threshold_step() const { return _thread_threshold_step; }
 225 };




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "memory/cardTableModRefBS.hpp"
  30 #include "runtime/thread.hpp"
  31 #include "utilities/globalDefinitions.hpp"
  32 
  33 // Forward decl
  34 class ConcurrentG1RefineThread;
  35 class G1RemSet;
  36 
  37 class ConcurrentG1Refine: public CHeapObj {
  38   ConcurrentG1RefineThread** _threads;
  39   int _n_threads;
  40   int _n_worker_threads;
  41  /*
  42   * The value of the update buffer queue length falls into one of 3 zones:
  43   * green, yellow, red. If the value is in [0, green) nothing is
  44   * done, the buffers are left unprocessed to enable the caching effect of the
  45   * dirtied cards. In the yellow zone [green, yellow) the concurrent refinement
  46   * threads are gradually activated. In [yellow, red) all threads are
  47   * running. If the length becomes red (max queue length) the mutators start
  48   * processing the buffers.
  49   *
  50   * There are some interesting cases (when G1UseAdaptiveConcRefinement
  51   * is turned off):
  52   * 1) green = yellow = red = 0. In this case the mutator will process all


 214 
 215   void clear_and_record_card_counts();
 216 
 217   static int thread_num();
 218 
 219   void print_worker_threads_on(outputStream* st) const;
 220 
 221   void set_green_zone(int x)  { _green_zone = x;  }
 222   void set_yellow_zone(int x) { _yellow_zone = x; }
 223   void set_red_zone(int x)    { _red_zone = x;    }
 224 
 225   int green_zone() const      { return _green_zone;  }
 226   int yellow_zone() const     { return _yellow_zone; }
 227   int red_zone() const        { return _red_zone;    }
 228 
 229   int total_thread_num() const  { return _n_threads;        }
 230   int worker_thread_num() const { return _n_worker_threads; }
 231 
 232   int thread_threshold_step() const { return _thread_threshold_step; }
 233 };
 234 
 235 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP