-
Notifications
You must be signed in to change notification settings - Fork 6k
8359437: Make users and test suite not able to set LockingMode flag #25847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
/help |
👋 Welcome back toxaart! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@toxaart Available commands:
|
@toxaart The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
/contributor add @fbredber |
@toxaart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken an initial pass through. Initially I misunderstood the strategy with heavy monitors - see comments below.
if (LockingMode == LM_LEGACY) { | ||
FLAG_SET_CMDLINE(LockingMode, LM_LIGHTWEIGHT); | ||
LockingMode = LM_LIGHTWEIGHT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have prevented the locking mode from being set then surely we can never encounter this case?
@@ -33,21 +33,6 @@ | |||
* @run main/othervm/timeout=240 -Xbootclasspath/a:. | |||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI | |||
* -Xint | |||
* -XX:LockingMode=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering why these LockingMode=0 test cases were not setting VerifyHeavyMonitors
instead, but I'm assuming the intent now is that we will only test that mode when it is set externally by the user (or in our case a particular test task definition)?
I also realized we can only test heavy monitors in tests where we explicitly control the monitor creation places and hence can call the WB method to force inflation. That obviously reduces the test coverage for that mode quite significantly - but perhaps that will be handled if in the future we implicitly reenable forced inflation and do away with the WB usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to remove significant test coverage. can we not adapt the tests to not rely on logging warnings that will no longer be present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The premise of this test is now invalid. We could write a fresh new test if we'd like to see what happens with UseHeavyMonitors, and/or retrieve this from git history.
@@ -56,6 +56,8 @@ int LogMinObjAlignmentInBytes = -1; | |||
// Oop encoding heap max | |||
uint64_t OopEncodingHeapMax = 0; | |||
|
|||
int LockingMode = LM_LIGHTWEIGHT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ?
@@ -1009,6 +1009,8 @@ enum LockingMode { | |||
LM_LIGHTWEIGHT = 2 | |||
}; | |||
|
|||
extern int LockingMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a request for some more deieting.
@@ -212,11 +122,8 @@ | |||
|
|||
public class TestRecursiveLocking { | |||
static final WhiteBox WB = WhiteBox.getWhiteBox(); | |||
static final int flagLockingMode = WB.getIntVMFlag("LockingMode").intValue(); | |||
static final boolean flagHeavyMonitors = WB.getBooleanVMFlag("VerifyHeavyMonitors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should take out the VerifyHeavyMonitors cases. @fbredber originally had that flag turn on a the reintroduced UseHeavyMonitors option but the UseHeavyMonitors option doesn't actually do that with this change. I don't think this test will pass with -XX:+VerifyHeavyMonitors.
If we reintroduce UseHeavyMonitors, save this diff and fix this test then. Right now it's not correct.
@@ -39,8 +39,7 @@ | |||
|
|||
public class TestLockStackCapacity { | |||
static final WhiteBox WB = WhiteBox.getWhiteBox(); | |||
static final int LockingMode = WB.getIntVMFlag("LockingMode").intValue(); | |||
static final int LM_LIGHTWEIGHT = 2; | |||
static final boolean flagHeavyMonitors = WB.getBooleanVMFlag("VerifyHeavyMonitors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also not have cases for VerifyHeavyMonitors. We can add back tests if we want UseHeavyMonitors. As of now, removing the Legacy locking code will remove code that reaches the VerifyHeavyMonitors branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The premise of this test is now invalid. We could write a fresh new test if we'd like to see what happens with UseHeavyMonitors, and/or retrieve this from git history.
@@ -423,10 +423,11 @@ protected String vmHasDTrace() { | |||
*/ | |||
protected String vmRTMCompiler() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue to remove this function since it's now unused.
This PR contains changes for the 1st phase of the
LockingMode
flag obsoletion.The work is done by @fbredber, I have taken it over and am finishing it while he's on vacation.
In the 1st phase one keeps the
LockingMode
variable in all places, but makes it non-settable from the command line. All the C1 and C2 code related to legacy locking will still be in place (but as dead code) and removed later (phase 2).Lightweight locking is the default locking from now on.
Tested in tiers 1 - 7.
Progress
Issue
Backport <hash>
with the hash of the original commit. See Backports.Contributors
<[email protected]>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25847/head:pull/25847
$ git checkout pull/25847
Update a local copy of the PR:
$ git checkout pull/25847
$ git pull https://git.openjdk.org/jdk.git pull/25847/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25847
View PR using the GUI difftool:
$ git pr show -t 25847
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25847.diff