# HG changeset patch # User kbarrett # Date 1567119150 14400 # Node ID 18863bf3501f52e0c93a9caa102eff452a01566a # Parent fd09c637dedb94a86d821b2fd2e1cc217e82f337 8230332: G1DirtyCardQueueSet _notify_when_complete is always true Summary: Removed _notify_when_complete, assume true value where formerly used. Reviewed-by: sjohanss, tschatzl diff -r fd09c637dedb -r 18863bf3501f src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp --- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp Thu Aug 29 15:50:45 2019 -0700 +++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp Thu Aug 29 18:52:30 2019 -0400 @@ -80,7 +80,7 @@ } } -G1DirtyCardQueueSet::G1DirtyCardQueueSet(bool notify_when_complete) : +G1DirtyCardQueueSet::G1DirtyCardQueueSet() : PtrQueueSet(), _cbl_mon(NULL), _completed_buffers_head(NULL), @@ -88,7 +88,6 @@ _num_cards(0), _process_cards_threshold(ProcessCardsThresholdNever), _process_completed_buffers(false), - _notify_when_complete(notify_when_complete), _max_cards(MaxCardsUnlimited), _max_cards_padding(0), _free_ids(NULL), @@ -124,7 +123,7 @@ } void G1DirtyCardQueueSet::enqueue_completed_buffer(BufferNode* cbn) { - MutexLocker x(_cbl_mon, Mutex::_no_safepoint_check_flag); + MonitorLocker ml(_cbl_mon, Mutex::_no_safepoint_check_flag); cbn->set_next(NULL); if (_completed_buffers_tail == NULL) { assert(_completed_buffers_head == NULL, "Well-formedness"); @@ -139,9 +138,7 @@ if (!process_completed_buffers() && (num_cards() > process_cards_threshold())) { set_process_completed_buffers(true); - if (_notify_when_complete) { - _cbl_mon->notify_all(); - } + ml.notify_all(); } verify_num_cards(); } @@ -203,11 +200,10 @@ } void G1DirtyCardQueueSet::notify_if_necessary() { - MutexLocker x(_cbl_mon, Mutex::_no_safepoint_check_flag); + MonitorLocker ml(_cbl_mon, Mutex::_no_safepoint_check_flag); if (num_cards() > process_cards_threshold()) { set_process_completed_buffers(true); - if (_notify_when_complete) - _cbl_mon->notify(); + ml.notify_all(); } } diff -r fd09c637dedb -r 18863bf3501f src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp --- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp Thu Aug 29 15:50:45 2019 -0700 +++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp Thu Aug 29 18:52:30 2019 -0400 @@ -76,9 +76,6 @@ size_t _process_cards_threshold; volatile bool _process_completed_buffers; - // If true, notify_all on _cbl_mon when the threshold is reached. - bool _notify_when_complete; - void abandon_completed_buffers(); // Apply the closure to the elements of "node" from it's index to @@ -126,7 +123,7 @@ jint _processed_buffers_rs_thread; public: - G1DirtyCardQueueSet(bool notify_when_complete = true); + G1DirtyCardQueueSet(); ~G1DirtyCardQueueSet(); void initialize(Monitor* cbl_mon,