src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp
changeset 58508 d6058bd73982
parent 58264 4e96939a5746
child 58679 9c3209ff7550
equal deleted inserted replaced
58507:7c1d0616828c 58508:d6058bd73982
    76   size_t _process_cards_threshold;
    76   size_t _process_cards_threshold;
    77   volatile bool _process_completed_buffers;
    77   volatile bool _process_completed_buffers;
    78 
    78 
    79   void abandon_completed_buffers();
    79   void abandon_completed_buffers();
    80 
    80 
    81   // Refine the cards in "node" from it's index to buffer_size.
    81   // Refine the cards in "node" from its index to buffer_size.
    82   // Stops processing if SuspendibleThreadSet::should_yield() is true.
    82   // Stops processing if SuspendibleThreadSet::should_yield() is true.
    83   // Returns true if the entire buffer was processed, false if there
    83   // Returns true if the entire buffer was processed, false if there
    84   // is a pending yield request.  The node's index is updated to exclude
    84   // is a pending yield request.  The node's index is updated to exclude
    85   // the processed elements, e.g. up to the element before processing
    85   // the processed elements, e.g. up to the element before processing
    86   // stopped, or one past the last element if the entire buffer was
    86   // stopped, or one past the last element if the entire buffer was
    87   // processed.
    87   // processed. Increments *total_refined_cards by the number of cards
    88   bool refine_buffer(BufferNode* node, uint worker_id);
    88   // processed and removed from the buffer.
       
    89   bool refine_buffer(BufferNode* node, uint worker_id, size_t* total_refined_cards);
    89 
    90 
    90   bool mut_process_buffer(BufferNode* node);
    91   bool mut_process_buffer(BufferNode* node);
    91 
    92 
    92   // If the queue contains more cards than configured here, the
    93   // If the queue contains more cards than configured here, the
    93   // mutator must start doing some of the concurrent refinement work.
    94   // mutator must start doing some of the concurrent refinement work.
    95   size_t _max_cards_padding;
    96   size_t _max_cards_padding;
    96   static const size_t MaxCardsUnlimited = SIZE_MAX;
    97   static const size_t MaxCardsUnlimited = SIZE_MAX;
    97 
    98 
    98   G1FreeIdSet _free_ids;
    99   G1FreeIdSet _free_ids;
    99 
   100 
   100   // The number of completed buffers processed by mutator and rs thread,
   101   // Array of cumulative dirty cards refined by mutator threads.
   101   // respectively.
   102   // Array has an entry per id in _free_ids.
   102   jint _processed_buffers_mut;
   103   size_t* _mutator_refined_cards_counters;
   103   jint _processed_buffers_rs_thread;
       
   104 
   104 
   105 public:
   105 public:
   106   G1DirtyCardQueueSet(Monitor* cbl_mon, BufferNode::Allocator* allocator);
   106   G1DirtyCardQueueSet(Monitor* cbl_mon, BufferNode::Allocator* allocator);
   107   ~G1DirtyCardQueueSet();
   107   ~G1DirtyCardQueueSet();
   108 
   108 
   156   // false.
   156   // false.
   157   //
   157   //
   158   // Stops processing a buffer if SuspendibleThreadSet::should_yield(),
   158   // Stops processing a buffer if SuspendibleThreadSet::should_yield(),
   159   // returning the incompletely processed buffer to the completed buffer
   159   // returning the incompletely processed buffer to the completed buffer
   160   // list, for later processing of the remainder.
   160   // list, for later processing of the remainder.
   161   bool refine_completed_buffer_concurrently(uint worker_id, size_t stop_at);
   161   //
       
   162   // Increments *total_refined_cards by the number of cards processed and
       
   163   // removed from the buffer.
       
   164   bool refine_completed_buffer_concurrently(uint worker_id,
       
   165                                             size_t stop_at,
       
   166                                             size_t* total_refined_cards);
   162 
   167 
   163   // If a full collection is happening, reset partial logs, and release
   168   // If a full collection is happening, reset partial logs, and release
   164   // completed ones: the full collection will make them all irrelevant.
   169   // completed ones: the full collection will make them all irrelevant.
   165   void abandon_logs();
   170   void abandon_logs();
   166 
   171 
   179   }
   184   }
   180   size_t max_cards_padding() const {
   185   size_t max_cards_padding() const {
   181     return _max_cards_padding;
   186     return _max_cards_padding;
   182   }
   187   }
   183 
   188 
   184   jint processed_buffers_mut() {
   189   // Total dirty cards refined by mutator threads.
   185     return _processed_buffers_mut;
   190   size_t total_mutator_refined_cards() const;
   186   }
       
   187   jint processed_buffers_rs_thread() {
       
   188     return _processed_buffers_rs_thread;
       
   189   }
       
   190 
       
   191 };
   191 };
   192 
   192 
   193 inline G1DirtyCardQueueSet* G1DirtyCardQueue::dirty_card_qset() const {
   193 inline G1DirtyCardQueueSet* G1DirtyCardQueue::dirty_card_qset() const {
   194   return static_cast<G1DirtyCardQueueSet*>(qset());
   194   return static_cast<G1DirtyCardQueueSet*>(qset());
   195 }
   195 }