-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8329726: Use non-short forward jumps in lightweight locking #18657
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
Conversation
👋 Welcome back rkennke! A progress list of the required criteria for merging this PR into |
@rkennke 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 18 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 |
Webrevs
|
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.
Sad to give up a short jump in synchronization code just for asserts. Maybe we give up on code readability a bit? E.g.:
#ifdef ASSERT
// Check that locked label is reached with ZF set.
Label zf_bad_zero, zf_correct;
jcc(Assembler::zero, zf_correct);
jmp(zf_bad_zero)
#endif
bind(slow_path);
#ifdef ASSERT
// Check that slow_path label is reached with ZF not set.
jccb(Assembler::notZero, zf_correct);
stop("Fast Lock ZF != 0");
bind(zf_bad_zero);
stop("Fast Lock ZF != 1");
bind(zf_correct);
#endif
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.
Good.
Although a time out is a bit of a confusing failure mode for the test, I think it would be better than no test at all, right? |
Right. I added a test-case with a short timeout. It fails without the change, and passes with it. |
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.
lgtm.
@TobiHartmann could you check the test? I am not sure if the flags are reasonable. |
Looks good but I think it's safer to use the default timeout because otherwise we risk a false-positive timeout on slow machines when running with additional flags like -XX:+DeoptimizeALot. |
/integrate |
Going to push as commit 2e925f2.
Your commit was automatically rebased without conflicts. |
This turns a few short-jumps to long-jumps in x86 lightweight locking code paths. When running with -XX:+ShowMessageBoxOnError, MA::stop() generates more code and jccb is not sufficient to address this.
Two of the jccb are in ASSERT path anyway. However, another is also in a product path. We could generate jccb or jcc conditionally on ShowMessageBoxOnError, however, I don't think it is worth the trouble. WDYT?
Unfortunately, I could not make a simple test-case, because ShowMessageBoxOnError stops and waits on error, which would make jtreg time-out.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18657/head:pull/18657
$ git checkout pull/18657
Update a local copy of the PR:
$ git checkout pull/18657
$ git pull https://git.openjdk.org/jdk.git pull/18657/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18657
View PR using the GUI difftool:
$ git pr show -t 18657
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18657.diff
Webrev
Link to Webrev Comment