-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
8293503: gc/metaspace/TestMetaspacePerfCounters.java#Epsilon-64 failed assertGreaterThanOrEqual: expected MMM >= NNN #10239
Conversation
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
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 to me.
@tschatzl 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 60 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.
Looks good, other than the name of the snapshot equivalency check.
Thanks @kimbarrett @lkorinth for your reviews |
Going to push as commit 04d7b7d.
Your commit was automatically rebased without conflicts. |
Hi all,
can I have reviews for this change that workarounds some epsilon gc specific behavior in the gc/metaspace/TestMetaspacePerfCounters test?
The test gathers statistics about metaspace to check one by one:
[...]
For Epsilon GC the assumption stated in the comment in the code does not hold (and in general, it seems more because of knowledge about Hotspot than actual specification) - Epsilon also updates the statistics every X TLAB refills without a pause. Without these updates at TLAB refill, Epsilon would mostly always never update these (it does not do any GC by itself, only out-of-metaspace GC actually performs one).
The problem then is that if there is such an update between getCapacity() and getUsed(), used can be larger than capacity gathered before as both may have changed at the second call. It also assumes that there is sufficient memory visibility related synchronization between these calls.
There is no way to get multiple performance counter values atomically as e.g. in the MemoryMXBean API, so some inconsistency is probably expected.
So the suggested fix here is to get two snapshots of the values, separated by a memory barrier and only continue if both snapshots are equal.
Testing: running the test for 1000 times without issue, fails 10 times or so without this patch
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10239/head:pull/10239
$ git checkout pull/10239
Update a local copy of the PR:
$ git checkout pull/10239
$ git pull https://git.openjdk.org/jdk pull/10239/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10239
View PR using the GUI difftool:
$ git pr show -t 10239
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10239.diff