RFR(XS): VM times out in VM_HandshakeAllThreads::doit() with RunThese30M

Robbin Ehn robbin.ehn at oracle.com
Wed Aug 15 11:12:07 UTC 2018


Hi David, truncated:

On 2018-08-15 12:40, David Holmes wrote:
> The context in which this is executed is not at all clear so assessing the 
> suitability of the fix is also not clear. IIRC a thread can only be resumed at a 
> safepoint so if the above code executes in the VMThread then it can't be racing 
> with a resume and the Threads_lock holding seems unnecessary wrt. this action. ??

The context is, VM thread calls this method to figure out if he can executed the 
handshake on behalf of the thread in question.

JavaThread::java_resume which does the notify on SR lock, says:

// We need to guarantee the Threads_lock here, since resumes are not
// allowed during safepoint synchronization
// Can only resume from an external suspension
void JavaThread::java_resume() {

And if you look at java_suspend_self() after getting the notification I see 
nothing that would keep it from continue executing e.g. java code. It can be 
here with state _thread_in_Java since we skip the proper transitions, thus not 
even needing todo a transition to continue execute java code.

Is there something I'm missing?

Thanks, Robbin

> 
> Thanks,
> David
> 


More information about the hotspot-runtime-dev mailing list