--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp Fri Aug 30 00:03:10 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp Thu Aug 29 18:35:52 2019 -0400
@@ -66,14 +66,14 @@
};
class G1DirtyCardQueueSet: public PtrQueueSet {
- Monitor* _cbl_mon; // Protects the fields below.
+ Monitor* _cbl_mon; // Protects the list and count members.
BufferNode* _completed_buffers_head;
BufferNode* _completed_buffers_tail;
- // Number of actual entries in the list of completed buffers.
- volatile size_t _num_entries_in_completed_buffers;
+ // Number of actual cards in the list of completed buffers.
+ volatile size_t _num_cards;
- size_t _process_completed_buffers_threshold;
+ size_t _process_cards_threshold;
volatile bool _process_completed_buffers;
// If true, notify_all on _cbl_mon when the threshold is reached.
@@ -112,11 +112,11 @@
bool mut_process_buffer(BufferNode* node);
- // If the queue contains more buffers than configured here, the
- // mutator must start doing some of the concurrent refinement work,
- size_t _max_completed_buffers;
- size_t _completed_buffers_padding;
- static const size_t MaxCompletedBuffersUnlimited = SIZE_MAX;
+ // If the queue contains more cards than configured here, the
+ // mutator must start doing some of the concurrent refinement work.
+ size_t _max_cards;
+ size_t _max_cards_padding;
+ static const size_t MaxCardsUnlimited = SIZE_MAX;
G1FreeIdSet* _free_ids;
@@ -150,31 +150,26 @@
// return a completed buffer from the list. Otherwise, return NULL.
BufferNode* get_completed_buffer(size_t stop_at = 0);
- // The number of buffers in the list. Derived as an approximation from the number
- // of entries in the buffers. Racy.
- size_t num_completed_buffers() const {
- return (num_entries_in_completed_buffers() + buffer_size() - 1) / buffer_size();
- }
- // The number of entries in completed buffers. Read without synchronization.
- size_t num_entries_in_completed_buffers() const { return _num_entries_in_completed_buffers; }
+ // The number of cards in completed buffers. Read without synchronization.
+ size_t num_cards() const { return _num_cards; }
- // Verify that _num_entries_in_completed_buffers is equal to the sum of actual entries
+ // Verify that _num_cards is equal to the sum of actual cards
// in the completed buffers.
- void verify_num_entries_in_completed_buffers() const NOT_DEBUG_RETURN;
+ void verify_num_cards() const NOT_DEBUG_RETURN;
bool process_completed_buffers() { return _process_completed_buffers; }
void set_process_completed_buffers(bool x) { _process_completed_buffers = x; }
- // Get/Set the number of completed buffers that triggers log processing.
- // Log processing should be done when the number of buffers exceeds the
+ // Get/Set the number of cards that triggers log processing.
+ // Log processing should be done when the number of cards exceeds the
// threshold.
- void set_process_completed_buffers_threshold(size_t sz) {
- _process_completed_buffers_threshold = sz;
+ void set_process_cards_threshold(size_t sz) {
+ _process_cards_threshold = sz;
}
- size_t process_completed_buffers_threshold() const {
- return _process_completed_buffers_threshold;
+ size_t process_cards_threshold() const {
+ return _process_cards_threshold;
}
- static const size_t ProcessCompletedBuffersThresholdNever = SIZE_MAX;
+ static const size_t ProcessCardsThresholdNever = SIZE_MAX;
// Notify the consumer if the number of buffers crossed the threshold
void notify_if_necessary();
@@ -196,18 +191,18 @@
// If any threads have partial logs, add them to the global list of logs.
void concatenate_logs();
- void set_max_completed_buffers(size_t m) {
- _max_completed_buffers = m;
+ void set_max_cards(size_t m) {
+ _max_cards = m;
}
- size_t max_completed_buffers() const {
- return _max_completed_buffers;
+ size_t max_cards() const {
+ return _max_cards;
}
- void set_completed_buffers_padding(size_t padding) {
- _completed_buffers_padding = padding;
+ void set_max_cards_padding(size_t padding) {
+ _max_cards_padding = padding;
}
- size_t completed_buffers_padding() const {
- return _completed_buffers_padding;
+ size_t max_cards_padding() const {
+ return _max_cards_padding;
}
jint processed_buffers_mut() {