< prev index next >

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

Print this page




2570     The value of is_serial must be false when do_marking_step is
2571     being called by any of the worker threads in a work gang.
2572     Examples include the concurrent marking code (CMMarkingTask),
2573     the MT remark code, and the MT reference processing closures.
2574 
2575  *****************************************************************************/
2576 
2577 void G1CMTask::do_marking_step(double time_target_ms,
2578                                bool do_termination,
2579                                bool is_serial) {
2580   assert(time_target_ms >= 1.0, "minimum granularity is 1ms");
2581 
2582   _start_time_ms = os::elapsedVTime() * 1000.0;
2583 
2584   // If do_stealing is true then do_marking_step will attempt to
2585   // steal work from the other G1CMTasks. It only makes sense to
2586   // enable stealing when the termination protocol is enabled
2587   // and do_marking_step() is not being called serially.
2588   bool do_stealing = do_termination && !is_serial;
2589 
2590   double diff_prediction_ms = _g1h->policy()->predictor().get_new_prediction(&_marking_step_diff_ms);

2591   _time_target_ms = time_target_ms - diff_prediction_ms;
2592 
2593   // set up the variables that are used in the work-based scheme to
2594   // call the regular clock method
2595   _words_scanned = 0;
2596   _refs_reached  = 0;
2597   recalculate_limits();
2598 
2599   // clear all flags
2600   clear_has_aborted();
2601   _has_timed_out = false;
2602   _draining_satb_buffers = false;
2603 
2604   ++_calls;
2605 
2606   // Set up the bitmap and oop closures. Anything that uses them is
2607   // eventually called from this method, so it is OK to allocate these
2608   // statically.
2609   G1CMBitMapClosure bitmap_closure(this, _cm);
2610   G1CMOopClosure cm_oop_closure(_g1h, this);




2570     The value of is_serial must be false when do_marking_step is
2571     being called by any of the worker threads in a work gang.
2572     Examples include the concurrent marking code (CMMarkingTask),
2573     the MT remark code, and the MT reference processing closures.
2574 
2575  *****************************************************************************/
2576 
2577 void G1CMTask::do_marking_step(double time_target_ms,
2578                                bool do_termination,
2579                                bool is_serial) {
2580   assert(time_target_ms >= 1.0, "minimum granularity is 1ms");
2581 
2582   _start_time_ms = os::elapsedVTime() * 1000.0;
2583 
2584   // If do_stealing is true then do_marking_step will attempt to
2585   // steal work from the other G1CMTasks. It only makes sense to
2586   // enable stealing when the termination protocol is enabled
2587   // and do_marking_step() is not being called serially.
2588   bool do_stealing = do_termination && !is_serial;
2589 
2590   G1Predictions const& predictor = _g1h->policy()->predictor();
2591   double diff_prediction_ms = predictor.get_new_lower_zero_bound_prediction(&_marking_step_diff_ms);
2592   _time_target_ms = time_target_ms - diff_prediction_ms;
2593 
2594   // set up the variables that are used in the work-based scheme to
2595   // call the regular clock method
2596   _words_scanned = 0;
2597   _refs_reached  = 0;
2598   recalculate_limits();
2599 
2600   // clear all flags
2601   clear_has_aborted();
2602   _has_timed_out = false;
2603   _draining_satb_buffers = false;
2604 
2605   ++_calls;
2606 
2607   // Set up the bitmap and oop closures. Anything that uses them is
2608   // eventually called from this method, so it is OK to allocate these
2609   // statically.
2610   G1CMBitMapClosure bitmap_closure(this, _cm);
2611   G1CMOopClosure cm_oop_closure(_g1h, this);


< prev index next >