-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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-8296796: Provide clean, platform-agnostic interface to C-heap trimming #11089
JDK-8296796: Provide clean, platform-agnostic interface to C-heap trimming #11089
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
e0d3481
to
2b4c0ea
Compare
2b4c0ea
to
3b93fb8
Compare
riscv build error unrelated |
Webrevs
|
x86 test error unrelated |
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.
This looks good for doing what it says, but I have to wonder whether it is actually worthwhile doing this unless most OS/lib will support it? What will the implementation be in AIX?
Thanks
@@ -372,6 +372,9 @@ inline T byte_size_in_proper_unit(T s) { | |||
} | |||
} | |||
|
|||
#define PROPERFMT SIZE_FORMAT "%s" | |||
#define PROPERFMTARGS(S) byte_size_in_proper_unit(S), proper_unit_for_byte_size(S) |
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.
style nit? lower-case 's'
I think C-Heap trimming is useful even if only Linux does it. Linux is arguably the most important platform. And #10085 would bring demonstratable benefits but did not garner a lot of interest. So I hope to speed it up by splitting parts that are hopefully non-contentious into separate RFEs. I know that AIX has an API to disclaim memory, but have not yet looked deeply into the integration. I also cannot rule out that other platforms may give us similar APIs in the future. |
@tstuefe Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
I don't disagree that C-heap trimming is useful even if only Linux does it. My objection is to defining a platform-agnostic API when only Linux does it. |
I see. It will allow us to use these APIs in shared code though, without having to use platform ifdefs. We do similar things for other platforms (e.g. see os::map_stack_shadow_pages). |
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.
Okay. I have some reservations about this style of approach but the precedents are there. I'd argue that for single-use situations like this and os::map_stack_shadow_pages that a XXX_ONLY(foo();) in the shared code would be acceptable. Others may disagree.
Thanks.
@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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Thanks David. I myself lean towards ifdefs too than having to search for the one platform implementation that actually does something. But I caught flak in the past for too many ifdefs. If it annoys us after JDK-8293114 and no second platform implementation is forthcoming, I'll remove the APIs from shared os. |
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. I kinda like the OS interface. If the proliferation of lots of unimplemented methods in os/* is a concern, we could provide default impls in shared if !GLIBC as a middle-ground. WDYT?
Thank you!
I fear this would annoy people even more than platform defines. Ioi did use something with "HAVE_xxxx_xxxx" macros to provide default implementations for similar things, but I think in this case we are talking about so little code, its not worth the trouble. |
Okay, I manually tested fastdebug on Alpine and on 32-bit. Also re-merged. If all tests run through with no attributable errors, I'll push. Thanks @dholmes-ora @rkennke for reviewing! |
/integrate |
Going to push as commit 0845b39. |
We had a strange quirk in our CI testing after this was pushed and it made me think a little differently about the change. If |
This is a breakout from JDK-8293114, which is starved for reviews. So I attempt to break up that fix into smaller units which are hopefully easier to review separately.
We can trim the C-heap manually using jcmd since JDK-8268893. This patch reshapes this code, cleaning it up in an OS-agnostic way. That will allow us to add implementions for other platforms (I have this on my list for AIX at least) and make review of 8293114 easier.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11089/head:pull/11089
$ git checkout pull/11089
Update a local copy of the PR:
$ git checkout pull/11089
$ git pull https://git.openjdk.org/jdk pull/11089/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11089
View PR using the GUI difftool:
$ git pr show -t 11089
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11089.diff