< prev index next >

src/hotspot/share/gc/shared/taskTerminator.cpp

Print this page
rev 57897 : imported patch 8238220-rename-owsttaskterminator
rev 57898 : [mq]: 8238229-remove-tracespinning-code

@@ -27,16 +27,10 @@
 
 #include "gc/shared/taskTerminator.hpp"
 #include "gc/shared/taskqueue.hpp"
 #include "logging/log.hpp"
 
-#ifdef TRACESPINNING
-uint TaskTerminator::_total_yields = 0;
-uint TaskTerminator::_total_spins = 0;
-uint TaskTerminator::_total_peeks = 0;
-#endif
-
 TaskTerminator::TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set) :
   _n_threads(n_threads),
   _queue_set(queue_set),
   _offered_termination(0),
   _spin_master(NULL) {

@@ -62,17 +56,10 @@
 void TaskTerminator::yield() {
   assert(_offered_termination <= _n_threads, "Invariant");
   os::naked_yield();
 }
 
-#ifdef TRACESPINNING
-void TaskTerminator::print_termination_counts() {
-  log_trace(gc, task)("TaskTerminator Yields: %u Spins: %u Peeks: %u",
-                      total_yields(), total_spins(), total_peeks());
-}
-#endif
-
 void TaskTerminator::reset_for_reuse() {
   if (_offered_termination != 0) {
     assert(_offered_termination == _n_threads,
            "Terminator may still be in use");
     _offered_termination = 0;

@@ -190,25 +177,19 @@
       // and reset the counts and starting limit.
       if (hard_spin_count > WorkStealingSpinToYieldRatio) {
         yield();
         hard_spin_count = 0;
         hard_spin_limit = hard_spin_start;
-#ifdef TRACESPINNING
-        _total_yields++;
-#endif
       } else {
         // Hard spin this time
         // Increase the hard spinning period but only up to a limit.
         hard_spin_limit = MIN2(2*hard_spin_limit,
                                (uint) WorkStealingHardSpins);
         for (uint j = 0; j < hard_spin_limit; j++) {
           SpinPause();
         }
         hard_spin_count++;
-#ifdef TRACESPINNING
-        _total_spins++;
-#endif
       }
     } else {
       log_develop_trace(gc, task)("TaskTerminator::do_spin_master_work() thread " PTR_FORMAT " sleeps after %u yields",
                                   p2i(Thread::current()), yield_count);
       yield_count = 0;

@@ -221,13 +202,10 @@
       } else {
         return false;
       }
     }
 
-#ifdef TRACESPINNING
-    _total_peeks++;
-#endif
     size_t tasks = tasks_in_queue_set();
     bool exit = exit_termination(tasks, terminator);
     {
       MonitorLocker locker(_blocker, Mutex::_no_safepoint_check_flag);
       // Termination condition reached
< prev index next >