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
8260262: Use common code in function unmap_shared() in perfMemory_posix.cpp #4995
Conversation
|
Hi Harold,
thank you for doing this. The patch looks fine to me.
About AIX testing, SAP started to withdraw from AIX development and IBM will take a bigger role in the long run. One of the effects of that decision is that we gave up our AIX CI for OpenJDK head. I still can build and test manually if necessary, but let's first see if IBM has their AIX test systems up yet.
@tellison, could you guys test this or should I do this?
Thank you!
@hseigel This change now passes all automated pre-integration checks. 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 56 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.
|
} | ||
#else | ||
os::release_memory(addr, bytes); |
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.
Why doesn't AIX call munmap with os::release_memory() and then do this NMT tracking?
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'm not sure I understand what you are proposing.
The old code was incorrect since it used raw ::mmap()
to map perf memory, but used os::release_memory()
to release it. This was asymmetric and assumed the underlying implementation for os::reserve/release... uses mmap, which is not always true. The patch corrects this by coupling raw ::mmap with raw ::munmap, and do NMT tracking accordingly.
Arguably, one could factor out mmap+NMT and munmap+NMT in os_posix.cpp. We probably have a number of places where this would be needed. E.g. polling pages and such. But I guess that was out of scope for this issue.
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 see, reading the code more ... The code to create the perf memory if PerfDisableSharedMemory=0 used mmap directly so it makes sense to use munmap directly too. This is definitely better.
Aside: This definition is the same on all the posix platforms so could be moved. Not with this RFE but definitely a trivial one.
bool os::pd_unmap_memory(char* addr, size_t bytes) {
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 agree.
} | ||
#else | ||
os::release_memory(addr, bytes); |
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 see, reading the code more ... The code to create the perf memory if PerfDisableSharedMemory=0 used mmap directly so it makes sense to use munmap directly too. This is definitely better.
Aside: This definition is the same on all the posix platforms so could be moved. Not with this RFE but definitely a trivial one.
bool os::pd_unmap_memory(char* addr, size_t bytes) {
Thanks Thomas and Coleen for reviewing this change. /integrate |
Going to push as commit 2b05fae.
Your commit was automatically rebased without conflicts. |
Please review this change to use common code in function unmap_shared() in perfMemory_posix.cpp, to fix JDK-8260262. The change calls munmap() directly to deallocate the memory because functions mmap_create_shared() and mmap_attach_shared() call mmap() directly to allocate the memory.
The change was tested by running Mach5 tiers 1-2 on Linux, MacOS, and Windows, and Mach5 tiers 3-5 on Linux x64 and MacOS x64.
Note that testing on AIX is needed.
Thanks, Harold
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4995/head:pull/4995
$ git checkout pull/4995
Update a local copy of the PR:
$ git checkout pull/4995
$ git pull https://git.openjdk.java.net/jdk pull/4995/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4995
View PR using the GUI difftool:
$ git pr show -t 4995
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4995.diff