RFR: 8259242: vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java timed out [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Thu Apr 8 20:18:07 UTC 2021


On Wed, 7 Apr 2021 11:55:19 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/protectionDomainCache.cpp line 89:
>> 
>>> 87:   // If there are any deleted entries, Handshake-all then they'll be
>>> 88:   // safe to remove since traversing the pd_set list does not stop for
>>> 89:   // safepoints and only JavaThreads will read the pd_set.
>> 
>> I do not understand what you are trying to do here. This is basically a no-op handshake with every thread? Does all the threads remain in the handshake until the last one is processed or do they proceed through one at a time? The former seems better suited for a safepoint operation. The latter means this doesn't work as they may have moved on to a new removal.
>
> Only the ServiceThread calls this code, so they won't be removed again.  This is modeled after the ObjectMonitor code that does the same thing.  All the threads have to hit a handshake at a safepoint polling place, which they cannot do while reading the list.  After all the threads have hit the handshake, no thread can see the old entries on the list.
> I thought that's what I said in the comment.  What should I say to make this clearer?

See src/hotspot/share/runtime/synchronizer.cpp:

size_t ObjectSynchronizer::deflate_idle_monitors() {
<snip>
    if (current->is_Java_thread()) {
<snip>
      // A JavaThread needs to handshake in order to safely free the
      // ObjectMonitors that were deflated in this cycle.
      HandshakeForDeflation hfd_hc;
      Handshake::execute(&hfd_hc);

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

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


More information about the hotspot-dev mailing list