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

JDK-8261894: Remove support for UseSHM #14970

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented Jul 21, 2023

We decided to ditch the SystemV-based large-page handling code in Linux a while ago. For history and details, please see JBS issue and the accompanying CSR.

This patch

  1. removes the support for -XX:+UseSHM and all its backing code. It obsoletes UseSHM.

  2. UseSHM had just been the negation of UseHugeTLBFS (in hindsight, a single mode switch would have been better). The POSIX-mmap-based implementation behind UseHugeTLBFS remains the sole implementation of static large pages in the JVM. The flag UseHugeTLBFS itself is not needed anymore since there is nothing to distinguish it from. Therefore I removed that flag, too.

  3. UseLargePages and UseTransparentHugePages are unaffected. Their meaning remains the same:
    UseLargePages => using static hugepages
    UseLargePages + UseTransparentHugePages => using THPs
    UseTransparentHugePages => using THPs, enables also UseLargePages

This allows for many code removals and simplifications. We can ditch the SystemV large page setup and management, its sanity tests, its regression tests, and associated documentation. We can also lose some of the tests, code, and documentation surrounding HugeTLBFS.

Testing: I manually ran many tests with many different huge page settings on Linux x64. GHAs are green (one remaining x86 error is unrelated).

Note that I will be out on vacation in September and may not respond to reviews in a timely fashion.

/csr
/reviewers 2


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8310841 to be approved
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8261894: Remove support for UseSHM (Enhancement - P4)
  • JDK-8310841: Obsolete the UseSHM and UseHugeTLBFS flags in JDK 22 (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14970

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2023

👋 Welcome back stuefe! 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 Jul 21, 2023

@tstuefe This pull request already associated with these approved CSRs: JDK-8310841

@openjdk
Copy link

openjdk bot commented Jul 21, 2023

@tstuefe
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk
Copy link

openjdk bot commented Jul 21, 2023

@tstuefe 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 Jul 21, 2023
@tstuefe tstuefe force-pushed the JDK-8261894-Obsolete-the-UseSHM-and-UseHugeTLBFS-flags branch from 8ec3597 to baaed40 Compare July 21, 2023 10:20
@tstuefe tstuefe force-pushed the JDK-8261894-Obsolete-the-UseSHM-and-UseHugeTLBFS-flags branch 3 times, most recently from c96ff84 to ba70236 Compare August 4, 2023 07:07
@tstuefe tstuefe force-pushed the JDK-8261894-Obsolete-the-UseSHM-and-UseHugeTLBFS-flags branch from 3e340b0 to 2c36344 Compare August 31, 2023 16:28
@tstuefe tstuefe marked this pull request as ready for review September 1, 2023 07:57
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 1, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 1, 2023

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Generally this looks okay - one issue with the doc to sort out.

I will hold off on the approve button for now and wait until you are back from vacation.

Copy link
Member

Choose a reason for hiding this comment

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

The text for the flags to be obsoleted should be moved to the "Obsoleted Flags" section of the document. But we need to update the closed sources for the manpage and then propagate the update from there. It may be easiest to create a sub-task for that and I can apply the closed changes.

@tstuefe
Copy link
Member Author

tstuefe commented Oct 4, 2023

Generally this looks okay - one issue with the doc to sort out.

I will hold off on the approve button for now and wait until you are back from vacation.

Thanks, David!

Not sure what exactly you want me to do with the documentation though. IIUC you need to do some additional steps for the closed sources and need a sub item. Should I create that sub item? Or should I revert my changes from the man page sources and wait for the updated documentation to trickle down from the closed sources?

@dholmes-ora
Copy link
Member

Hi @tstuefe , please create a sub-task issue to update the manpage and assign it to me. Then remove the manpage update from this PR. I will handle the doc change when I get back from vacation around the 16th/17th. Thanks.

@tstuefe
Copy link
Member Author

tstuefe commented Oct 5, 2023

Hi @tstuefe , please create a sub-task issue to update the manpage and assign it to me. Then remove the manpage update from this PR. I will handle the doc change when I get back from vacation around the 16th/17th. Thanks.

Okay, done.

@openjdk
Copy link

openjdk bot commented Oct 9, 2023

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

8261894: Remove support for UseSHM

Reviewed-by: dholmes, ayang

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Oct 9, 2023
@tstuefe
Copy link
Member Author

tstuefe commented Oct 9, 2023

Thanks, @albertnetymk!

I'll do one last round of integration tests, then push.

@tstuefe
Copy link
Member Author

tstuefe commented Oct 10, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 10, 2023

Going to push as commit c2abf12.
Since your change was applied there have been 14 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 Oct 10, 2023
@openjdk openjdk bot closed this Oct 10, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 10, 2023
@openjdk
Copy link

openjdk bot commented Oct 10, 2023

@tstuefe Pushed as commit c2abf12.

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

bool os::can_commit_large_page_memory() {
return UseTransparentHugePages;
}

bool os::can_execute_large_page_memory() {
return UseTransparentHugePages || UseHugeTLBFS;
return UseTransparentHugePages;
Copy link
Member

Choose a reason for hiding this comment

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

This change introduced a regression: https://bugs.openjdk.org/browse/JDK-8319795
PR fixing the regression: #16582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
4 participants