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

8277631: ZGC: CriticalMetaspaceAllocation asserts #6520

Closed
wants to merge 2 commits into from

Conversation

fisk
Copy link
Contributor

@fisk fisk commented Nov 23, 2021

The MetaspaceCritical_lock is a non-safepoint checking lock. That implies that the allow VM block flag is true. That implies that taking that lock takes a NoSafepointVerifier. That causes an assert to fire when MetaspaceCriticalAllocation::wait_for_purge transitions to blocked with ThreadBlockInVM while holding the lock. The fix is to move the locker inside of the ThreadBlockInVM.


Progress

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

Issue

  • JDK-8277631: ZGC: CriticalMetaspaceAllocation asserts

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6520

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 23, 2021

👋 Welcome back eosterlund! 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 label Nov 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2021

@fisk 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 label Nov 23, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 23, 2021

Webrevs

pliden
pliden approved these changes Nov 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2021

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

8277631: ZGC: CriticalMetaspaceAllocation asserts

Reviewed-by: pliden, stefank, dholmes

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

  • 7b2d823: 8277503: compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java failed with "OnSpinWaitInst with the expected value 'isb' not found."
  • 7cb56a2: 8265796: vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java fails when running with JEP 416
  • 24e586a: 8276764: Enable deterministic file content ordering for Jar and Jmod
  • ea85e01: 8271623: Omit enclosing instance fields from inner classes that don't use it
  • 0320672: 8277451: java.lang.reflect.Field::set on static field with invalid argument type should throw IAE
  • e8acac2: 8277350: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java times out
  • 8a44e09: 8268725: jshell does not support the --enable-native-access option
  • 7b67a49: 8261847: performance of java.lang.Record::toString should be improved
  • 38802ad: 8254108: ciReplay: Support incremental inlining
  • 64bdc84: 8277649: [BACKOUT] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/3f847fe89a088d6921107ca887a7a1bace871bd6...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 label Nov 23, 2021
@fisk
Copy link
Contributor Author

@fisk fisk commented Nov 23, 2021

Thanks for the reviews, @pliden and @stefank!

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Just a comment but it always concerns me that if we have to manually add a TBIVM when using a non-safepoint-checking lock then the lock is mis-classified as a non-safepoint-checking one! :(

That aside changes look fine. A few grammatical nits in the test.

Thanks,
David

for (;;) {
ThreadBlockInVM tbivm(JavaThread::current());
Copy link
Member

@dholmes-ora dholmes-ora Nov 24, 2021

Choose a reason for hiding this comment

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

Can't you move the TBIVM outside of the loop now that it is always created?

Copy link
Contributor Author

@fisk fisk Nov 24, 2021

Choose a reason for hiding this comment

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

Just a comment but it always concerns me that if we have to manually add a TBIVM when using a non-safepoint-checking lock then the lock is mis-classified as a non-safepoint-checking one! :(

That aside changes look fine. A few grammatical nits in the test.

Thanks, David

Thanks for the review David. I fixed your nits.

I agree that this lock should preferably have been a safepoint checking lock. In fact, it was a safepoint checking lock when I wrote the code. But that was before we changed the locking rules so that whether we do safepoint checking or not is a function of the rank. After that, this lock has become constrained to the current low rank by the current set of other locks, and by being that low ish rank, it is not allowed to safepoint check, unless I move a bunch of other lock ranks around, and figure out if it's okay for those locks to start safepoint checking as well, which isn't entirely obvious.

So this lock might be a case where those new rules end up being a bit awkward, and have lead this code to do manual transitions to blocked instead, as an escape hatch from the asserts.

Copy link
Member

@dholmes-ora dholmes-ora Nov 24, 2021

Choose a reason for hiding this comment

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

Ah! I forgot about the rank changes that forced this dichotomy.

* @summary converted from VM Testbase gc/gctests/LoadUnloadGC.
* VM Testbase keywords: [gc, stress, stressopt, nonconcurrent, monitoring]
* VM Testbase readme:
* In this test a 1000 classes are loaded and unloaded in a loop.
Copy link
Member

@dholmes-ora dholmes-ora Nov 24, 2021

Choose a reason for hiding this comment

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

nit: /a 1000/1000/

* VM Testbase readme:
* In this test a 1000 classes are loaded and unloaded in a loop.
* Class0 gets loaded which results in Class1 getting loaded and so on all
* the way uptill class1000. The classes should be unloaded whenever a
Copy link
Member

@dholmes-ora dholmes-ora Nov 24, 2021

Choose a reason for hiding this comment

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

nit: /uptill/up until/ or /up to/

* Class0 gets loaded which results in Class1 getting loaded and so on all
* the way uptill class1000. The classes should be unloaded whenever a
* garbage collection takes place because their classloader is made unreachable
* at the end of the each loop iteration. The loop is repeated 1000 times.
Copy link
Member

@dholmes-ora dholmes-ora Nov 24, 2021

Choose a reason for hiding this comment

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

nit: s/the each/each/

@fisk
Copy link
Contributor Author

@fisk fisk commented Nov 25, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

Going to push as commit 3034ae8.
Since your change was applied there have been 52 commits pushed to the master branch:

  • f0136ec: 8275687: runtime/CommandLine/PrintTouchedMethods test shouldn't catch RuntimeException
  • 21e302a: 8270435: UT: MonitorUsedDeflationThresholdTest failed: did not find too_many string in output
  • a81e4fc: 8258117: jar tool sets the time stamp of module-info.class entries to the current time
  • 26472bd: 8277811: ProblemList vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java
  • b5841ba: 8277806: 4 tools/jar failures per platform after JDK-8272728
  • e785f69: 8276124: Provide snippet support for properties files
  • 96fe1d0: 8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL"
  • 077b2de: 8274161: Cleanup redundant casts in jdk.compiler
  • 951247c: 8235876: Misleading warning message in java source-file mode
  • 663e33d: 8272728: javac ignores any -J option in @argfiles silently
  • ... and 42 more: https://git.openjdk.java.net/jdk/compare/3f847fe89a088d6921107ca887a7a1bace871bd6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 25, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 25, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

@fisk Pushed as commit 3034ae8.

💡 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 integrated
4 participants