author | stefank |
Mon, 07 May 2018 14:42:05 +0200 | |
changeset 50033 | 000c697c81db |
parent 49857 | 31e07291ae29 |
child 50289 | 0195ee80e530 |
permissions | -rw-r--r-- |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
1 |
/* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
4 |
* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
8 |
* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
13 |
* accompanied this code). |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
14 |
* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
18 |
* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
21 |
* questions. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
22 |
* |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
23 |
*/ |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
24 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
26 |
#include "gc/cms/jvmFlagConstraintsCMS.hpp" |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
27 |
#include "gc/cms/concurrentMarkSweepGeneration.inline.hpp" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
28 |
#include "gc/shared/cardTableRS.hpp" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
29 |
#include "gc/shared/collectedHeap.hpp" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
30 |
#include "gc/shared/genCollectedHeap.hpp" |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
31 |
#include "gc/shared/jvmFlagConstraintsGC.hpp" |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
32 |
#include "memory/universe.hpp" |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
33 |
#include "runtime/flags/jvmFlagRangeList.hpp" |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
34 |
#include "runtime/globals_extension.hpp" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
35 |
#include "utilities/globalDefinitions.hpp" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
36 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
37 |
static JVMFlag::Error ParallelGCThreadsAndCMSWorkQueueDrainThreshold(uint threads, uintx threshold, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
38 |
// CMSWorkQueueDrainThreshold is verified to be less than max_juint |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
39 |
if (UseConcMarkSweepGC && (threads > (uint)(max_jint / (uint)threshold))) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
40 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
41 |
"ParallelGCThreads (" UINT32_FORMAT ") or CMSWorkQueueDrainThreshold (" |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
42 |
UINTX_FORMAT ") is too large\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
43 |
threads, threshold); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
44 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
45 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
46 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
47 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
48 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
49 |
JVMFlag::Error ParallelGCThreadsConstraintFuncCMS(uint value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
50 |
// To avoid overflow at ParScanClosure::do_oop_work. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
51 |
if (UseConcMarkSweepGC && (value > (max_jint / 10))) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
52 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
53 |
"ParallelGCThreads (" UINT32_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
54 |
"less than or equal to " UINT32_FORMAT " for CMS GC\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
55 |
value, (max_jint / 10)); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
56 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
57 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
58 |
return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(value, CMSWorkQueueDrainThreshold, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
59 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
60 |
JVMFlag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
61 |
if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
62 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
63 |
"ParGCStridesPerThread (" UINTX_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
64 |
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
65 |
value, ((uintx)max_jint / (uintx)ParallelGCThreads)); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
66 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
67 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
68 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
69 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
70 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
71 |
JVMFlag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
72 |
if (UseConcMarkSweepGC) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
73 |
// ParGCCardsPerStrideChunk should be compared with card table size. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
74 |
size_t heap_size = Universe::heap()->reserved_region().word_size(); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
75 |
CardTableRS* ct = GenCollectedHeap::heap()->rem_set(); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
76 |
size_t card_table_size = ct->cards_required(heap_size) - 1; // Valid card table size |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
77 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
78 |
if ((size_t)value > card_table_size) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
79 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
80 |
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
81 |
"must be less than or equal to card table size (" SIZE_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
82 |
value, card_table_size); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
83 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
84 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
85 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
86 |
// ParGCCardsPerStrideChunk is used with n_strides(ParallelGCThreads*ParGCStridesPerThread) |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
87 |
// from CardTableRS::process_stride(). Note that ParGCStridesPerThread is already checked |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
88 |
// not to make an overflow with ParallelGCThreads from its constraint function. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
89 |
uintx n_strides = ParallelGCThreads * ParGCStridesPerThread; |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
90 |
uintx ergo_max = max_uintx / n_strides; |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
91 |
if ((uintx)value > ergo_max) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
92 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
93 |
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
94 |
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
95 |
value, ergo_max); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
96 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
97 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
98 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
99 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
100 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
101 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
102 |
JVMFlag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) { |
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
103 |
JVMFlag::Error status = JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
104 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
105 |
if (UseConcMarkSweepGC) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
106 |
if (value > CMSOldPLABMax) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
107 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
108 |
"CMSOldPLABMin (" SIZE_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
109 |
"less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
110 |
value, CMSOldPLABMax); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
111 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
112 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
113 |
status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
114 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
115 |
return status; |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
116 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
117 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
118 |
JVMFlag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) { |
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
119 |
JVMFlag::Error status = JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
120 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
121 |
if (UseConcMarkSweepGC) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
122 |
status = MaxPLABSizeBounds("CMSOldPLABMax", value, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
123 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
124 |
return status; |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
125 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
126 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
127 |
static JVMFlag::Error CMSReservedAreaConstraintFunc(const char* name, size_t value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
128 |
if (UseConcMarkSweepGC) { |
50033
000c697c81db
8202639: Use concrete Generation classes in SerialHeap and CMSHeap
stefank
parents:
49857
diff
changeset
|
129 |
ConcurrentMarkSweepGeneration* cms = CMSHeap::heap()->old_gen(); |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
130 |
const size_t ergo_max = cms->cmsSpace()->max_flag_size_for_task_size(); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
131 |
if (value > ergo_max) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
132 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
133 |
"%s (" SIZE_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
134 |
"less than or equal to ergonomic maximum (" SIZE_FORMAT ") " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
135 |
"which is based on the maximum size of the old generation of the Java heap\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
136 |
name, value, ergo_max); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
137 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
138 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
139 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
140 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
141 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
142 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
143 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
144 |
JVMFlag::Error CMSRescanMultipleConstraintFunc(size_t value, bool verbose) { |
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
145 |
JVMFlag::Error status = CMSReservedAreaConstraintFunc("CMSRescanMultiple", value, verbose); |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
146 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
147 |
if (status == JVMFlag::SUCCESS && UseConcMarkSweepGC) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
148 |
// CMSParRemarkTask::do_dirty_card_rescan_tasks requires CompactibleFreeListSpace::rescan_task_size() |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
149 |
// to be aligned to CardTable::card_size * BitsPerWord. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
150 |
// Note that rescan_task_size() will be aligned if CMSRescanMultiple is a multiple of 'HeapWordSize' |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
151 |
// because rescan_task_size() is CardTable::card_size / HeapWordSize * BitsPerWord. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
152 |
if (value % HeapWordSize != 0) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
153 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
154 |
"CMSRescanMultiple (" SIZE_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
155 |
"a multiple of " SIZE_FORMAT "\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
156 |
value, HeapWordSize); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
157 |
status = JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
158 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
159 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
160 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
161 |
return status; |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
162 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
163 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
164 |
JVMFlag::Error CMSConcMarkMultipleConstraintFunc(size_t value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
165 |
return CMSReservedAreaConstraintFunc("CMSConcMarkMultiple", value, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
166 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
167 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
168 |
JVMFlag::Error CMSPrecleanDenominatorConstraintFunc(uintx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
169 |
if (UseConcMarkSweepGC && (value <= CMSPrecleanNumerator)) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
170 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
171 |
"CMSPrecleanDenominator (" UINTX_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
172 |
"strickly greater than CMSPrecleanNumerator (" UINTX_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
173 |
value, CMSPrecleanNumerator); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
174 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
175 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
176 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
177 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
178 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
179 |
JVMFlag::Error CMSPrecleanNumeratorConstraintFunc(uintx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
180 |
if (UseConcMarkSweepGC && (value >= CMSPrecleanDenominator)) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
181 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
182 |
"CMSPrecleanNumerator (" UINTX_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
183 |
"less than CMSPrecleanDenominator (" UINTX_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
184 |
value, CMSPrecleanDenominator); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
185 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
186 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
187 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
188 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
189 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
190 |
JVMFlag::Error CMSSamplingGrainConstraintFunc(uintx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
191 |
if (UseConcMarkSweepGC) { |
50033
000c697c81db
8202639: Use concrete Generation classes in SerialHeap and CMSHeap
stefank
parents:
49857
diff
changeset
|
192 |
size_t max_capacity = CMSHeap::heap()->young_gen()->max_capacity(); |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
193 |
if (value > max_uintx - max_capacity) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
194 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
195 |
"CMSSamplingGrain (" UINTX_FORMAT ") must be " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
196 |
"less than or equal to ergonomic maximum (" SIZE_FORMAT ")\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
197 |
value, max_uintx - max_capacity); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
198 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
199 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
200 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
201 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
202 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
203 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
204 |
JVMFlag::Error CMSWorkQueueDrainThresholdConstraintFunc(uintx value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
205 |
if (UseConcMarkSweepGC) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
206 |
return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(ParallelGCThreads, value, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
207 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
208 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
209 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
210 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
211 |
JVMFlag::Error CMSBitMapYieldQuantumConstraintFunc(size_t value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
212 |
// Skip for current default value. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
213 |
if (UseConcMarkSweepGC && FLAG_IS_CMDLINE(CMSBitMapYieldQuantum)) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
214 |
// CMSBitMapYieldQuantum should be compared with mark bitmap size. |
50033
000c697c81db
8202639: Use concrete Generation classes in SerialHeap and CMSHeap
stefank
parents:
49857
diff
changeset
|
215 |
ConcurrentMarkSweepGeneration* cms = CMSHeap::heap()->old_gen(); |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
216 |
size_t bitmap_size = cms->collector()->markBitMap()->sizeInWords(); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
217 |
|
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
218 |
if (value > bitmap_size) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
219 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
220 |
"CMSBitMapYieldQuantum (" SIZE_FORMAT ") must " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
221 |
"be less than or equal to bitmap size (" SIZE_FORMAT ") " |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
222 |
"whose size corresponds to the size of old generation of the Java heap\n", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
223 |
value, bitmap_size); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
224 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
225 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
226 |
} |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
227 |
return JVMFlag::SUCCESS; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
228 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
229 |
|
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
230 |
JVMFlag::Error OldPLABSizeConstraintFuncCMS(size_t value, bool verbose) { |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
231 |
if (value == 0) { |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
232 |
CommandLineError::print(verbose, |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
233 |
"OldPLABSize (" SIZE_FORMAT ") must be greater than 0", |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
234 |
value); |
49857
31e07291ae29
8081519: Split globals.hpp to factor out the Flag class
gziemski
parents:
49731
diff
changeset
|
235 |
return JVMFlag::VIOLATES_CONSTRAINT; |
49731
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
236 |
} |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
237 |
// For CMS, OldPLABSize is the number of free blocks of a given size that are used when |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
238 |
// replenishing the local per-worker free list caches. |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
239 |
// For more details, please refer to Arguments::set_cms_and_parnew_gc_flags(). |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
240 |
return MaxPLABSizeBounds("OldPLABSize", value, verbose); |
635838cb8b3a
8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff
changeset
|
241 |
} |