-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout #21662
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 stefank! A progress list of the required criteria for merging this PR into |
|
@stefank 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 26 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.
The changes make sense to me and the code now matches the C++ implementation on HotSpot. Thanks!
| reserveForAllocationPrefetch = (int)reserveForAllocationPrefetchField.getCInteger(intType); | ||
|
|
||
| Type collectedHeap = db.lookupType("CollectedHeap"); | ||
| CIntegerType sizeType = (CIntegerType) db.lookupType("size_t"); |
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 can use getSizet() here.
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.
getSizet() seems to be a function in Flags, so I don't see a direct way to use it. I could probably use the sizetType instead of db.lookupType("size_t"), however when I tested the tests failed because sizetType had not been initialized yet.
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 looks like sizetType is initialized further down in the constructor. You could move that up (and the other 6 types also) or move your new code down. And speaking of the new code, it is misplaced in the try block. Both the comment for that block and the exception thrown have to do with getting the version. The reserveForAllocationPrefetch code just above is also misplaced for the same reason. That got added by JDK-8004710. Perhaps some cleanup is in order here. I don't think a try/catch/throw is needed for the tlab code. There are other places in the constructor that can throw an exception, and if that happens, it should be obvious from the stack trace where it happened. That is all you need to debug the issue. I think maybe the VMVersion section was special cased since it is the most likely failure point if something is really wrong that will result in a failure of SA to startup.
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.
OK. I did some cleanups. Could you take a look and see if this is good enough to get this integrated?
This reverts commit e8ec295.
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.
Looks good. Please update the SA copyrights before integrating.
|
/integrate |
|
@stefank This pull request has not yet been marked as ready for integration. |
|
Thanks for the reviews! |
|
Going to push as commit 3c5db12.
Your commit was automatically rebased without conflicts. |
When testing Lilliput we found a failure in
serviceability/sa/ClhsdbJstackWithConcurrentLock.javatest when running with C1-only.The test uses the SA's thread printing feature to print the threads and the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers".
When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section:
It should be saying:
The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working.
I can get this test to pass, with and without compact object headers, by fixing the code in
ThreadLocalAllocBuffer::hard_end().This is a reproducer of the problem:
I've tested this by running all 'serviceability' tests in our tier1-9 testing.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21662/head:pull/21662$ git checkout pull/21662Update a local copy of the PR:
$ git checkout pull/21662$ git pull https://git.openjdk.org/jdk.git pull/21662/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21662View PR using the GUI difftool:
$ git pr show -t 21662Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21662.diff
Webrev
Link to Webrev Comment