提交 b2063d4c 编写于 作者: T tonyp

6928059: G1: command line parameter renaming

Summary: Rename G1 parameters to make them more consistent.
Reviewed-by: jmasa, johnc
上级 d0522425
......@@ -44,20 +44,20 @@ ConcurrentG1Refine::ConcurrentG1Refine() :
{
// Ergomonically select initial concurrent refinement parameters
if (FLAG_IS_DEFAULT(G1ConcRefineGreenZone)) {
FLAG_SET_DEFAULT(G1ConcRefineGreenZone, MAX2<int>(ParallelGCThreads, 1));
if (FLAG_IS_DEFAULT(G1ConcRefinementGreenZone)) {
FLAG_SET_DEFAULT(G1ConcRefinementGreenZone, MAX2<int>(ParallelGCThreads, 1));
}
set_green_zone(G1ConcRefineGreenZone);
set_green_zone(G1ConcRefinementGreenZone);
if (FLAG_IS_DEFAULT(G1ConcRefineYellowZone)) {
FLAG_SET_DEFAULT(G1ConcRefineYellowZone, green_zone() * 3);
if (FLAG_IS_DEFAULT(G1ConcRefinementYellowZone)) {
FLAG_SET_DEFAULT(G1ConcRefinementYellowZone, green_zone() * 3);
}
set_yellow_zone(MAX2<int>(G1ConcRefineYellowZone, green_zone()));
set_yellow_zone(MAX2<int>(G1ConcRefinementYellowZone, green_zone()));
if (FLAG_IS_DEFAULT(G1ConcRefineRedZone)) {
FLAG_SET_DEFAULT(G1ConcRefineRedZone, yellow_zone() * 2);
if (FLAG_IS_DEFAULT(G1ConcRefinementRedZone)) {
FLAG_SET_DEFAULT(G1ConcRefinementRedZone, yellow_zone() * 2);
}
set_red_zone(MAX2<int>(G1ConcRefineRedZone, yellow_zone()));
set_red_zone(MAX2<int>(G1ConcRefinementRedZone, yellow_zone()));
_n_worker_threads = thread_num();
// We need one extra thread to do the young gen rset size sampling.
_n_threads = _n_worker_threads + 1;
......@@ -76,15 +76,15 @@ ConcurrentG1Refine::ConcurrentG1Refine() :
}
void ConcurrentG1Refine::reset_threshold_step() {
if (FLAG_IS_DEFAULT(G1ConcRefineThresholdStep)) {
if (FLAG_IS_DEFAULT(G1ConcRefinementThresholdStep)) {
_thread_threshold_step = (yellow_zone() - green_zone()) / (worker_thread_num() + 1);
} else {
_thread_threshold_step = G1ConcRefineThresholdStep;
_thread_threshold_step = G1ConcRefinementThresholdStep;
}
}
int ConcurrentG1Refine::thread_num() {
return MAX2<int>((G1ParallelRSetThreads > 0) ? G1ParallelRSetThreads : ParallelGCThreads, 1);
return MAX2<int>((G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads : ParallelGCThreads, 1);
}
void ConcurrentG1Refine::init() {
......
......@@ -39,7 +39,8 @@ class ConcurrentG1Refine: public CHeapObj {
* running. If the length becomes red (max queue length) the mutators start
* processing the buffers.
*
* There are some interesting cases (with G1AdaptiveConcRefine turned off):
* There are some interesting cases (when G1UseAdaptiveConcRefinement
* is turned off):
* 1) green = yellow = red = 0. In this case the mutator will process all
* buffers. Except for those that are created by the deferred updates
* machinery during a collection.
......
......@@ -107,7 +107,7 @@ void ConcurrentG1RefineThread::run_young_rs_sampling() {
if (_should_terminate) {
break;
}
_monitor->wait(Mutex::_no_safepoint_check_flag, G1ConcRefineServiceInterval);
_monitor->wait(Mutex::_no_safepoint_check_flag, G1ConcRefinementServiceIntervalMillis);
}
}
......@@ -127,7 +127,7 @@ bool ConcurrentG1RefineThread::is_active() {
void ConcurrentG1RefineThread::activate() {
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
if (_worker_id > 0) {
if (G1TraceConcurrentRefinement) {
if (G1TraceConcRefinement) {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
gclog_or_tty->print_cr("G1-Refine-activated worker %d, on threshold %d, current %d",
_worker_id, _threshold, (int)dcqs.completed_buffers_num());
......@@ -143,7 +143,7 @@ void ConcurrentG1RefineThread::activate() {
void ConcurrentG1RefineThread::deactivate() {
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
if (_worker_id > 0) {
if (G1TraceConcurrentRefinement) {
if (G1TraceConcRefinement) {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
gclog_or_tty->print_cr("G1-Refine-deactivated worker %d, off threshold %d, current %d",
_worker_id, _deactivation_threshold, (int)dcqs.completed_buffers_num());
......@@ -218,9 +218,13 @@ void ConcurrentG1RefineThread::run() {
void ConcurrentG1RefineThread::yield() {
if (G1TraceConcurrentRefinement) gclog_or_tty->print_cr("G1-Refine-yield");
if (G1TraceConcRefinement) {
gclog_or_tty->print_cr("G1-Refine-yield");
}
_sts.yield("G1 refine");
if (G1TraceConcurrentRefinement) gclog_or_tty->print_cr("G1-Refine-yield-end");
if (G1TraceConcRefinement) {
gclog_or_tty->print_cr("G1-Refine-yield-end");
}
}
void ConcurrentG1RefineThread::stop() {
......@@ -241,7 +245,9 @@ void ConcurrentG1RefineThread::stop() {
Terminator_lock->wait();
}
}
if (G1TraceConcurrentRefinement) gclog_or_tty->print_cr("G1-Refine-stop");
if (G1TraceConcRefinement) {
gclog_or_tty->print_cr("G1-Refine-stop");
}
}
void ConcurrentG1RefineThread::print() const {
......
......@@ -461,7 +461,7 @@ ConcurrentMark::ConcurrentMark(ReservedSpace rs,
assert(_markBitMap2.covers(rs), "_markBitMap2 inconsistency");
SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set();
satb_qs.set_buffer_size(G1SATBLogBufferSize);
satb_qs.set_buffer_size(G1SATBBufferSize);
int size = (int) MAX2(ParallelGCThreads, (size_t)1);
_par_cleanup_thread_state = NEW_C_HEAP_ARRAY(ParCleanupThreadState*, size);
......
......@@ -583,7 +583,7 @@ HeapRegion* G1CollectedHeap::newAllocRegion_work(size_t word_size,
res->zero_fill_state() == HeapRegion::Allocated)),
"Non-young alloc Regions must be zero filled (and non-H)");
if (G1PrintRegions) {
if (G1PrintHeapRegions) {
if (res != NULL) {
gclog_or_tty->print_cr("new alloc region %d:["PTR_FORMAT", "PTR_FORMAT"], "
"top "PTR_FORMAT,
......@@ -2477,7 +2477,7 @@ void G1CollectedHeap::print_tracing_info() const {
if (G1SummarizeRSetStats) {
g1_rem_set()->print_summary_info();
}
if (G1SummarizeConcurrentMark) {
if (G1SummarizeConcMark) {
concurrent_mark()->print_summary_info();
}
if (G1SummarizeZFStats) {
......@@ -3480,7 +3480,7 @@ void G1CollectedHeap::handle_evacuation_failure_common(oop old, markOop m) {
HeapRegion* r = heap_region_containing(old);
if (!r->evacuation_failed()) {
r->set_evacuation_failed(true);
if (G1PrintRegions) {
if (G1PrintHeapRegions) {
gclog_or_tty->print("evacuation failed in heap region "PTR_FORMAT" "
"["PTR_FORMAT","PTR_FORMAT")\n",
r, r->bottom(), r->end());
......@@ -4002,9 +4002,7 @@ public:
_g1h->g1_policy()->record_obj_copy_time(i, elapsed_ms-term_ms);
_g1h->g1_policy()->record_termination_time(i, term_ms);
}
if (G1UseSurvivorSpaces) {
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
}
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
// Clean up any par-expanded rem sets.
......
......@@ -270,14 +270,10 @@ G1CollectorPolicy::G1CollectorPolicy() :
_concurrent_mark_cleanup_times_ms->add(0.20);
_tenuring_threshold = MaxTenuringThreshold;
if (G1UseSurvivorSpaces) {
// if G1FixedSurvivorSpaceSize is 0 which means the size is not
// fixed, then _max_survivor_regions will be calculated at
// calculate_young_list_target_config during initialization
_max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
} else {
_max_survivor_regions = 0;
}
// if G1FixedSurvivorSpaceSize is 0 which means the size is not
// fixed, then _max_survivor_regions will be calculated at
// calculate_young_list_target_config during initialization
_max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
initialize_all();
}
......@@ -455,7 +451,7 @@ void G1CollectorPolicy::calculate_young_list_target_config(size_t rs_lengths) {
guarantee( adaptive_young_list_length(), "pre-condition" );
double start_time_sec = os::elapsedTime();
size_t min_reserve_perc = MAX2((size_t)2, (size_t)G1MinReservePercent);
size_t min_reserve_perc = MAX2((size_t)2, (size_t)G1ReservePercent);
min_reserve_perc = MIN2((size_t) 50, min_reserve_perc);
size_t reserve_regions =
(size_t) ((double) min_reserve_perc * (double) _g1->n_regions() / 100.0);
......@@ -1110,10 +1106,7 @@ void G1CollectorPolicy::record_collection_pause_start(double start_time_sec,
size_t short_lived_so_length = _young_list_so_prefix_length;
_short_lived_surv_rate_group->record_scan_only_prefix(short_lived_so_length);
tag_scan_only(short_lived_so_length);
if (G1UseSurvivorSpaces) {
_survivors_age_table.clear();
}
_survivors_age_table.clear();
assert( verify_young_ages(), "region age verification" );
}
......@@ -1916,7 +1909,7 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) {
calculate_young_list_target_config();
// Note that _mmu_tracker->max_gc_time() returns the time in seconds.
double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSUpdatePauseFractionPercent / 100.0;
double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
adjust_concurrent_refinement(update_rs_time, update_rs_processed_buffers, update_rs_time_goal_ms);
// </NEW PREDICTION>
......@@ -1932,7 +1925,7 @@ void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
ConcurrentG1Refine *cg1r = G1CollectedHeap::heap()->concurrent_g1_refine();
if (G1AdaptiveConcRefine) {
if (G1UseAdaptiveConcRefinement) {
const int k_gy = 3, k_gr = 6;
const double inc_k = 1.1, dec_k = 0.9;
......@@ -2607,9 +2600,6 @@ size_t G1CollectorPolicy::max_regions(int purpose) {
// Calculates survivor space parameters.
void G1CollectorPolicy::calculate_survivors_policy()
{
if (!G1UseSurvivorSpaces) {
return;
}
if (G1FixedSurvivorSpaceSize == 0) {
_max_survivor_regions = _young_list_target_length / SurvivorRatio;
} else {
......@@ -2867,7 +2857,7 @@ record_concurrent_mark_cleanup_end(size_t freed_bytes,
// estimate of the number of live bytes.
void G1CollectorPolicy::
add_to_collection_set(HeapRegion* hr) {
if (G1PrintRegions) {
if (G1PrintHeapRegions) {
gclog_or_tty->print_cr("added region to cset %d:["PTR_FORMAT", "PTR_FORMAT"], "
"top "PTR_FORMAT", young %s",
hr->hrs_index(), hr->bottom(), hr->end(),
......
......@@ -88,13 +88,13 @@ void G1MMUTrackerQueue::add_pause(double start, double end, bool gc_thread) {
// the time slice than what's allowed)
// consolidate the two entries with the minimum gap between them
// (this might allow less GC time than what's allowed)
guarantee(NOT_PRODUCT(ScavengeALot ||) G1ForgetfulMMUTracker,
"array full, currently we can't recover unless +G1ForgetfulMMUTracker");
guarantee(NOT_PRODUCT(ScavengeALot ||) G1UseFixedWindowMMUTracker,
"array full, currently we can't recover unless +G1UseFixedWindowMMUTracker");
// In the case where ScavengeALot is true, such overflow is not
// uncommon; in such cases, we can, without much loss of precision
// or performance (we are GC'ing most of the time anyway!),
// simply overwrite the oldest entry in the tracker: this
// is also the behaviour when G1ForgetfulMMUTracker is enabled.
// is also the behaviour when G1UseFixedWindowMMUTracker is enabled.
_head_index = trim_index(_head_index + 1);
assert(_head_index == _tail_index, "Because we have a full circular buffer");
_tail_index = trim_index(_tail_index + 1);
......
......@@ -101,7 +101,7 @@ private:
// If the array is full, an easy fix is to look for the pauses with
// the shortest gap between them and consolidate them.
// For now, we have taken the expedient alternative of forgetting
// the oldest entry in the event that +G1ForgetfulMMUTracker, thus
// the oldest entry in the event that +G1UseFixedWindowMMUTracker, thus
// potentially violating MMU specs for some time thereafter.
G1MMUTrackerQueueElem _array[QueueLength];
......
......@@ -467,7 +467,7 @@ HRInto_G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc,
// and they are causing failures. When we resolve said race
// conditions, we'll revert back to parallel remembered set
// updating and scanning. See CRs 6677707 and 6677708.
if (G1ParallelRSetUpdatingEnabled || (worker_i == 0)) {
if (G1UseParallelRSetUpdating || (worker_i == 0)) {
updateRS(worker_i);
scanNewRefsRS(oc, worker_i);
} else {
......@@ -476,7 +476,7 @@ HRInto_G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc,
_g1p->record_update_rs_time(worker_i, 0.0);
_g1p->record_scan_new_refs_time(worker_i, 0.0);
}
if (G1ParallelRSetScanningEnabled || (worker_i == 0)) {
if (G1UseParallelRSetScanning || (worker_i == 0)) {
scanRS(oc, worker_i);
} else {
_g1p->record_scan_rs_start_time(worker_i, os::elapsedTime() * 1000.0);
......
......@@ -70,7 +70,7 @@
develop(intx, G1PausesBtwnConcMark, -1, \
"If positive, fixed number of pauses between conc markings") \
\
diagnostic(bool, G1SummarizeConcurrentMark, false, \
diagnostic(bool, G1SummarizeConcMark, false, \
"Summarize concurrent mark info") \
\
diagnostic(bool, G1SummarizeRSetStats, false, \
......@@ -85,7 +85,7 @@
diagnostic(bool, G1SummarizeZFStats, false, \
"Summarize zero-filling info") \
\
diagnostic(bool, G1TraceConcurrentRefinement, false, \
diagnostic(bool, G1TraceConcRefinement, false, \
"Trace G1 concurrent refinement") \
\
product(intx, G1MarkStackSize, 2 * 1024 * 1024, \
......@@ -110,10 +110,10 @@
develop(bool, G1SATBBarrierPrintNullPreVals, false, \
"If true, count frac of ptr writes with null pre-vals.") \
\
product(intx, G1SATBLogBufferSize, 1*K, \
product(intx, G1SATBBufferSize, 1*K, \
"Number of entries in an SATB log buffer.") \
\
product(intx, G1SATBProcessCompletedThreshold, 20, \
develop(intx, G1SATBProcessCompletedThreshold, 20, \
"Number of completed buffers that triggers log processing.") \
\
develop(intx, G1ExtraRegionSurvRate, 33, \
......@@ -127,7 +127,7 @@
develop(bool, G1SATBPrintStubs, false, \
"If true, print generated stubs for the SATB barrier") \
\
product(intx, G1ExpandByPercentOfAvailable, 20, \
experimental(intx, G1ExpandByPercentOfAvailable, 20, \
"When expanding, % of uncommitted space to claim.") \
\
develop(bool, G1RSBarrierRegionFilter, true, \
......@@ -165,36 +165,36 @@
product(intx, G1UpdateBufferSize, 256, \
"Size of an update buffer") \
\
product(intx, G1ConcRefineYellowZone, 0, \
product(intx, G1ConcRefinementYellowZone, 0, \
"Number of enqueued update buffers that will " \
"trigger concurrent processing. Will be selected ergonomically " \
"by default.") \
\
product(intx, G1ConcRefineRedZone, 0, \
product(intx, G1ConcRefinementRedZone, 0, \
"Maximum number of enqueued update buffers before mutator " \
"threads start processing new ones instead of enqueueing them. " \
"Will be selected ergonomically by default. Zero will disable " \
"concurrent processing.") \
\
product(intx, G1ConcRefineGreenZone, 0, \
product(intx, G1ConcRefinementGreenZone, 0, \
"The number of update buffers that are left in the queue by the " \
"concurrent processing threads. Will be selected ergonomically " \
"by default.") \
\
product(intx, G1ConcRefineServiceInterval, 300, \
product(intx, G1ConcRefinementServiceIntervalMillis, 300, \
"The last concurrent refinement thread wakes up every " \
"specified number of milliseconds to do miscellaneous work.") \
\
product(intx, G1ConcRefineThresholdStep, 0, \
product(intx, G1ConcRefinementThresholdStep, 0, \
"Each time the rset update queue increases by this amount " \
"activate the next refinement thread if available. " \
"Will be selected ergonomically by default.") \
\
product(intx, G1RSUpdatePauseFractionPercent, 10, \
product(intx, G1RSetUpdatingPauseTimePercent, 10, \
"A target percentage of time that is allowed to be spend on " \
"process RS update buffers during the collection pause.") \
\
product(bool, G1AdaptiveConcRefine, true, \
product(bool, G1UseAdaptiveConcRefinement, true, \
"Select green, yellow and red zones adaptively to meet the " \
"the pause requirements.") \
\
......@@ -245,15 +245,15 @@
"the number of regions for which we'll print a surv rate " \
"summary.") \
\
product(bool, G1UseScanOnlyPrefix, false, \
develop(bool, G1UseScanOnlyPrefix, false, \
"It determines whether the system will calculate an optimum " \
"scan-only set.") \
\
product(intx, G1MinReservePercent, 10, \
product(intx, G1ReservePercent, 10, \
"It determines the minimum reserve we should have in the heap " \
"to minimize the probability of promotion failure.") \
\
diagnostic(bool, G1PrintRegions, false, \
diagnostic(bool, G1PrintHeapRegions, false, \
"If set G1 will print information on which regions are being " \
"allocated and which are reclaimed.") \
\
......@@ -263,9 +263,6 @@
develop(bool, G1HRRSFlushLogBuffersOnVerify, false, \
"Forces flushing of log buffers before verification.") \
\
product(bool, G1UseSurvivorSpaces, true, \
"When true, use survivor space.") \
\
develop(bool, G1FailOnFPError, false, \
"When set, G1 will fail when it encounters an FP 'error', " \
"so as to allow debugging") \
......@@ -280,21 +277,21 @@
"If non-0 is the size of the G1 survivor space, " \
"otherwise SurvivorRatio is used to determine the size") \
\
product(bool, G1ForgetfulMMUTracker, false, \
product(bool, G1UseFixedWindowMMUTracker, false, \
"If the MMU tracker's memory is full, forget the oldest entry") \
\
product(uintx, G1HeapRegionSize, 0, \
"Size of the G1 regions.") \
\
experimental(bool, G1ParallelRSetUpdatingEnabled, false, \
experimental(bool, G1UseParallelRSetUpdating, false, \
"Enables the parallelization of remembered set updating " \
"during evacuation pauses") \
\
experimental(bool, G1ParallelRSetScanningEnabled, false, \
experimental(bool, G1UseParallelRSetScanning, false, \
"Enables the parallelization of remembered set scanning " \
"during evacuation pauses") \
\
product(uintx, G1ParallelRSetThreads, 0, \
product(uintx, G1ConcRefinementThreads, 0, \
"If non-0 is the number of parallel rem set update threads, " \
"otherwise the value is determined ergonomically.") \
\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册