Skip to content
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

8265066: Split ReservedSpace constructor to avoid default parameter #3457

Closed

Conversation

kstefanj
Copy link
Contributor

@kstefanj kstefanj commented Apr 13, 2021

Please review this change to change this constructor in ReservedSpace:

  // Initialize the reserved space with the given size. If preferred_page_size
  // is set, use this as minimum page size/alignment. This may waste some space
  // if the given size is not aligned to that value, as the reservation will be
  // aligned up to the final alignment in this case.
  ReservedSpace(size_t size, size_t preferred_page_size = 0);

I propose to split this constructor into two instead of having the default parameter. This makes the implementation more straight forward. I also make the single argument constructor explicit to avoid implicit conversion. There was one place where we relied on implicit conversion and this has been updated to explicitly create the ReservedSpace.

This cleanup is another step towards:
JDK-8261527: Record page size used for underlying mapping in ReservedSpace


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8265066: Split ReservedSpace constructor to avoid default parameter

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3457/head:pull/3457
$ git checkout pull/3457

Update a local copy of the PR:
$ git checkout pull/3457
$ git pull https://git.openjdk.java.net/jdk pull/3457/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3457

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3457.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 13, 2021

👋 Welcome back sjohanss! 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
Copy link

openjdk bot commented Apr 13, 2021

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Apr 13, 2021
@kstefanj
Copy link
Contributor Author

/label remove hotspot-runtime
/label add hotspot

@openjdk openjdk bot removed the hotspot-runtime hotspot-runtime-dev@openjdk.org label Apr 13, 2021
@openjdk
Copy link

openjdk bot commented Apr 13, 2021

@kstefanj
The hotspot-runtime label was successfully removed.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Apr 13, 2021
@openjdk
Copy link

openjdk bot commented Apr 13, 2021

@kstefanj
The hotspot label was successfully added.

@kstefanj kstefanj marked this pull request as ready for review April 13, 2021 09:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 13, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 13, 2021

Webrevs

}

ReservedSpace::ReservedSpace(size_t size, size_t preferred_page_size) : _fd_for_heap(-1) {
assert(is_power_of_2(preferred_page_size), "invariant");
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be something like is_one_of_available_page_sizes (or potentially 0 if this means "any")? This assert hasn't been in the original code, and it does not seem correct, so maybe it's not worth putting here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are correct. The assert would only catch bogus values, and having the assert query the os-layer here might be a bit over the top. I'll just remove the assert for now.

Removed assert.
Copy link
Contributor

@tschatzl tschatzl 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 Apr 15, 2021

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

8265066: Split ReservedSpace constructor to avoid default parameter

Reviewed-by: tschatzl, stefank

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

  • fa58aae: 8265245: depChecker_ don't have any functionalities
  • a2b0e0f: 8265323: Leftover local variables in PcDesc
  • 1ac25b8: 8264372: Threads::destroy_vm only ever returns true
  • 73d5f3b: 8265313: Obsolete the unused AssertOnSuspendWaitFailure and TraceSuspendWaitFailures flags
  • cb8394a: 8265304: Temporarily make Metal the default 2D rendering pipeline for macOS
  • 66f8987: 8265298: Hard VM crash when deadlock between "access" and higher ranked lock is detected
  • 926e3bc: 8264143: Lanai: RenderPerfTest.BgrSwBlitImage has artefacts on apple M1
  • ff49970: 8265375: Bootcycle builds fail with StackOverflowError in cldrconverter
  • c108e7a: 8265154: vinserti128 operand mix up for KNL platforms
  • 2c4075c: 8265381: ProblemList runtime/logging/RedefineClasses.java on macos-x64 -Xcomp
  • ... and 103 more: https://git.openjdk.java.net/jdk/compare/cb2806db4ed188a53161d13a0d7f882b1afe00ec...master

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 Apr 15, 2021
@kstefanj
Copy link
Contributor Author

Thanks for the reviews @tschatzl and @stefank.

/integrate

@openjdk openjdk bot closed this Apr 19, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 19, 2021
@openjdk
Copy link

openjdk bot commented Apr 19, 2021

@kstefanj Since your change was applied there have been 114 commits pushed to the master branch:

  • c607d12: 8249528: Remove obsolete comment in G1RootProcessor::process_java_roots
  • fa58aae: 8265245: depChecker_ don't have any functionalities
  • a2b0e0f: 8265323: Leftover local variables in PcDesc
  • 1ac25b8: 8264372: Threads::destroy_vm only ever returns true
  • 73d5f3b: 8265313: Obsolete the unused AssertOnSuspendWaitFailure and TraceSuspendWaitFailures flags
  • cb8394a: 8265304: Temporarily make Metal the default 2D rendering pipeline for macOS
  • 66f8987: 8265298: Hard VM crash when deadlock between "access" and higher ranked lock is detected
  • 926e3bc: 8264143: Lanai: RenderPerfTest.BgrSwBlitImage has artefacts on apple M1
  • ff49970: 8265375: Bootcycle builds fail with StackOverflowError in cldrconverter
  • c108e7a: 8265154: vinserti128 operand mix up for KNL platforms
  • ... and 104 more: https://git.openjdk.java.net/jdk/compare/cb2806db4ed188a53161d13a0d7f882b1afe00ec...master

Your commit was automatically rebased without conflicts.

Pushed as commit e390e55.

💡 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
3 participants