--- old/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp 2017-11-20 16:08:09.989066509 +0100 +++ new/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp 2017-11-20 16:08:09.576053970 +0100 @@ -104,7 +104,7 @@ _threads[worker_id] = create_refinement_thread(worker_id, false); thread_to_activate = _threads[worker_id]; } - if (thread_to_activate != NULL) { + if (thread_to_activate != NULL && !thread_to_activate->is_active()) { thread_to_activate->activate(); } } @@ -418,7 +418,7 @@ } void G1ConcurrentRefine::maybe_activate_more_threads(uint worker_id, size_t num_cur_buffers) { - if (activation_threshold(worker_id + 1) > num_cur_buffers) { + if (num_cur_buffers > activation_threshold(worker_id + 1)) { _thread_control.maybe_activate_next(worker_id); } } --- old/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp 2017-11-20 16:08:11.678117789 +0100 +++ new/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp 2017-11-20 16:08:11.273105493 +0100 @@ -50,7 +50,6 @@ void wait_for_completed_buffers(); void set_active(bool x) { _active = x; } - bool is_active(); // Deactivate this thread. void deactivate(); @@ -61,6 +60,7 @@ public: G1ConcurrentRefineThread(G1ConcurrentRefine* cg1r, uint worker_id); + bool is_active(); // Activate this thread. void activate();