< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp

Print this page
rev 52688 : imported patch pqs_threshold_types
rev 52689 : [mq]: tschatzl_review

*** 142,152 **** // without needing to check for overflow in "x OP y", because the // ranges for x and y have been restricted. STATIC_ASSERT(sizeof(LP64_ONLY(jint) NOT_LP64(jshort)) <= (sizeof(size_t)/2)); const size_t max_yellow_zone = LP64_ONLY(max_jint) NOT_LP64(max_jshort); const size_t max_green_zone = max_yellow_zone / 2; ! const size_t max_red_zone = INT_MAX; // For dcqs.set_max_completed_queue. STATIC_ASSERT(max_yellow_zone <= max_red_zone); // Range check assertions for green zone values. #define assert_zone_constraints_g(green) \ do { \ --- 142,152 ---- // without needing to check for overflow in "x OP y", because the // ranges for x and y have been restricted. STATIC_ASSERT(sizeof(LP64_ONLY(jint) NOT_LP64(jshort)) <= (sizeof(size_t)/2)); const size_t max_yellow_zone = LP64_ONLY(max_jint) NOT_LP64(max_jshort); const size_t max_green_zone = max_yellow_zone / 2; ! const size_t max_red_zone = INT_MAX; // For dcqs.set_max_completed_buffers. STATIC_ASSERT(max_yellow_zone <= max_red_zone); // Range check assertions for green zone values. #define assert_zone_constraints_g(green) \ do { \
*** 384,408 **** update_zones(update_rs_time, update_rs_processed_buffers, goal_ms); // Change the barrier params if (max_num_threads() == 0) { // Disable dcqs notification when there are no threads to notify. ! dcqs.set_process_completed_threshold(INT_MAX); } else { // Worker 0 is the primary; wakeup is via dcqs notification. STATIC_ASSERT(max_yellow_zone <= INT_MAX); size_t activate = activation_threshold(0); ! dcqs.set_process_completed_threshold((int)activate); } ! dcqs.set_max_completed_queue((int)red_zone()); } size_t curr_queue_size = dcqs.completed_buffers_num(); ! if (curr_queue_size >= yellow_zone()) { ! dcqs.set_completed_queue_padding(curr_queue_size); } else { ! dcqs.set_completed_queue_padding(0); } dcqs.notify_if_necessary(); } size_t G1ConcurrentRefine::activation_threshold(uint worker_id) const { --- 384,409 ---- update_zones(update_rs_time, update_rs_processed_buffers, goal_ms); // Change the barrier params if (max_num_threads() == 0) { // Disable dcqs notification when there are no threads to notify. ! dcqs.set_process_completed_buffers_threshold(DirtyCardQueueSet::ProcessCompletedBuffersThresholdNever); } else { // Worker 0 is the primary; wakeup is via dcqs notification. STATIC_ASSERT(max_yellow_zone <= INT_MAX); size_t activate = activation_threshold(0); ! dcqs.set_process_completed_buffers_threshold(activate); } ! dcqs.set_max_completed_buffers(red_zone()); } size_t curr_queue_size = dcqs.completed_buffers_num(); ! if ((dcqs.max_completed_buffers() > 0) && ! (curr_queue_size >= yellow_zone())) { ! dcqs.set_completed_buffers_padding(curr_queue_size); } else { ! dcqs.set_completed_buffers_padding(0); } dcqs.notify_if_necessary(); } size_t G1ConcurrentRefine::activation_threshold(uint worker_id) const {
*** 431,442 **** size_t curr_buffer_num = dcqs.completed_buffers_num(); // If the number of the buffers falls down into the yellow zone, // that means that the transition period after the evacuation pause has ended. // Since the value written to the DCQS is the same for all threads, there is no // need to synchronize. ! if (dcqs.completed_queue_padding() > 0 && curr_buffer_num <= yellow_zone()) { ! dcqs.set_completed_queue_padding(0); } maybe_activate_more_threads(worker_id, curr_buffer_num); // Process the next buffer, if there are enough left. --- 432,443 ---- size_t curr_buffer_num = dcqs.completed_buffers_num(); // If the number of the buffers falls down into the yellow zone, // that means that the transition period after the evacuation pause has ended. // Since the value written to the DCQS is the same for all threads, there is no // need to synchronize. ! if (dcqs.completed_buffers_padding() > 0 && curr_buffer_num <= yellow_zone()) { ! dcqs.set_completed_buffers_padding(0); } maybe_activate_more_threads(worker_id, curr_buffer_num); // Process the next buffer, if there are enough left.
< prev index next >