-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8327946: containers/docker/TestJFREvents.java fails when host kernel config vm.swappiness=0 after JDK-8325139 #18225
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
Conversation
…config vm.swappiness=0 after 8325139 According to the docker document(https://docs.docker.com/config/containers/resource_constraints/#--memory-swappiness-details), the default value of --memory-swappiness is inherited from the host machine. So, when the the kervel config vm.swappiness=0 on the host machine, this testcase will fail, because of docker container can not use swap memory, the deafult value of --memory-swappiness is 0. Signed-off-by: sendaoYan <yansendao.ysd@alibaba-inc.com>
|
👋 Welcome back syan! A progress list of the required criteria for merging this PR into |
|
@sendaoYan The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
@sendaoYan 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 525 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. 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 (@jerboaa) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Fix the testcase bug, the risk is low. Can anyone reivew this PR, thanks. |
|
@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
Fix the testcase bug, the risk is low. Can anyone reivew this PR, thanks. |
jerboaa
left a comment
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.
--memory-swappiness is cgv1 specific and needs to be handled for the cgv2 case.
jerboaa
left a comment
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 don't think we need Whitebox. A simpler check would be to use the Metrics class. See for example test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java.
Thanks your advice. The |
jerboaa
left a comment
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.
Better. I don't think we need to duplicate that much of the test. All we'd need to do is to add the --memory-swappiness option only if we are on cg v1:
opts.addDockerOpts("--memory=" + memValueToSet)
.addDockerOpts("--memory-swap=" + swapValueToSet)
.addClassOptions("jdk.SwapSpace"));
if (isCgroupV1) {
// With Cgroupv1, The default memory-swappiness vaule is inherited from the host machine, which maybe 0
opts.addDockerOpts("--memory-swappiness=60");
}
out = DockerTestUtils.dockerRunJava(opts);
...
…ess=60"); 2. delete extra space at the beginning of the line in testSwapMemory
@jerboaa Thank you very much for your very professional opinions. The modification of the review opinions has been completed. In addition, an extra space at the beginning of the line was deleted. |
jerboaa
left a comment
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 OK to me.
|
If you merge latest master, GHA should be clean too. |
The GHA shows java/lang/String/StringRepeat.java#id1 fails on linux x86. It's a testcase bug which has been fixed in 8328524. The failure is unrelated to this PR. |
Thanks for the review. |
|
/integrate |
|
@sendaoYan |
|
/sponsor |
|
Going to push as commit 7744b00.
Your commit was automatically rebased without conflicts. |
|
@jerboaa @sendaoYan Pushed as commit 7744b00. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Thanks. |
Hi,
According to the docker document, the default value of --memory-swappiness is inherited from the host machine. So, when the the kernel config vm.swappiness=0 on the host machine, this testcase will fail, because of docker container can not use swap memory, the deafult value of --memory-swappiness is 0.
When the host kernel config "vm.swappiness = 0", In order to run this testcase passed , there are three methods:
.shouldContain("totalSize = " + expectedTotalValue)to.shouldContain("totalSize = ", which ignored theexpectedTotalValue, because theexpectedTotalValuecould be 0(swap memroy is disable when --memory-swappiness=0) or could be 104857600(300MB-200MB=100MB), it depends on the host machine configvm.swappiness--memory-swappiness0 to non-zero, such as 60.vm.swappiness=0tovm.swappiness=60. I think it's not a good idea.Maybe the 2rd method seems more resonable.
Thanks,
-sendao
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18225/head:pull/18225$ git checkout pull/18225Update a local copy of the PR:
$ git checkout pull/18225$ git pull https://git.openjdk.org/jdk.git pull/18225/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18225View PR using the GUI difftool:
$ git pr show -t 18225Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18225.diff
Webrev
Link to Webrev Comment