< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp

Print this page
rev 56898 : 8087198: G1 card refinement: batching, sorting
Reviewed-by: tschatzl


  94 }
  95 
  96 void G1ConcurrentRefineThread::run_service() {
  97   _vtime_start = os::elapsedVTime();
  98 
  99   while (!should_terminate()) {
 100     // Wait for work
 101     wait_for_completed_buffers();
 102     if (should_terminate()) {
 103       break;
 104     }
 105 
 106     log_debug(gc, refine)("Activated worker %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT,
 107                           _worker_id, _cr->activation_threshold(_worker_id),
 108                           G1BarrierSet::dirty_card_queue_set().num_cards());
 109 
 110     size_t start_total_refined_cards = _total_refined_cards; // For logging.
 111 
 112     {
 113       SuspendibleThreadSetJoiner sts_join;

 114 
 115       while (!should_terminate()) {
 116         if (sts_join.should_yield()) {
 117           sts_join.yield();
 118           continue;             // Re-check for termination after yield delay.
 119         }
 120 
 121         Ticks start_time = Ticks::now();
 122         if (!_cr->do_refinement_step(_worker_id, &_total_refined_cards)) {
 123           break;                // No cards to process.
 124         }
 125         _total_refinement_time += (Ticks::now() - start_time);
 126       }
 127     }
 128 
 129     deactivate();
 130     log_debug(gc, refine)("Deactivated worker %d, off threshold: " SIZE_FORMAT
 131                           ", current: " SIZE_FORMAT ", refined cards: "
 132                           SIZE_FORMAT ", total refined cards: " SIZE_FORMAT,
 133                           _worker_id, _cr->deactivation_threshold(_worker_id),


  94 }
  95 
  96 void G1ConcurrentRefineThread::run_service() {
  97   _vtime_start = os::elapsedVTime();
  98 
  99   while (!should_terminate()) {
 100     // Wait for work
 101     wait_for_completed_buffers();
 102     if (should_terminate()) {
 103       break;
 104     }
 105 
 106     log_debug(gc, refine)("Activated worker %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT,
 107                           _worker_id, _cr->activation_threshold(_worker_id),
 108                           G1BarrierSet::dirty_card_queue_set().num_cards());
 109 
 110     size_t start_total_refined_cards = _total_refined_cards; // For logging.
 111 
 112     {
 113       SuspendibleThreadSetJoiner sts_join;
 114       ResourceMark rm;
 115 
 116       while (!should_terminate()) {
 117         if (sts_join.should_yield()) {
 118           sts_join.yield();
 119           continue;             // Re-check for termination after yield delay.
 120         }
 121 
 122         Ticks start_time = Ticks::now();
 123         if (!_cr->do_refinement_step(_worker_id, &_total_refined_cards)) {
 124           break;                // No cards to process.
 125         }
 126         _total_refinement_time += (Ticks::now() - start_time);
 127       }
 128     }
 129 
 130     deactivate();
 131     log_debug(gc, refine)("Deactivated worker %d, off threshold: " SIZE_FORMAT
 132                           ", current: " SIZE_FORMAT ", refined cards: "
 133                           SIZE_FORMAT ", total refined cards: " SIZE_FORMAT,
 134                           _worker_id, _cr->deactivation_threshold(_worker_id),
< prev index next >