-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8365190: Remove LockingMode related code from share #27041
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
👋 Welcome back fbredberg! A progress list of the required criteria for merging this PR into |
@fbredber This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 21 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@fbredber 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. |
@@ -1669,7 +1669,7 @@ bool PhaseIterGVN::verify_Ideal_for(Node* n, bool can_reshape) { | |||
// | |||
// Found (linux x64 only?) with: | |||
// serviceability/sa/ClhsdbThreadContext.java | |||
// -XX:+UnlockExperimentalVMOptions -XX:LockingMode=1 -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyIterativeGVN=1110 |
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.
For traceability, I suggest leaving this line untouched and adding a comment in the next line clarifying that -XX:LockingMode
is not available anymore.
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.
A few comments and suggestions for your next RFE.
@@ -341,7 +341,6 @@ | |||
volatile_nonstatic_field(ObjectMonitor, _recursions, intptr_t) \ | |||
volatile_nonstatic_field(ObjectMonitor, _entry_list, ObjectWaiter*) \ | |||
volatile_nonstatic_field(ObjectMonitor, _succ, int64_t) \ | |||
volatile_nonstatic_field(ObjectMonitor, _stack_locker, BasicLock*) \ |
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 are some jvmci tests that check that the java side of jvmci matches, ie:
make test TEST=compiler/jvmci
void set_bad_metadata_deopt() { set_metadata(badDispHeaderDeopt); } | ||
|
||
// LM_LEGACY | ||
inline markWord displaced_header() const; | ||
inline void set_displaced_header(markWord header); | ||
static int displaced_header_offset_in_bytes() { return metadata_offset_in_bytes(); } |
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.
Also delete line 51 ?
assert(_held_monitor_count >= _jni_monitor_count || is_exiting(), "Monitor count discrepancy detected - held count " | ||
"%zd is less than JNI count %zd", _held_monitor_count, _jni_monitor_count); | ||
// Nothing to do. Just do some sanity check. | ||
assert(_held_monitor_count == 0, "counter should not be used"); |
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.
In further cleanup, can we now remove _held_monitor_count next?
// an inflated ObjectMonitor* for a monitor, and expects to throw a | ||
// java.lang.IllegalMonitorStateException if it is not held by the current | ||
// thread. Such as notify/wait and jni_exit. LM_LIGHTWEIGHT keeps it invariant | ||
// ObjectMonitor* when lightweight locking is used. It is used from contexts |
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 guess you don't need the phrase "when lightweight locking is used".
// that the locking_thread == Thread::current() or is suspended throughout the call by | ||
// some other mechanism. | ||
// Even with LM_LIGHTWEIGHT the thread might be nullptr when called from a non | ||
// The JavaThread* locking_thread parameter is only used by lightweight locking and |
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.
Same here. suggestion:
// The JavaThread* locking parameter requires that the locking_thread == JavaThread::current, or is suspended
// throughout the call by some other mechanism.
// dropped by the calling thread. | ||
monitor = inflate(current, obj(), inflate_cause_notify); | ||
} | ||
monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK); |
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.
Declare and initialize on the same line:
ObjectMonitor* monitor = LightwightSynchronizer::inflate_locked_or_imse(obj...);
// dropped by the calling thread. | ||
monitor = inflate(current, obj(), inflate_cause_notify); | ||
} | ||
monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK); |
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.
same here with
ObjectMonitor* monitor = LIght ...
I think we should have another RFE to look at eliminating the middle call. Call these in LIghtweightSynchronizer::notify, notifyAll and waitInterruptably directly and remove these functions.
@@ -45,11 +45,7 @@ inline ObjectMonitor* ObjectSynchronizer::read_monitor(Thread* current, oop obj, | |||
inline void ObjectSynchronizer::enter(Handle obj, BasicLock* lock, JavaThread* current) { | |||
assert(current == Thread::current(), "must be"); | |||
|
|||
if (LockingMode == LM_LIGHTWEIGHT) { | |||
LightweightSynchronizer::enter(obj, lock, current); |
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.
In the further RFE, we should remove these dispatch functions too.
Since the integration of JDK-8359437 the
LockingMode
flag can no longer be set by the user. After that, a number of PRs has been integrated which has removed allLockingMode
related code from all platforms (except from zero, which is done in this PR).This PR removes
LockingMode
related code from the shared (non-platform specific) files. It also removes theLockingMode
variable itself.Passes tier1-tier5 with no added problems.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27041/head:pull/27041
$ git checkout pull/27041
Update a local copy of the PR:
$ git checkout pull/27041
$ git pull https://git.openjdk.org/jdk.git pull/27041/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27041
View PR using the GUI difftool:
$ git pr show -t 27041
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27041.diff
Using Webrev
Link to Webrev Comment