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

Print this page
rev 4273 : 8009536: G1: Apache Lucene hang during reference processing
Summary: In CMTask::do_marking_step(), Skip offering termination and entering the first and second synchronization barriers if called from a serial context, i.e. the VM thread.
Reviewed-by: brutisso, tschatzl


1129   }
1130   // this is supposed to be called regularly during a marking step as
1131   // it checks a bunch of conditions that might cause the marking step
1132   // to abort
1133   void regular_clock_call();
1134   bool concurrent() { return _concurrent; }
1135 
1136 public:
1137   // It resets the task; it should be called right at the beginning of
1138   // a marking phase.
1139   void reset(CMBitMap* _nextMarkBitMap);
1140   // it clears all the fields that correspond to a claimed region.
1141   void clear_region_fields();
1142 
1143   void set_concurrent(bool concurrent) { _concurrent = concurrent; }
1144 
1145   // The main method of this class which performs a marking step
1146   // trying not to exceed the given duration. However, it might exit
1147   // prematurely, according to some conditions (i.e. SATB buffers are
1148   // available for processing).
1149   void do_marking_step(double target_ms, bool do_stealing, bool do_termination);



1150 
1151   // These two calls start and stop the timer
1152   void record_start_time() {
1153     _elapsed_time_ms = os::elapsedTime() * 1000.0;
1154   }
1155   void record_end_time() {
1156     _elapsed_time_ms = os::elapsedTime() * 1000.0 - _elapsed_time_ms;
1157   }
1158 
1159   // returns the worker ID associated with this task.
1160   uint worker_id() { return _worker_id; }
1161 
1162   // From TerminatorTerminator. It determines whether this task should
1163   // exit the termination protocol after it's entered it.
1164   virtual bool should_exit_termination();
1165 
1166   // Resets the local region fields after a task has finished scanning a
1167   // region; or when they have become stale as a result of the region
1168   // being evacuated.
1169   void giveup_current_region();




1129   }
1130   // this is supposed to be called regularly during a marking step as
1131   // it checks a bunch of conditions that might cause the marking step
1132   // to abort
1133   void regular_clock_call();
1134   bool concurrent() { return _concurrent; }
1135 
1136 public:
1137   // It resets the task; it should be called right at the beginning of
1138   // a marking phase.
1139   void reset(CMBitMap* _nextMarkBitMap);
1140   // it clears all the fields that correspond to a claimed region.
1141   void clear_region_fields();
1142 
1143   void set_concurrent(bool concurrent) { _concurrent = concurrent; }
1144 
1145   // The main method of this class which performs a marking step
1146   // trying not to exceed the given duration. However, it might exit
1147   // prematurely, according to some conditions (i.e. SATB buffers are
1148   // available for processing).
1149   void do_marking_step(double target_ms,
1150                        bool do_stealing,
1151                        bool do_termination,
1152                        bool is_serial);
1153 
1154   // These two calls start and stop the timer
1155   void record_start_time() {
1156     _elapsed_time_ms = os::elapsedTime() * 1000.0;
1157   }
1158   void record_end_time() {
1159     _elapsed_time_ms = os::elapsedTime() * 1000.0 - _elapsed_time_ms;
1160   }
1161 
1162   // returns the worker ID associated with this task.
1163   uint worker_id() { return _worker_id; }
1164 
1165   // From TerminatorTerminator. It determines whether this task should
1166   // exit the termination protocol after it's entered it.
1167   virtual bool should_exit_termination();
1168 
1169   // Resets the local region fields after a task has finished scanning a
1170   // region; or when they have become stale as a result of the region
1171   // being evacuated.
1172   void giveup_current_region();