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
JDK-8257989: Error in gtest os_page_size_for_region_unaligned after 8257588 #1719
Conversation
👋 Welcome back mgkwill! A progress list of the required criteria for merging this PR into |
/reviewer @tstuefe |
@mgkwill Syntax:
|
/reviewer @tstuefe |
@mgkwill Syntax:
|
Hi, Fix makes sense and is trivial. I opened https://bugs.openjdk.java.net/browse/JDK-8257989 for this. ("Trivial" means only needs one reviewer and can be integrated right away without waiting the obligatory 24hrs). But please change the title of the PR to "JDK-8257989: Error in gtest os_page_size_for_region_unaligned after 8257588" before pushing, otherwise skara gets confused. |
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. Thanks for finding this!
@mgkwill 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 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@tstuefe) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
@tstuefe @mgkwill Since your change was applied there have been 5 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit b977a7b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Compare actual = next_smaller(s) to (s - 17) instead of actual Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
There appears to be a bug at ln105 of test/hotspot/gtest/runtime/test_os.cpp
https://github.com/openjdk/jdk/pull/1522/files/163b308b97c07d567c48f100475481cdc5e75740#diff-6d3fc66964a0fccf7f85c284fffec5dffa62be8497423a7684cee83d55338884R104
// Given a slightly smaller size than a page size, // return the next smaller page size. if (os::_page_sizes[1] > os::_page_sizes[0]) { size_t expected = os::_page_sizes[0]; size_t actual = os::page_size_for_region_unaligned(os::_page_sizes[1] - 17, 1); ASSERT_EQ(actual, expected); for (size_t s = os::page_sizes().largest(); s != 0; s = os::page_sizes().next_smaller(s)) { const size_t expected = os::page_sizes().next_smaller(s); if (expected != 0) { size_t actual = os::page_size_for_region_unaligned(expected - 17, 1); ASSERT_EQ(actual, expected); } }
On ln104 we are trying to compare the next smaller page size of 's', with a page size returned for slightly smaller size of the size 's -17'.
Instead we compare next smaller page size of 's' to 'expected - 17'. I believe this should be 's - 17':
os::page_size_for_region_unaligned(expected - 17, 1);
vs.
os::page_size_for_region_unaligned(s - 17, 1);
Running gtest tests with 2 largepage sizes (3 total sizes) fails, however default of 2 page_sizes passes (4k and 2m or 1g):
(./hotspot/variant-server/libjvm/gtest/gtestLauncher -jdk:./images/jdk -Xms2G -Xmx2G -XX:+UseLargePages -XX:LargePageSizeInBytes=2M)
This only happen when #1153 is present in code, because otherwise you will only have two page_sizes, but still this should return the correct results.
Signed-off-by: Marcus G K Williams marcus.williams@intel.com
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1719/head:pull/1719
$ git checkout pull/1719