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

8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved #18417

Closed
wants to merge 2 commits into from

Conversation

limingliu-ampere
Copy link
Member

@limingliu-ampere limingliu-ampere commented Mar 21, 2024

The testcase failed on Oracle CI since JDK-8315923. The root cause is that Oracle CI runs Linux-5.4.17-UEK where the value of MADV_POPULATE_WRITE (23) is used as MADV_DONTEXEC which is not supported by upstream. This PR solves the testcase failure by checking the support of (MADV_POPULATE_WRITE_value + 1) for UEK releases.


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

Issues

  • JDK-8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved (Bug - P2)
  • JDK-8325218: gc/parallel/TestAlwaysPreTouchBehavior.java fails (Bug - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18417

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 21, 2024

👋 Welcome back limingliu-ampere! 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 Mar 21, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@limingliu-ampere
Copy link
Member Author

/issue add 8325218

@openjdk
Copy link

openjdk bot commented Mar 21, 2024

@limingliu-ampere
Adding additional issue to issue list: 8325218: gc/parallel/TestAlwaysPreTouchBehavior.java fails.

@openjdk
Copy link

openjdk bot commented Mar 21, 2024

@limingliu-ampere 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 Mar 21, 2024
@openjdk
Copy link

openjdk bot commented Mar 21, 2024

@limingliu-ampere 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 21, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 21, 2024

Webrevs

Comment on lines +4850 to +4852
// See https://github.com/oracle/linux-uek/issues/23
const int flag = MADV_POPULATE_WRITE + (os::Linux::_is_uek_release ? 1 : 0);
FLAG_SET_DEFAULT(UseMadvPopulateWrite, (::madvise(0, 0, flag) == 0));
Copy link
Member

Choose a reason for hiding this comment

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

I read the supporting material and I still can't get this sorted in my head. From my reading some UEK versions have this problem and some do not. But you do this "trick" for all UEK versions and I just don't understand how that works. ??

Copy link
Member Author

@limingliu-ampere limingliu-ampere Mar 21, 2024

Choose a reason for hiding this comment

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

Personally, I think it is safe to check 24 for all UEK versions:

  • for versions prior to 5.15 UEK, 23 is supported as MADV_DONTEXEC, while 24 is not supported;
  • for 5.15 (, 5.16 and 5.17 if existed) UEK, 23 is supported as MADV_POPULATE_WRITE, while 24 is supported as MADV_DOEXEC;
  • for 5.18 UEK or newer, both 23 and 24 are supported as the same functions as upstream.

Copy link
Member

Choose a reason for hiding this comment

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

So what is the affect of using MADV_DOEXEC when the intent was to use MADV_POPULATE_WRITE?

Copy link
Member Author

Choose a reason for hiding this comment

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

MADV_DOEXEC is not used in os::pd_pretouch_memory, but just used in os::init_2 for 5.15 UEK. The key is MADV_POPULATE_WRITE is supported as 23 on UEK releases if and only if 24 is supported. If the code is confusing, I will check whether the version of kernel is newer than 5.14 here rather than checking the support of 24.

@limingliu-ampere
Copy link
Member Author

/withdraw

@openjdk
Copy link

openjdk bot commented Apr 3, 2024

@limingliu-ampere Unknown command withdraw - for a list of valid commands use /help.

@limingliu-ampere
Copy link
Member Author

/help

@openjdk
Copy link

openjdk bot commented Apr 3, 2024

@limingliu-ampere Available commands:

  • approval - request for maintainer's approval
  • approve - null
  • author - sets an overriding author to be used in the commit when the PR is integrated
  • backport - create a backport
  • cc - add or remove an additional classification label
  • clean - Mark the backport pull request as a clean backport
  • contributor - adds or removes additional contributors for a PR
  • covered - used when employer has signed the OCA
  • csr - require a compatibility and specification request (CSR) for this pull request
  • help - shows this text
  • integrate - performs integration of the changes in the PR
  • issue - edit the list of issues that this PR solves
  • jep - require a JDK Enhancement Proposal (JEP) for this pull request
  • label - add or remove an additional classification label
  • open - Set the pull request state to "open"
  • reviewer - manage additional reviewers for a PR
  • reviewers - set the number of additional required reviewers for this PR
  • signed - used after signing the OCA
  • solves - edit the list of issues that this PR solves
  • sponsor - performs integration of a PR that is authored by a non-committer
  • summary - updates the summary in the commit message
  • test - used to run tests

@tstuefe
Copy link
Member

tstuefe commented May 22, 2024

Please reopen this, and just run the test with -XX:-UseMadvPopulateWrite. That should solve the problem for the test, no?

The test's purpose is not to test Oracle Linux' inability to handle madvise flags correctly but to test -XX:+AlwaysPreTouchStacks.

We can and should deal with the Oracle Linux problem independently (Note that I reported the problem to Oracle secalert back in March, and they promised a kernel fix).

@stefank
Copy link
Member

stefank commented May 22, 2024

Please reopen this, and just run the test with -XX:-UseMadvPopulateWrite. That should solve the problem for the test, no?

The test's purpose is not to test Oracle Linux' inability to handle madvise flags correctly but to test -XX:+AlwaysPreTouchStacks.

We can and should deal with the Oracle Linux problem independently (Note that I reported the problem to Oracle secalert back in March, and they promised a kernel fix).

This is being dealt with in #18592, right? (Which I now see needs to be sponsored)

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 rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants