Skip to content

Conversation

@jerboaa
Copy link
Contributor

@jerboaa jerboaa commented Jan 19, 2023

Please review this refactoring of a container test. It now uses WhiteBox to retrieve the host values it asserts for. In terms of functionality this is basically a no-op except for the now more precise assertion on systems with swap accounting disabled at the kernel level.

Testing

  • Container tests on Linux x86_64 cgv1 and cgv2
  • Container tests on Linux x86_64 cgv1 and cgv2 on systems with swapaccount=0
  • GHA in progress

Thoughts?


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8300659: Refactor TestMemoryAwareness to use WhiteBox api for host values

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12097/head:pull/12097
$ git checkout pull/12097

Update a local copy of the PR:
$ git checkout pull/12097
$ git pull https://git.openjdk.org/jdk pull/12097/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12097

View PR using the GUI difftool:
$ git pr show -t 12097

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12097.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 19, 2023

👋 Welcome back sgehwolf! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 19, 2023
@openjdk
Copy link

openjdk bot commented Jan 19, 2023

@jerboaa The following label will be automatically applied to this pull request:

  • hotspot

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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jan 19, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 19, 2023

Webrevs

@jerboaa
Copy link
Contributor Author

jerboaa commented Jan 19, 2023

/label add serviceability

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Jan 19, 2023
@openjdk
Copy link

openjdk bot commented Jan 19, 2023

@jerboaa
The serviceability label was successfully added.

@jerboaa jerboaa force-pushed the whitebox-test-memory-awareness branch from 84134b6 to 2f8225e Compare January 19, 2023 17:18
@openjdk
Copy link

openjdk bot commented Jan 19, 2023

@jerboaa Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@jerboaa
Copy link
Contributor Author

jerboaa commented Jan 20, 2023

GHA test failures seem unrelated.

@jerboaa
Copy link
Contributor Author

jerboaa commented Jan 20, 2023

@MBaesken Hi! Could you please help review this as you've touched this area a bit? Thanks.

@MBaesken
Copy link
Member

Hi Severin, what do you think about renaming the methods to WB_HostPhysicalMemory / WB_HostPhysicalSwap to make it even more clear that the host values are meant ? On Linux we have values
_physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE);
and
julong os::physical_memory() from os_linux.cpp (including OSContainer::memory_limit_in_bytes()) so these could be 2 different values .

And please adjust the COPYRIGHT years to 2023.

@jerboaa
Copy link
Contributor Author

jerboaa commented Jan 24, 2023

@MBaesken Thanks for the review!

what do you think about renaming the methods to WB_HostPhysicalMemory / WB_HostPhysicalSwap to make it even more clear that the host values are meant?

Sure, done.

On Linux we have values _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); and julong os::physical_memory() from os_linux.cpp (including OSContainer::memory_limit_in_bytes()) so these could be 2 different values .

Yes. os::Linux::physical_memory() returns the host physical memory. Added with JDK-8292083. os::physical_memory() returns the container memory (if run with a limit). In this case we want the former.

And please adjust the COPYRIGHT years to 2023.

Done.

Copy link
Member

@MBaesken MBaesken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk
Copy link

openjdk bot commented Jan 24, 2023

@jerboaa 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:

8300659: Refactor TestMemoryAwareness to use WhiteBox api for host values

Reviewed-by: mbaesken

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 68 new commits pushed to the master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 24, 2023
@jerboaa
Copy link
Contributor Author

jerboaa commented Jan 25, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Jan 25, 2023

Going to push as commit 3c61d5a.
Since your change was applied there have been 81 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 25, 2023
@openjdk openjdk bot closed this Jan 25, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 25, 2023
@openjdk
Copy link

openjdk bot commented Jan 25, 2023

@jerboaa Pushed as commit 3c61d5a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants