< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp

Print this page

 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 #include "precompiled.hpp"
 26 
 27 #include "gc/shared/gc_globals.hpp"
 28 #include "gc/shared/workerPolicy.hpp"
 29 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
 30 #include "runtime/javaThread.hpp"
 31 #include "runtime/threads.hpp"
 32 
 33 uint ShenandoahWorkerPolicy::_prev_par_marking     = 0;
 34 uint ShenandoahWorkerPolicy::_prev_conc_marking    = 0;

 35 uint ShenandoahWorkerPolicy::_prev_conc_evac       = 0;
 36 uint ShenandoahWorkerPolicy::_prev_conc_root_proc  = 0;
 37 uint ShenandoahWorkerPolicy::_prev_conc_refs_proc  = 0;
 38 uint ShenandoahWorkerPolicy::_prev_fullgc          = 0;
 39 uint ShenandoahWorkerPolicy::_prev_degengc         = 0;
 40 uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0;
 41 uint ShenandoahWorkerPolicy::_prev_par_update_ref  = 0;
 42 uint ShenandoahWorkerPolicy::_prev_conc_cleanup    = 0;
 43 uint ShenandoahWorkerPolicy::_prev_conc_reset      = 0;
 44 
 45 uint ShenandoahWorkerPolicy::calc_workers_for_init_marking() {
 46   uint active_workers = (_prev_par_marking == 0) ? ParallelGCThreads : _prev_par_marking;
 47 
 48   _prev_par_marking =
 49     WorkerPolicy::calc_active_workers(ParallelGCThreads,
 50                                       active_workers,
 51                                       Threads::number_of_non_daemon_threads());
 52   return _prev_par_marking;
 53 }
 54 
 55 uint ShenandoahWorkerPolicy::calc_workers_for_conc_marking() {
 56   uint active_workers = (_prev_conc_marking == 0) ?  ConcGCThreads : _prev_conc_marking;
 57   _prev_conc_marking =
 58     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
 59                                            active_workers,
 60                                            Threads::number_of_non_daemon_threads());
 61   return _prev_conc_marking;
 62 }
 63 









 64 // Reuse the calculation result from init marking
 65 uint ShenandoahWorkerPolicy::calc_workers_for_final_marking() {
 66   return _prev_par_marking;
 67 }
 68 
 69 // Calculate workers for concurrent refs processing
 70 uint ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing() {
 71   uint active_workers = (_prev_conc_refs_proc == 0) ? ConcGCThreads : _prev_conc_refs_proc;
 72   _prev_conc_refs_proc =
 73     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
 74                                            active_workers,
 75                                            Threads::number_of_non_daemon_threads());
 76   return _prev_conc_refs_proc;
 77 }
 78 
 79 // Calculate workers for concurrent root processing
 80 uint ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing() {
 81   uint active_workers = (_prev_conc_root_proc == 0) ? ConcGCThreads : _prev_conc_root_proc;
 82   _prev_conc_root_proc =
 83           WorkerPolicy::calc_active_conc_workers(ConcGCThreads,

 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 #include "precompiled.hpp"
 26 
 27 #include "gc/shared/gc_globals.hpp"
 28 #include "gc/shared/workerPolicy.hpp"
 29 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
 30 #include "runtime/javaThread.hpp"
 31 #include "runtime/threads.hpp"
 32 
 33 uint ShenandoahWorkerPolicy::_prev_par_marking     = 0;
 34 uint ShenandoahWorkerPolicy::_prev_conc_marking    = 0;
 35 uint ShenandoahWorkerPolicy::_prev_conc_rs_scanning = 0;
 36 uint ShenandoahWorkerPolicy::_prev_conc_evac       = 0;
 37 uint ShenandoahWorkerPolicy::_prev_conc_root_proc  = 0;
 38 uint ShenandoahWorkerPolicy::_prev_conc_refs_proc  = 0;
 39 uint ShenandoahWorkerPolicy::_prev_fullgc          = 0;
 40 uint ShenandoahWorkerPolicy::_prev_degengc         = 0;
 41 uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0;
 42 uint ShenandoahWorkerPolicy::_prev_par_update_ref  = 0;
 43 uint ShenandoahWorkerPolicy::_prev_conc_cleanup    = 0;
 44 uint ShenandoahWorkerPolicy::_prev_conc_reset      = 0;
 45 
 46 uint ShenandoahWorkerPolicy::calc_workers_for_init_marking() {
 47   uint active_workers = (_prev_par_marking == 0) ? ParallelGCThreads : _prev_par_marking;
 48 
 49   _prev_par_marking =
 50     WorkerPolicy::calc_active_workers(ParallelGCThreads,
 51                                       active_workers,
 52                                       Threads::number_of_non_daemon_threads());
 53   return _prev_par_marking;
 54 }
 55 
 56 uint ShenandoahWorkerPolicy::calc_workers_for_conc_marking() {
 57   uint active_workers = (_prev_conc_marking == 0) ?  ConcGCThreads : _prev_conc_marking;
 58   _prev_conc_marking =
 59     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
 60                                            active_workers,
 61                                            Threads::number_of_non_daemon_threads());
 62   return _prev_conc_marking;
 63 }
 64 
 65 uint ShenandoahWorkerPolicy::calc_workers_for_rs_scanning() {
 66   uint active_workers = (_prev_conc_rs_scanning == 0) ? ConcGCThreads : _prev_conc_rs_scanning;
 67   _prev_conc_rs_scanning =
 68     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
 69                                            active_workers,
 70                                            Threads::number_of_non_daemon_threads());
 71   return _prev_conc_rs_scanning;
 72 }
 73 
 74 // Reuse the calculation result from init marking
 75 uint ShenandoahWorkerPolicy::calc_workers_for_final_marking() {
 76   return _prev_par_marking;
 77 }
 78 
 79 // Calculate workers for concurrent refs processing
 80 uint ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing() {
 81   uint active_workers = (_prev_conc_refs_proc == 0) ? ConcGCThreads : _prev_conc_refs_proc;
 82   _prev_conc_refs_proc =
 83     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
 84                                            active_workers,
 85                                            Threads::number_of_non_daemon_threads());
 86   return _prev_conc_refs_proc;
 87 }
 88 
 89 // Calculate workers for concurrent root processing
 90 uint ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing() {
 91   uint active_workers = (_prev_conc_root_proc == 0) ? ConcGCThreads : _prev_conc_root_proc;
 92   _prev_conc_root_proc =
 93           WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
< prev index next >