RFR: 8238761: Asynchronous handshakes [v2]

Robbin Ehn rehn at openjdk.java.net
Thu Sep 17 19:28:30 UTC 2020


On Thu, 17 Sep 2020 18:28:20 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed double checks
>>   Added NSV
>>   ProcessResult to enum
>>   Fixed logging
>>   Moved _active_handshaker to private
>
> src/hotspot/share/runtime/handshake.cpp line 464:
> 
>> 462:
>> 463: const char* executioner_name(Thread* current_thread, Thread* handshakee, bool current_is_requester) {
>> 464:   if (current_thread == handshakee) return "self(JavaThread)";
> 
> I think we can remove this line since executioner_name() is only called by the handshaker.

Yes, fixing.

> src/hotspot/share/runtime/handshake.cpp line 508:
> 
>> 506:       assert(op->_target == NULL || _handshakee == op->_target, "Wrong thread");
>> 507:       log_trace(handshake)("Processing handshake " INTPTR_FORMAT " by %s", p2i(op),
>> 508:                            executioner_name(current_thread, _handshakee, op == match_op));
> 
> With the above change we could even avoid factoring the code into executioner_name() and just do:
> log_trace(handshake)("Processing handshake " INTPTR_FORMAT " by %s%s", p2i(op),
>                                          op == match_op ? "handshaker" : "cooperative",
>                                          current_thread->is_VM_thread() ? "(VM Thread)" : "(JavaThread)");

I added a second log line where I use that function also:
  log_trace(handshake)("Thread %s(" INTPTR_FORMAT ") executed %d ops for JavaThread: " INTPTR_FORMAT " %s target op: "
  INTPTR_FORMAT,
                       executioner_name(current_thread, _handshakee, pr_ret == HandshakeState::_succeed),
                       p2i(current_thread), executed, p2i(_handshakee),
                       pr_ret == HandshakeState::_succeed ? "including" : "excluding", p2i(match_op));

> src/hotspot/share/prims/jvmtiEnvBase.cpp line 908:
> 
>> 906: #endif
>> 907:   Thread* current_thread = Thread::current();
>> 908:   assert(current_thread == java_thread ||
> 
> One extra check here.

Fixing

> src/hotspot/share/prims/jvmtiEnvBase.cpp line 1164:
> 
>> 1162: #ifdef ASSERT
>> 1163:   Thread *current_thread = Thread::current();
>> 1164:   assert(current_thread == thr ||
> 
> One extra check here.

Fixing

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

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


More information about the hotspot-runtime-dev mailing list