8214202: DirtyCardQueueSet::get_completed_buffer should not clear _process_completed

Remove flag clearing and simplify get_completed-buffer.

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Kim Barrett 2018-11-26 13:17:39 -05:00
parent 5d725a98c8
commit 5c99d95a63
2 changed files with 11 additions and 12 deletions

View File

@ -221,23 +221,22 @@ bool DirtyCardQueueSet::mut_process_buffer(BufferNode* node) {
BufferNode* DirtyCardQueueSet::get_completed_buffer(size_t stop_at) {
BufferNode* nd = NULL;
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
if (_n_completed_buffers <= stop_at) {
_process_completed = false;
return NULL;
}
if (_completed_buffers_head != NULL) {
nd = _completed_buffers_head;
assert(_n_completed_buffers > 0, "Invariant");
_completed_buffers_head = nd->next();
_n_completed_buffers--;
if (_completed_buffers_head == NULL) {
assert(_n_completed_buffers == 0, "Invariant");
_completed_buffers_tail = NULL;
}
assert(_n_completed_buffers > 0, "invariant");
assert(_completed_buffers_head != NULL, "invariant");
assert(_completed_buffers_tail != NULL, "invariant");
BufferNode* nd = _completed_buffers_head;
_completed_buffers_head = nd->next();
_n_completed_buffers--;
if (_completed_buffers_head == NULL) {
assert(_n_completed_buffers == 0, "Invariant");
_completed_buffers_tail = NULL;
}
DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
return nd;

View File

@ -327,7 +327,7 @@ void PtrQueueSet::merge_bufferlists(PtrQueueSet *src) {
void PtrQueueSet::notify_if_necessary() {
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
assert(_process_completed_threshold >= 0, "_process_completed is negative");
assert(_process_completed_threshold >= 0, "_process_completed_threshold is negative");
if (_n_completed_buffers >= (size_t)_process_completed_threshold || _max_completed_queue == 0) {
_process_completed = true;
if (_notify_when_complete)