-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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-8310388: Shenandoah: Auxiliary bitmap is not madvised for THP #14953
JDK-8310388: Shenandoah: Auxiliary bitmap is not madvised for THP #14953
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
a527256
to
ef02c1e
Compare
ef02c1e
to
03ff47b
Compare
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 fine.
Does it make sense to enable runtime/os/TestTracePageSizes.java
now?
// Note: on Linux, in THP "advise" mode, we refrain from advising the system to use large pages | ||
// since we know these commits will be short lived. | ||
const size_t aux_bitmap_page_size = | ||
LINUX_ONLY(UseTransparentHugePages ? os::vm_page_size() :) bitmap_page_size; |
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.
There is a ifdef LINUX
THP-related block in the same file, so better to match its style:
size_t aux_bitmap_page_size = bitmap_page_size;
#ifdef LINUX
// In THP "advise" mode, we refrain from advising the system to use large pages
// since we know these commits will be short lived, and there is no reason to trash
// the THP area with this bitmap.
if (UseTransparentHugePages) {
aux_bitmap_page_size = os::vm_page_size();
}
#endif
@tstuefe 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 155 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 |
Maybe. Possibly. I just found another bug [1] in TestTracePageSizes where it does not correctly identify VMAs that are clearly backed by THPs, because it looks for the VM_xxx flags alone. I rather leave that test out for now to stabilize it a bit more; I don't want to start whacking the mole again. |
Friendly ping... still need a second review. |
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.
Thanks Kelvin! /integrate |
Going to push as commit 017e0c7.
Your commit was automatically rebased without conflicts. |
See details in JBS isse.
Note that there is no actual functional difference. AUX bitmap did not use THPs before this patch and does not now either. The only difference is that before, the JVM thought the AUX bitmap uses THPs when in fact it did not. That caused confusion.
(All this illuminates how badly thought out the ReservedSpace API really is. We pass in page size to the constructor, but then need to commit manually; THPs actually use madvise on commit, not on reservation, so we need to pass page size in again to commit. Ideally, ReservedSpace should handle committing for us with the page size it saved from reservation.)
Note that this only takes care of preventing THP formation in "madvise" mode. In "always" mode, the kernel will do THP coalescation always. We could prevent it from doing so by advising against it via madvise, but that would require extension of the platform generic reservation APIs and is left for a different RFE. Ideally, nobody should use THP "always" mode.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14953/head:pull/14953
$ git checkout pull/14953
Update a local copy of the PR:
$ git checkout pull/14953
$ git pull https://git.openjdk.org/jdk.git pull/14953/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14953
View PR using the GUI difftool:
$ git pr show -t 14953
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14953.diff
Webrev
Link to Webrev Comment