[Misc] Return suggested value for constraint funcs#878
Open
ziyilin wants to merge 1 commit intodragonwell-project:masterfrom
Open
[Misc] Return suggested value for constraint funcs#878ziyilin wants to merge 1 commit intodragonwell-project:masterfrom
ziyilin wants to merge 1 commit intodragonwell-project:masterfrom
Conversation
7377313 to
ab920bd
Compare
aa883b3 to
bda9bf3
Compare
kuaiwei
reviewed
Dec 2, 2024
| diagnostic(bool, VerifyFlagConstraints, false, \ | ||
| "Verify flags, calculate suggested legal values for that " \ | ||
| "violate the constraints, and then exit VM") \ | ||
| \ |
Collaborator
There was a problem hiding this comment.
我们添加的参数建议放在globals_ext.hpp中
kuaiwei
reviewed
Dec 4, 2024
| // CMSWorkQueueDrainThreshold is verified to be less than max_juint | ||
| if (UseConcMarkSweepGC && (threads > (uint)(max_jint / (uint)threshold))) { | ||
| if (VerifyFlagConstraints) { | ||
| //JVMFlag::printError(true, "ParallelGCThreads:"UINT32_FORMAT"\n", ) |
Collaborator
Author
There was a problem hiding this comment.
目前先不支持CMS,我把这里的检查去掉了
|
|
||
| if (status == JVMFlag::SUCCESS) { | ||
| status = CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(value, SoftRefLRUPolicyMSPerMB, verbose); | ||
| if ((SoftRefLRUPolicyMSPerMB > 0) && ((value / M) > (max_uintx / SoftRefLRUPolicyMSPerMB))) { |
Collaborator
Author
There was a problem hiding this comment.
CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB原先被SoftRefLRUPolicyMSPerMBConstraintFunc和MaxHeapSizeConstraintFunc公用,原先分别在两个use里展开就不用检查来源了。不过还是应该提高复用度,已经修改了CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB函数的声明,增加了来源。
| #ifdef COMPILER2 | ||
| #include "opto/c2_globals.hpp" | ||
| #endif // COMPILER2 | ||
| #include <cmath> |
| #include "runtime/globals.hpp" | ||
| #include "runtime/safepointMechanism.hpp" | ||
| #include "runtime/task.hpp" | ||
| #include <cmath> |
| if (VerifyFlagConstraints) { | ||
| verifyFailed = true; | ||
| int logValue = log2_intptr(value); | ||
| value = (intx)pow(2, logValue); |
| if (VerifyFlagConstraints) { | ||
| verifyFailed = true; | ||
| int logValue = log2_intptr(value); | ||
| value = (intx)pow(2, logValue); |
| #include "runtime/flags/jvmFlagConstraintsCompiler.hpp" | ||
| #include "runtime/globals.hpp" | ||
| #include "runtime/globals_extension.hpp" | ||
| #include <cmath> |
| return JVMFlag::VIOLATES_CONSTRAINT; | ||
| } | ||
|
|
||
| //InvocationCounter::count_shift = 3 |
| "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") " | ||
| "to align entry points\n", | ||
| CodeCacheSegmentSize, CodeEntryAlignment); | ||
| "CodeCacheSegmentSize (" UINTX_FORMAT ") must be " |
| } | ||
|
|
||
| JVMFlag::Error CodeEntryAlignmentConstraintFunc(intx value, bool verbose) { | ||
| // Don't apply VerifyFlagConstraints here because CodeEntryAlignment is not production parameter. |
b204782 to
92d3bd5
Compare
Summary: Return suggested option value when it violates the constraints. Exit the VM after all input options are checked. Testing: JTreg Reviewers: Kuaiwei, wenjie Issue: dragonwell-project#894
92d3bd5 to
4f2ef01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verify JVM parameters, print out suggested values for violations instead of error message.
Enable by
-XX:+VerifyFlagConstraints.