-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8266130: convert Thread-SMR stress tests from counter based to time based #4237
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
/label add hotspot-runtime |
👋 Welcome back dcubed! A progress list of the required criteria for merging this PR into |
@dcubed-ojdk |
@dcubed-ojdk |
Webrevs
|
Here are my Mach5 Tier[1-7] results: Mach5 Tier1:
Mach5 Tier2:
Mach5 Tier3:
Mach5 Tier4:
Mach5 Tier5:
Mach5 Tier6:
Mach5 Tier7:
Because of the failures in the upper tiers, when this PR is integrated I will be ProblemListing: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 The suspendthrd003/8264605 failure had been seen one time in the CI on 2021.04.01 |
Ping! Any takers? |
Yes. Hopefully in the next day or two. |
thread.startSyncObj.await(); | ||
// Tell the worker thread to race to the exit and the | ||
// Thread.interrupt() calls will come in during thread exit. | ||
thread.exitSyncObj.countDown(); | ||
while (true) { | ||
thread.interrupt(); |
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 just want to make sure I correctly understand the intent here. You call countDown() to unblock the thread's run() method, and then immediately interrupt the thread to create a race between the thread doing a normal exit and the thread being interrupted before or as it exits.
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.
That is correct. The intention is to stress the Thread.interrupt() calls
on the exiting thread.
// Thread.stop() calls will come in during thread exit. | ||
thread.exitSyncObj.countDown(); | ||
while (true) { | ||
thread.stop(); |
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.
It seems the main() method of these 6 or so thread tests are identical except for the one Thread API you call at this location. Have you considered refactoring so there is only one copy of all the common code?
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.
Not really. It would be harder to use one of these tests in a standalone
fashion outside of JTREG runs if it depended on another .java file.
|
||
System.out.println("Case 2: java.lang.Thread.interrupt()"); |
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.
Was Case 2 removed because it is covered by runtime/Thread/InterruptAtExit.java
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.
Yes, it seemed like duplicated coverage to me.
* Using printf() instead of NSK_DISPLAY1() in this loop | ||
* in order to slow down the rate of SuspendThread() calls. |
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 don't understand the reason for wanting to slow down the rate, nor your reason for removing 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.
I couldn't remember why I did that when I wrote the test so
I removed 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.
Maybe to allow the resume to get the thread back into real code before the next suspend hits?
@dcubed-ojdk 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 235 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 |
@plummercj - Thanks for the review! Any other takers out there? |
…cription.java until 8264605 is fixed and vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java until 8266593 is fixed.
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.
Hi Dan,
This all seems okay. Sorry it took so long to get to it.
Note: All the usage() calls are indented incorrectly.
Thanks,
David
* Using printf() instead of NSK_DISPLAY1() in this loop | ||
* in order to slow down the rate of SuspendThread() calls. |
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.
Maybe to allow the resume to get the thread back into real code before the next suspend hits?
@dholmes-ora - Thanks for the review! I fixed the indent on the usage() calls. |
/integrate |
@dcubed-ojdk Since your change was applied there have been 236 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit f677163. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The Thread-SMR project added counter based tests for various APIs.
See "JDK-8167108 inconsistent handling of SR_lock can lead to crashes".
Time based tests are more appropriate for stress kits so I'm
updating the counter based tests to be time based instead.
Two of the updated tests have shaken out failures that are tracked by:
These updated tests are tested via Mach5 Tier[134567].
They have also been test by my Stress Kit runs for jdk-17+2[0-5].
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4237/head:pull/4237
$ git checkout pull/4237
Update a local copy of the PR:
$ git checkout pull/4237
$ git pull https://git.openjdk.java.net/jdk pull/4237/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4237
View PR using the GUI difftool:
$ git pr show -t 4237
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4237.diff