96 size_t capacity) {
97 tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: " SIZE_FORMAT
98 " capacity: " SIZE_FORMAT,
99 name, p2i(buf), index, capacity);
100 }
101
102 void SATBMarkQueue::print(const char* name) {
103 print_satb_buffer(name, _buf, index(), capacity());
104 }
105
106 #endif // PRODUCT
107
108 SATBMarkQueueSet::SATBMarkQueueSet() :
109 PtrQueueSet(),
110 _shared_satb_queue(this, true /* permanent */),
111 _buffer_enqueue_threshold(0)
112 {}
113
114 void SATBMarkQueueSet::initialize(Monitor* cbl_mon,
115 BufferNode::Allocator* allocator,
116 int process_completed_threshold,
117 uint buffer_enqueue_threshold_percentage,
118 Mutex* lock) {
119 PtrQueueSet::initialize(cbl_mon, allocator, process_completed_threshold, -1);
120 _shared_satb_queue.set_lock(lock);
121 assert(buffer_size() != 0, "buffer size not initialized");
122 // Minimum threshold of 1 ensures enqueuing of completely full buffers.
123 size_t size = buffer_size();
124 size_t enqueue_qty = (size * buffer_enqueue_threshold_percentage) / 100;
125 _buffer_enqueue_threshold = MAX2(size - enqueue_qty, (size_t)1);
126 }
127
128 #ifdef ASSERT
129 void SATBMarkQueueSet::dump_active_states(bool expected_active) {
130 log_error(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE");
131 log_error(gc, verify)("Actual SATB active states:");
132 log_error(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE");
133 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
134 log_error(gc, verify)(" Thread \"%s\" queue: %s", t->name(), satb_queue_for_thread(t).is_active() ? "ACTIVE" : "INACTIVE");
135 }
136 log_error(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE");
137 }
138
139 void SATBMarkQueueSet::verify_active_states(bool expected_active) {
|
96 size_t capacity) {
97 tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: " SIZE_FORMAT
98 " capacity: " SIZE_FORMAT,
99 name, p2i(buf), index, capacity);
100 }
101
102 void SATBMarkQueue::print(const char* name) {
103 print_satb_buffer(name, _buf, index(), capacity());
104 }
105
106 #endif // PRODUCT
107
108 SATBMarkQueueSet::SATBMarkQueueSet() :
109 PtrQueueSet(),
110 _shared_satb_queue(this, true /* permanent */),
111 _buffer_enqueue_threshold(0)
112 {}
113
114 void SATBMarkQueueSet::initialize(Monitor* cbl_mon,
115 BufferNode::Allocator* allocator,
116 size_t process_completed_buffers_threshold,
117 uint buffer_enqueue_threshold_percentage,
118 Mutex* lock) {
119 PtrQueueSet::initialize(cbl_mon, allocator);
120 set_process_completed_buffers_threshold(process_completed_buffers_threshold);
121 _shared_satb_queue.set_lock(lock);
122 assert(buffer_size() != 0, "buffer size not initialized");
123 // Minimum threshold of 1 ensures enqueuing of completely full buffers.
124 size_t size = buffer_size();
125 size_t enqueue_qty = (size * buffer_enqueue_threshold_percentage) / 100;
126 _buffer_enqueue_threshold = MAX2(size - enqueue_qty, (size_t)1);
127 }
128
129 #ifdef ASSERT
130 void SATBMarkQueueSet::dump_active_states(bool expected_active) {
131 log_error(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE");
132 log_error(gc, verify)("Actual SATB active states:");
133 log_error(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE");
134 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
135 log_error(gc, verify)(" Thread \"%s\" queue: %s", t->name(), satb_queue_for_thread(t).is_active() ? "ACTIVE" : "INACTIVE");
136 }
137 log_error(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE");
138 }
139
140 void SATBMarkQueueSet::verify_active_states(bool expected_active) {
|