mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8078556: Runtime: implement ranges (optionally constraints) for those flags that have them missing
JEP 245: implement ranges and constraints for runtime flags. Co-authored-by: Goetz Lindenmaier <goetz.lindenmaier@sap.com> Reviewed-by: coleenp, ddmitriev, jiangli, goetz
This commit is contained in:
parent
7b389d3533
commit
22838597ea
17 changed files with 225 additions and 57 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "runtime/commandLineFlagConstraintsRuntime.hpp"
|
||||
#include "runtime/commandLineFlagRangeList.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
#include "runtime/task.hpp"
|
||||
#include "utilities/defaultStream.hpp"
|
||||
|
||||
Flag::Error ObjectAlignmentInBytesConstraintFunc(intx value, bool verbose) {
|
||||
|
@ -41,7 +42,7 @@ Flag::Error ObjectAlignmentInBytesConstraintFunc(intx value, bool verbose) {
|
|||
if (value >= (intx)os::vm_page_size()) {
|
||||
CommandLineError::print(verbose,
|
||||
"ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
|
||||
"less than page size " INTX_FORMAT "\n",
|
||||
"less than page size (" INTX_FORMAT ")\n",
|
||||
value, (intx)os::vm_page_size());
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
}
|
||||
|
@ -51,7 +52,7 @@ Flag::Error ObjectAlignmentInBytesConstraintFunc(intx value, bool verbose) {
|
|||
// Need to enforce the padding not to break the existing field alignments.
|
||||
// It is sufficient to check against the largest type size.
|
||||
Flag::Error ContendedPaddingWidthConstraintFunc(intx value, bool verbose) {
|
||||
if ((value != 0) && ((value % BytesPerLong) != 0)) {
|
||||
if ((value % BytesPerLong) != 0) {
|
||||
CommandLineError::print(verbose,
|
||||
"ContendedPaddingWidth (" INTX_FORMAT ") must be "
|
||||
"a multiple of %d\n",
|
||||
|
@ -61,3 +62,71 @@ Flag::Error ContendedPaddingWidthConstraintFunc(intx value, bool verbose) {
|
|||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Flag::Error BiasedLockingBulkRebiasThresholdFunc(intx value, bool verbose) {
|
||||
if (value > BiasedLockingBulkRevokeThreshold) {
|
||||
CommandLineError::print(verbose,
|
||||
"BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ") must be "
|
||||
"less than or equal to BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")\n",
|
||||
value, BiasedLockingBulkRevokeThreshold);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else {
|
||||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Flag::Error BiasedLockingStartupDelayFunc(intx value, bool verbose) {
|
||||
if ((value % PeriodicTask::interval_gran) != 0) {
|
||||
CommandLineError::print(verbose,
|
||||
"BiasedLockingStartupDelay (" INTX_FORMAT ") must be "
|
||||
"evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
|
||||
value, PeriodicTask::interval_gran);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else {
|
||||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Flag::Error BiasedLockingBulkRevokeThresholdFunc(intx value, bool verbose) {
|
||||
if (value < BiasedLockingBulkRebiasThreshold) {
|
||||
CommandLineError::print(verbose,
|
||||
"BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ") must be "
|
||||
"greater than or equal to BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")\n",
|
||||
value, BiasedLockingBulkRebiasThreshold);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else if ((double)value/(double)BiasedLockingDecayTime > 0.1) {
|
||||
CommandLineError::print(verbose,
|
||||
"The ratio of BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")"
|
||||
" to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
|
||||
"less than or equal to 0.1\n",
|
||||
value, BiasedLockingBulkRebiasThreshold);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else {
|
||||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Flag::Error BiasedLockingDecayTimeFunc(intx value, bool verbose) {
|
||||
if (BiasedLockingBulkRebiasThreshold/(double)value > 0.1) {
|
||||
CommandLineError::print(verbose,
|
||||
"The ratio of BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")"
|
||||
" to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
|
||||
"less than or equal to 0.1\n",
|
||||
BiasedLockingBulkRebiasThreshold, value);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else {
|
||||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Flag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose) {
|
||||
if ((value % PeriodicTask::interval_gran != 0)) {
|
||||
CommandLineError::print(verbose,
|
||||
"PerfDataSamplingInterval (" INTX_FORMAT ") must be "
|
||||
"evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
|
||||
value, PeriodicTask::interval_gran);
|
||||
return Flag::VIOLATES_CONSTRAINT;
|
||||
} else {
|
||||
return Flag::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue