RFR: 8277631: ZGC: CriticalMetaspaceAllocation asserts

David Holmes dholmes at openjdk.java.net
Wed Nov 24 05:19:06 UTC 2021


On Tue, 23 Nov 2021 14:14:31 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> 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.

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

src/hotspot/share/memory/metaspaceCriticalAllocation.cpp line 130:

> 128: void MetaspaceCriticalAllocation::wait_for_purge(MetadataAllocationRequest* request) {
> 129:   for (;;) {
> 130:     ThreadBlockInVM tbivm(JavaThread::current());

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

test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java line 55:

> 53:  * VM Testbase keywords: [gc, stress, stressopt, nonconcurrent, monitoring]
> 54:  * VM Testbase readme:
> 55:  * In this test a 1000 classes are loaded and unloaded in a loop.

nit: /a 1000/1000/

test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java line 57:

> 55:  * In this test a 1000 classes are loaded and unloaded in a loop.
> 56:  * Class0 gets loaded which results in Class1 getting loaded and so on all
> 57:  * the way uptill class1000.  The classes should be unloaded whenever a

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

test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java line 59:

> 57:  * the way uptill class1000.  The classes should be unloaded whenever a
> 58:  * garbage collection takes place because their classloader is made unreachable
> 59:  * at the end of the each loop iteration. The loop is repeated 1000 times.

nit: s/the each/each/

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6520


More information about the hotspot-dev mailing list