< prev index next >

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

Print this page
rev 55389 : [mq]: satb_lock_free


2402   if (has_aborted()) {
2403     return;
2404   }
2405 
2406   // We set this so that the regular clock knows that we're in the
2407   // middle of draining buffers and doesn't set the abort flag when it
2408   // notices that SATB buffers are available for draining. It'd be
2409   // very counter productive if it did that. :-)
2410   _draining_satb_buffers = true;
2411 
2412   G1CMSATBBufferClosure satb_cl(this, _g1h);
2413   SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set();
2414 
2415   // This keeps claiming and applying the closure to completed buffers
2416   // until we run out of buffers or we need to abort.
2417   while (!has_aborted() &&
2418          satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)) {
2419     abort_marking_if_regular_check_fail();
2420   }
2421 
2422   _draining_satb_buffers = false;



2423 
2424   assert(has_aborted() ||
2425          _cm->concurrent() ||
2426          satb_mq_set.completed_buffers_num() == 0, "invariant");
2427 
2428   // again, this was a potentially expensive operation, decrease the
2429   // limits to get the regular clock call early
2430   decrease_limits();
2431 }
2432 
2433 void G1CMTask::clear_mark_stats_cache(uint region_idx) {
2434   _mark_stats_cache.reset(region_idx);
2435 }
2436 
2437 Pair<size_t, size_t> G1CMTask::flush_mark_stats_cache() {
2438   return _mark_stats_cache.evict_all();
2439 }
2440 
2441 void G1CMTask::print_stats() {
2442   log_debug(gc, stats)("Marking Stats, task = %u, calls = %u", _worker_id, _calls);
2443   log_debug(gc, stats)("  Elapsed time = %1.2lfms, Termination time = %1.2lfms",
2444                        _elapsed_time_ms, _termination_time_ms);
2445   log_debug(gc, stats)("  Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms max = %1.2lfms, total = %1.2lfms",
2446                        _step_times_ms.num(),




2402   if (has_aborted()) {
2403     return;
2404   }
2405 
2406   // We set this so that the regular clock knows that we're in the
2407   // middle of draining buffers and doesn't set the abort flag when it
2408   // notices that SATB buffers are available for draining. It'd be
2409   // very counter productive if it did that. :-)
2410   _draining_satb_buffers = true;
2411 
2412   G1CMSATBBufferClosure satb_cl(this, _g1h);
2413   SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set();
2414 
2415   // This keeps claiming and applying the closure to completed buffers
2416   // until we run out of buffers or we need to abort.
2417   while (!has_aborted() &&
2418          satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)) {
2419     abort_marking_if_regular_check_fail();
2420   }
2421 
2422   // Can't assert qset is empty here, even if not aborted.  If concurrent,
2423   // some other thread might be adding to the queue.  If not concurrent,
2424   // some other thread might have won the race for the last buffer, but
2425   // has not yet decremented the count.
2426 
2427   _draining_satb_buffers = false;


2428 
2429   // again, this was a potentially expensive operation, decrease the
2430   // limits to get the regular clock call early
2431   decrease_limits();
2432 }
2433 
2434 void G1CMTask::clear_mark_stats_cache(uint region_idx) {
2435   _mark_stats_cache.reset(region_idx);
2436 }
2437 
2438 Pair<size_t, size_t> G1CMTask::flush_mark_stats_cache() {
2439   return _mark_stats_cache.evict_all();
2440 }
2441 
2442 void G1CMTask::print_stats() {
2443   log_debug(gc, stats)("Marking Stats, task = %u, calls = %u", _worker_id, _calls);
2444   log_debug(gc, stats)("  Elapsed time = %1.2lfms, Termination time = %1.2lfms",
2445                        _elapsed_time_ms, _termination_time_ms);
2446   log_debug(gc, stats)("  Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms max = %1.2lfms, total = %1.2lfms",
2447                        _step_times_ms.num(),


< prev index next >