--- old/src/hotspot/share/gc/shared/taskqueue.inline.hpp 2018-04-19 10:05:44.459647709 +0200 +++ new/src/hotspot/share/gc/shared/taskqueue.inline.hpp 2018-04-19 10:05:44.178639046 +0200 @@ -152,7 +152,7 @@ } template inline bool -GenericTaskQueue::pop_local(volatile E& t) { +GenericTaskQueue::pop_local(volatile E& t, uint threshold) { uint localBot = _bottom; // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method @@ -160,7 +160,7 @@ // since this is pop_local.) uint dirty_n_elems = dirty_size(localBot, _age.top()); assert(dirty_n_elems != N - 1, "Shouldn't be possible..."); - if (dirty_n_elems == 0) return false; + if (dirty_n_elems <= threshold) return false; localBot = decrement_index(localBot); _bottom = localBot; // This is necessary to prevent any read below from being reordered