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

8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86 #1842

Closed

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Dec 18, 2020

Hi all,

can I have reviews for this test bug fix on x86 (but it did not do the correct thing on 64 bit platforms either)?

There are sone test cases that allocates byte arrays of ~3500 bytes, and expect that almost all allocations occur in the PLABs given a PLAB waste threshold of some percentage, in this case 20%.

On x64 this is good, as the PLAB size is 4096 words, i.e. 32kb, and 20% of that is ~6.5kb. So all objects are allocated in PLABs as expected

On x86 the PLAB size of 4096 words is only 16kb, and 20% of that is ~3.2kb. This threshold is less than these 3500 bytes, so the test fails.

It does not fail always (but very often) because of the broken calculation for meeting the threshold: unless really all objects copied are of that 3500 byte size (and hence directly allocated), the current checking using integer calculation results in 0% waste, which is below the expected 20%.

The suggested fix is to lower the size of that array to 3250 bytes, which meets the criteria on both 32 and 64 bit platforms (and fix the broken calculations).

Note that we should not change this array size to much lower, because there is another test that fails otherwise.

Testing:
100 successful test runs on x86 and x64 linux each

Thanks,
Thomas


Progress

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

Issue

  • JDK-8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1842/head:pull/1842
$ git checkout pull/1842

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 18, 2020

👋 Welcome back tschatzl! 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 Dec 18, 2020

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

  • hotspot-gc

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-gc hotspot-gc-dev@openjdk.org label Dec 18, 2020
@tschatzl tschatzl marked this pull request as ready for review Dec 18, 2020
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 18, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 18, 2020

Webrevs

Copy link
Contributor

@kstefanj kstefanj left a comment

Looks good.

@openjdk
Copy link

openjdk bot commented Dec 18, 2020

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

8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86

Reviewed-by: sjohanss, kbarrett

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

  • fa50877: 8257853: Remove dependencies on JNF's JNI utility functions in AWT and 2D code
  • 580af49: 8258006: Replaces while cycles with iterator with enhanced for in java.desktop
  • dc7f01f: 8257584: [macos] NullPointerException originating from LWCToolkit.java
  • c7c53d0: 8258554: javax/swing/JTable/4235420/bug4235420.java fails in GTK L&F
  • c50b464: 8258715: [JVMCI] separate JVMCI code install timers for CompileBroker and hosted compilations
  • 64644a1: 8253881: Hotspot/Serviceability Terminology Refresh
  • 6a78b2a: 8258645: Bring Jemmy 1.3.11 to JDK test base
  • 7f92d18: 8258553: Limit number of fields in instance to be considered for scalar replacement
  • adf0e23: 8257800: CompileCommand TypedMethodOptionMatcher::parse_method_pattern() may over consume
  • 06c24e1: 8256213: Remove os::split_reserved_memory
  • ... and 7 more: https://git.openjdk.java.net/jdk/compare/853c04712d24788b6d30d54443ac9277a898311b...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 Dec 18, 2020
@@ -222,7 +222,7 @@ private static void checkFields(PlabInfo info) {
* @return true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue
*/
private static boolean checkRatio(long checkedValue, long controlValue) {
return (Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;
return ((double)Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;

Choose a reason for hiding this comment

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

Rather than casting to double (I'm not fond of casting in Java either), why not
(Math.abs(checkedValue) * 100.0) / controlValue < MEM_DIFFERENCE_PCT
Similarly for checkDifferenceRatio below.

@tschatzl
Copy link
Contributor Author

tschatzl commented Jan 8, 2021

Thanks @kimbarrett @sjohanss for your reviews

/integrate

@openjdk openjdk bot closed this Jan 8, 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 Jan 8, 2021
@openjdk
Copy link

openjdk bot commented Jan 8, 2021

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

  • fc1d2a1: 8259065: Optimize MessageDigest.getInstance
  • 712014c: 8258077: Using -Xcheck:jni can lead to a double-free after JDK-8193234
  • 56a354e: Merge
  • 677802d: 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006
  • 1973fbe: 8039278: console.sh failed Automatically with exit code 1
  • acdd90b: 8258972: unexpected compilation error with generic sealed interface
  • c1fb521: 8259227: C2 crashes with SIGFPE due to a division that floats above its zero check
  • 484e23b: 8258657: Doc build is broken by use of new language features
  • 4a478b8: 8250903: jdk/jfr/javaagent/TestLoadedAgent.java fails with Mismatch in TestEvent count
  • b996ccc: 8259373: c1 and jvmci runtime code use ResetNoHandleMark incorrectly
  • ... and 151 more: https://git.openjdk.java.net/jdk/compare/853c04712d24788b6d30d54443ac9277a898311b...master

Your commit was automatically rebased without conflicts.

Pushed as commit b549cbd.

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

@tschatzl tschatzl deleted the 8258481-testplabpromotion-failure branch Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
3 participants