< prev index next >
src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
Print this page
rev 47675 : [mq]: 8149127-rename-concurrentrefine-a
rev 47676 : imported patch 8149127-rename-concurrentrefine-b
rev 47677 : [mq]: 8149127-rename-concurrentrefine-b-stefanj-review
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, 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.
@@ -21,12 +21,12 @@
* questions.
*
*/
#include "precompiled.hpp"
-#include "gc/g1/concurrentG1Refine.hpp"
-#include "gc/g1/concurrentG1RefineThread.hpp"
+#include "gc/g1/g1ConcurrentRefine.hpp"
+#include "gc/g1/g1ConcurrentRefineThread.hpp"
#include "gc/g1/g1YoungRemSetSamplingThread.hpp"
#include "logging/log.hpp"
#include "runtime/java.hpp"
#include "runtime/thread.hpp"
#include "utilities/debug.hpp"
@@ -95,11 +95,11 @@
static Thresholds calc_thresholds(size_t green_zone,
size_t yellow_zone,
uint worker_i) {
double yellow_size = yellow_zone - green_zone;
- double step = yellow_size / ConcurrentG1Refine::thread_num();
+ double step = yellow_size / G1ConcurrentRefine::thread_num();
if (worker_i == 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
@@ -110,11 +110,11 @@
size_t deactivate_offset = static_cast<size_t>(floor(step * worker_i));
return Thresholds(green_zone + activate_offset,
green_zone + deactivate_offset);
}
-ConcurrentG1Refine::ConcurrentG1Refine(size_t green_zone,
+G1ConcurrentRefine::G1ConcurrentRefine(size_t green_zone,
size_t yellow_zone,
size_t red_zone,
size_t min_yellow_zone_size) :
_threads(NULL),
_sample_thread(NULL),
@@ -127,11 +127,11 @@
assert_zone_constraints_gyr(green_zone, yellow_zone, red_zone);
}
static size_t calc_min_yellow_zone_size() {
size_t step = G1ConcRefinementThresholdStep;
- uint n_workers = ConcurrentG1Refine::thread_num();
+ uint n_workers = G1ConcurrentRefine::thread_num();
if ((max_yellow_zone / step) < n_workers) {
return max_yellow_zone;
} else {
return step * n_workers;
}
@@ -167,11 +167,11 @@
}
}
return MIN2(yellow + size, max_red_zone);
}
-ConcurrentG1Refine* ConcurrentG1Refine::create(jint* ecode) {
+G1ConcurrentRefine* G1ConcurrentRefine::create(jint* ecode) {
size_t min_yellow_zone_size = calc_min_yellow_zone_size();
size_t green_zone = calc_init_green_zone();
size_t yellow_zone = calc_init_yellow_zone(green_zone, min_yellow_zone_size);
size_t red_zone = calc_init_red_zone(green_zone, yellow_zone);
@@ -180,103 +180,103 @@
"yellow: " SIZE_FORMAT ", "
"red: " SIZE_FORMAT ", "
"min yellow size: " SIZE_FORMAT,
green_zone, yellow_zone, red_zone, min_yellow_zone_size);
- ConcurrentG1Refine* cg1r = new ConcurrentG1Refine(green_zone,
+ G1ConcurrentRefine* cr = new G1ConcurrentRefine(green_zone,
yellow_zone,
red_zone,
min_yellow_zone_size);
- if (cg1r == NULL) {
+ if (cr == NULL) {
*ecode = JNI_ENOMEM;
- vm_shutdown_during_initialization("Could not create ConcurrentG1Refine");
+ vm_shutdown_during_initialization("Could not create G1ConcurrentRefine");
return NULL;
}
- cg1r->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(ConcurrentG1RefineThread*, cg1r->_n_worker_threads, mtGC);
- if (cg1r->_threads == NULL) {
+ cr->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(G1ConcurrentRefineThread*, cr->_n_worker_threads, mtGC);
+ if (cr->_threads == NULL) {
*ecode = JNI_ENOMEM;
- vm_shutdown_during_initialization("Could not allocate an array for ConcurrentG1RefineThread");
+ vm_shutdown_during_initialization("Could not allocate an array for G1ConcurrentRefineThread");
return NULL;
}
uint worker_id_offset = DirtyCardQueueSet::num_par_ids();
- ConcurrentG1RefineThread *next = NULL;
- for (uint i = cg1r->_n_worker_threads - 1; i != UINT_MAX; i--) {
+ G1ConcurrentRefineThread *next = NULL;
+ for (uint i = cr->_n_worker_threads - 1; i != UINT_MAX; i--) {
Thresholds thresholds = calc_thresholds(green_zone, yellow_zone, i);
- ConcurrentG1RefineThread* t =
- new ConcurrentG1RefineThread(cg1r,
+ G1ConcurrentRefineThread* t =
+ new G1ConcurrentRefineThread(cr,
next,
worker_id_offset,
i,
activation_level(thresholds),
deactivation_level(thresholds));
assert(t != NULL, "Conc refine should have been created");
if (t->osthread() == NULL) {
*ecode = JNI_ENOMEM;
- vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread");
+ vm_shutdown_during_initialization("Could not create G1ConcurrentRefineThread");
return NULL;
}
- assert(t->cg1r() == cg1r, "Conc refine thread should refer to this");
- cg1r->_threads[i] = t;
+ assert(t->cr() == cr, "Conc refine thread should refer to this");
+ cr->_threads[i] = t;
next = t;
}
- cg1r->_sample_thread = new G1YoungRemSetSamplingThread();
- if (cg1r->_sample_thread->osthread() == NULL) {
+ cr->_sample_thread = new G1YoungRemSetSamplingThread();
+ if (cr->_sample_thread->osthread() == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread");
return NULL;
}
*ecode = JNI_OK;
- return cg1r;
+ return cr;
}
-void ConcurrentG1Refine::stop() {
+void G1ConcurrentRefine::stop() {
for (uint i = 0; i < _n_worker_threads; i++) {
_threads[i]->stop();
}
_sample_thread->stop();
}
-void ConcurrentG1Refine::update_thread_thresholds() {
+void G1ConcurrentRefine::update_thread_thresholds() {
for (uint i = 0; i < _n_worker_threads; i++) {
Thresholds thresholds = calc_thresholds(_green_zone, _yellow_zone, i);
_threads[i]->update_thresholds(activation_level(thresholds),
deactivation_level(thresholds));
}
}
-ConcurrentG1Refine::~ConcurrentG1Refine() {
+G1ConcurrentRefine::~G1ConcurrentRefine() {
for (uint i = 0; i < _n_worker_threads; i++) {
delete _threads[i];
}
- FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads);
+ FREE_C_HEAP_ARRAY(G1ConcurrentRefineThread*, _threads);
delete _sample_thread;
}
-void ConcurrentG1Refine::threads_do(ThreadClosure *tc) {
+void G1ConcurrentRefine::threads_do(ThreadClosure *tc) {
worker_threads_do(tc);
tc->do_thread(_sample_thread);
}
-void ConcurrentG1Refine::worker_threads_do(ThreadClosure * tc) {
+void G1ConcurrentRefine::worker_threads_do(ThreadClosure * tc) {
for (uint i = 0; i < _n_worker_threads; i++) {
tc->do_thread(_threads[i]);
}
}
-uint ConcurrentG1Refine::thread_num() {
+uint G1ConcurrentRefine::thread_num() {
return G1ConcRefinementThreads;
}
-void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const {
+void G1ConcurrentRefine::print_worker_threads_on(outputStream* st) const {
for (uint i = 0; i < _n_worker_threads; ++i) {
_threads[i]->print_on(st);
st->cr();
}
_sample_thread->print_on(st);
@@ -310,11 +310,11 @@
static size_t calc_new_red_zone(size_t green, size_t yellow) {
return MIN2(yellow + (yellow - green), max_red_zone);
}
-void ConcurrentG1Refine::update_zones(double update_rs_time,
+void G1ConcurrentRefine::update_zones(double update_rs_time,
size_t update_rs_processed_buffers,
double goal_ms) {
log_trace( CTRL_TAGS )("Updating Refinement Zones: "
"update_rs time: %.3fms, "
"update_rs buffers: " SIZE_FORMAT ", "
@@ -336,11 +336,11 @@
"yellow: " SIZE_FORMAT ", "
"red: " SIZE_FORMAT,
_green_zone, _yellow_zone, _red_zone);
}
-void ConcurrentG1Refine::adjust(double update_rs_time,
+void G1ConcurrentRefine::adjust(double update_rs_time,
size_t update_rs_processed_buffers,
double goal_ms) {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
if (G1UseAdaptiveConcRefinement) {
< prev index next >