< prev index next >
src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
Print this page
rev 57683 : [mq]: fix_thresholds
*** 1,7 ****
/*
! * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 188,197 ****
--- 188,201 ----
#define CTRL_TAGS gc, ergo, refine
// For logging zone values, ensuring consistency of level and tags.
#define LOG_ZONES(...) log_debug( CTRL_TAGS )(__VA_ARGS__)
+ static size_t buffers_to_cards(size_t value) {
+ return value * G1UpdateBufferSize;
+ }
+
// Package for pair of refinement thread activation and deactivation
// thresholds. The activation and deactivation levels are resp. the first
// and second values of the pair.
typedef Pair<size_t, size_t> Thresholds;
inline size_t activation_level(const Thresholds& t) { return t.first; }
*** 205,216 ****
if (worker_id == 0) {
// Potentially activate worker 0 more aggressively, to keep
// available buffers near green_zone value. When yellow_size is
// large we don't want to allow a full step to accumulate before
// doing any processing, as that might lead to significantly more
! // than green_zone buffers to be processed during scanning.
! step = MIN2(step, ParallelGCThreads / 2.0);
}
size_t activate_offset = static_cast<size_t>(ceil(step * (worker_id + 1)));
size_t deactivate_offset = static_cast<size_t>(floor(step * worker_id));
return Thresholds(green_zone + activate_offset,
green_zone + deactivate_offset);
--- 209,221 ----
if (worker_id == 0) {
// Potentially activate worker 0 more aggressively, to keep
// available buffers near green_zone value. When yellow_size is
// large we don't want to allow a full step to accumulate before
// doing any processing, as that might lead to significantly more
! // than green_zone buffers to be processed during pause. So limit
! // to an extra half buffer per pause-time processing thread.
! step = MIN2(step, buffers_to_cards(ParallelGCThreads) / 2.0);
}
size_t activate_offset = static_cast<size_t>(ceil(step * (worker_id + 1)));
size_t deactivate_offset = static_cast<size_t>(floor(step * worker_id));
return Thresholds(green_zone + activate_offset,
green_zone + deactivate_offset);
*** 231,244 ****
jint G1ConcurrentRefine::initialize() {
return _thread_control.initialize(this, max_num_threads());
}
- static size_t buffers_to_cards(size_t value) {
- return value * G1UpdateBufferSize;
- }
-
static size_t calc_min_yellow_zone_size() {
size_t step = buffers_to_cards(G1ConcRefinementThresholdStep);
uint n_workers = G1ConcurrentRefine::max_num_threads();
if ((max_yellow_zone / step) < n_workers) {
return max_yellow_zone;
--- 236,245 ----
*** 441,452 ****
uint G1ConcurrentRefine::worker_id_offset() {
return G1DirtyCardQueueSet::num_par_ids();
}
! void G1ConcurrentRefine::maybe_activate_more_threads(uint worker_id, size_t num_cur_buffers) {
! if (num_cur_buffers > activation_threshold(worker_id + 1)) {
_thread_control.maybe_activate_next(worker_id);
}
}
bool G1ConcurrentRefine::do_refinement_step(uint worker_id,
--- 442,453 ----
uint G1ConcurrentRefine::worker_id_offset() {
return G1DirtyCardQueueSet::num_par_ids();
}
! void G1ConcurrentRefine::maybe_activate_more_threads(uint worker_id, size_t num_cur_cards) {
! if (num_cur_cards > activation_threshold(worker_id + 1)) {
_thread_control.maybe_activate_next(worker_id);
}
}
bool G1ConcurrentRefine::do_refinement_step(uint worker_id,
< prev index next >