< prev index next >

src/share/vm/gc_implementation/g1/concurrentMark.cpp

Print this page
rev 8148 : [mq]: split


3703                              _worker_id, _cm->mark_stack_size());
3704     }
3705   }
3706 }
3707 
3708 // SATB Queue has several assumptions on whether to call the par or
3709 // non-par versions of the methods. this is why some of the code is
3710 // replicated. We should really get rid of the single-threaded version
3711 // of the code to simplify things.
3712 void CMTask::drain_satb_buffers() {
3713   if (has_aborted()) return;
3714 
3715   // We set this so that the regular clock knows that we're in the
3716   // middle of draining buffers and doesn't set the abort flag when it
3717   // notices that SATB buffers are available for draining. It'd be
3718   // very counter productive if it did that. :-)
3719   _draining_satb_buffers = true;
3720 
3721   CMObjectClosure oc(this);
3722   SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
3723   satb_mq_set.set_closure(_worker_id, &oc);
3724 
3725   // This keeps claiming and applying the closure to completed buffers
3726   // until we run out of buffers or we need to abort.
3727   while (!has_aborted() &&
3728          satb_mq_set.apply_closure_to_completed_buffer(_worker_id)) {
3729     if (_cm->verbose_medium()) {
3730       gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
3731     }
3732     statsOnly( ++_satb_buffers_processed );
3733     regular_clock_call();
3734   }
3735 
3736   _draining_satb_buffers = false;
3737 
3738   assert(has_aborted() ||
3739          concurrent() ||
3740          satb_mq_set.completed_buffers_num() == 0, "invariant");
3741 
3742   satb_mq_set.set_closure(_worker_id, NULL);
3743 
3744   // again, this was a potentially expensive operation, decrease the
3745   // limits to get the regular clock call early
3746   decrease_limits();
3747 }
3748 
3749 void CMTask::print_stats() {
3750   gclog_or_tty->print_cr("Marking Stats, task = %u, calls = %d",
3751                          _worker_id, _calls);
3752   gclog_or_tty->print_cr("  Elapsed time = %1.2lfms, Termination time = %1.2lfms",
3753                          _elapsed_time_ms, _termination_time_ms);
3754   gclog_or_tty->print_cr("  Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms",
3755                          _step_times_ms.num(), _step_times_ms.avg(),
3756                          _step_times_ms.sd());
3757   gclog_or_tty->print_cr("                    max = %1.2lfms, total = %1.2lfms",
3758                          _step_times_ms.maximum(), _step_times_ms.sum());
3759 
3760 #if _MARKING_STATS_
3761   gclog_or_tty->print_cr("  Clock Intervals (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms",
3762                          _all_clock_intervals_ms.num(), _all_clock_intervals_ms.avg(),




3703                              _worker_id, _cm->mark_stack_size());
3704     }
3705   }
3706 }
3707 
3708 // SATB Queue has several assumptions on whether to call the par or
3709 // non-par versions of the methods. this is why some of the code is
3710 // replicated. We should really get rid of the single-threaded version
3711 // of the code to simplify things.
3712 void CMTask::drain_satb_buffers() {
3713   if (has_aborted()) return;
3714 
3715   // We set this so that the regular clock knows that we're in the
3716   // middle of draining buffers and doesn't set the abort flag when it
3717   // notices that SATB buffers are available for draining. It'd be
3718   // very counter productive if it did that. :-)
3719   _draining_satb_buffers = true;
3720 
3721   CMObjectClosure oc(this);
3722   SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();

3723 
3724   // This keeps claiming and applying the closure to completed buffers
3725   // until we run out of buffers or we need to abort.
3726   while (!has_aborted() &&
3727          satb_mq_set.apply_closure_to_completed_buffer(&oc)) {
3728     if (_cm->verbose_medium()) {
3729       gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
3730     }
3731     statsOnly( ++_satb_buffers_processed );
3732     regular_clock_call();
3733   }
3734 
3735   _draining_satb_buffers = false;
3736 
3737   assert(has_aborted() ||
3738          concurrent() ||
3739          satb_mq_set.completed_buffers_num() == 0, "invariant");


3740 
3741   // again, this was a potentially expensive operation, decrease the
3742   // limits to get the regular clock call early
3743   decrease_limits();
3744 }
3745 
3746 void CMTask::print_stats() {
3747   gclog_or_tty->print_cr("Marking Stats, task = %u, calls = %d",
3748                          _worker_id, _calls);
3749   gclog_or_tty->print_cr("  Elapsed time = %1.2lfms, Termination time = %1.2lfms",
3750                          _elapsed_time_ms, _termination_time_ms);
3751   gclog_or_tty->print_cr("  Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms",
3752                          _step_times_ms.num(), _step_times_ms.avg(),
3753                          _step_times_ms.sd());
3754   gclog_or_tty->print_cr("                    max = %1.2lfms, total = %1.2lfms",
3755                          _step_times_ms.maximum(), _step_times_ms.sum());
3756 
3757 #if _MARKING_STATS_
3758   gclog_or_tty->print_cr("  Clock Intervals (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms",
3759                          _all_clock_intervals_ms.num(), _all_clock_intervals_ms.avg(),


< prev index next >