Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread David Holmes
On 9/04/2020 5:39 pm, Yasumasa Suenaga wrote: On 2020/04/09 16:19, Robbin Ehn wrote: Hi Yasumasa, We have had internal requests doing GetThreadListStackTraces with multiple threads with handshakes. Since you can sample hundreds of times per second using handshakes with little interference with

Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread Robbin Ehn
Ok, thanks for looking into it! /Robbin On 2020-04-09 09:39, Yasumasa Suenaga wrote: On 2020/04/09 16:19, Robbin Ehn wrote: Hi Yasumasa, We have had internal requests doing GetThreadListStackTraces with multiple threads with handshakes. Since you can sample hundreds of times per second using

Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread Yasumasa Suenaga
On 2020/04/09 16:19, Robbin Ehn wrote: Hi Yasumasa, We have had internal requests doing GetThreadListStackTraces with multiple threads with handshakes. Since you can sample hundreds of times per second using handshakes with little interference with your application. The internal request sampled

Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread Robbin Ehn
Hi Yasumasa, We have had internal requests doing GetThreadListStackTraces with multiple threads with handshakes. Since you can sample hundreds of times per second using handshakes with little interference with your application. The internal request sampled all threads ~10 times per second. So the

Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread Yasumasa Suenaga
Hi Robbin, I think we can change GetThreadListStackTrace(VM_GetThreadListStackTraces) if the caller requests only 1 thread stack (thread_count == 1). It does not break JVMTI spec. In other case, we should use safepoint (VM Operation) for following JVMTI spec: ``` All stacks are collected simul

Re: Thread Local Handshake in JVMTI functions

2020-04-09 Thread Robbin Ehn
Hi, adding the same comment as in the bug regarding GetThreadListStackTraces. Please note that there is a semantic difference taking samples in a safepoint and in handshakes, if there are mutiple thread sampled. With a safepoint; stacktraces are taken from the same exact moment (from a Java muta

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread Yasumasa Suenaga
On 2020/04/09 15:44, serguei.spit...@oracle.com wrote: On 4/8/20 23:36, Yasumasa Suenaga wrote: Thanks David and Serguei! I created 3 subtasks under JDK-8201641, of course I will send review request in each them.   - GetOneCurrentContendedMonitor => GetCurrentContendedMonitor `GetCurrentCo

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread serguei.spit...@oracle.com
On 4/8/20 23:36, Yasumasa Suenaga wrote: Thanks David and Serguei! I created 3 subtasks under JDK-8201641, of course I will send review request in each them.   - GetOneCurrentContendedMonitor => GetCurrentContendedMonitor `GetCurrentContendedMonitor` is JVMTI function name, and also it ex

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread Yasumasa Suenaga
Thanks David and Serguei! I created 3 subtasks under JDK-8201641, of course I will send review request in each them. - GetOneCurrentContendedMonitor => GetCurrentContendedMonitor `GetCurrentContendedMonitor` is JVMTI function name, and also it exists as public member of JvmtiEnv class. So

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread serguei.spit...@oracle.com
Hi Yasumasa, I'm okay with using sub-tasks to do it incrementally. This needs to be removed with your fix:   src/hotspot/share/runtime/vmOperations.hpp: template(GetCurrentContendedMonitor)    \ Also, I agree with comments from David below:  - GetOneCurrentContendedMonitor => GetCurre

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread David Holmes
Hi Yasumasa, On 9/04/2020 3:08 pm, Yasumasa Suenaga wrote: Hi, JDK-8240918 has been pushed, so I made a patch for GetCurrentContendedMonitor(). How about this?   http://cr.openjdk.java.net/~ysuenaga/jvmti-thread-local-handshake/2/ Generally looks okay. A couple of comments: src/hotspot/s

Re: Thread Local Handshake in JVMTI functions

2020-04-08 Thread Yasumasa Suenaga
Hi, JDK-8240918 has been pushed, so I made a patch for GetCurrentContendedMonitor(). How about this? http://cr.openjdk.java.net/~ysuenaga/jvmti-thread-local-handshake/2/ An observation, it seems to me that calling_thread is not used when this is not a VMOperation. calling_thread is used

Re: Thread Local Handshake in JVMTI functions

2020-04-01 Thread Yasumasa Suenaga
Thanks David! If JDK-8201641 is not assigned when JDK-8240918 is resolved, I will start to work for JDK-8201641. (It would be large patch...) Cheers, Yasumasa On 2020/04/01 19:05, David Holmes wrote: On 1/04/2020 11:02 am, Yasumasa Suenaga wrote: Thanks Dan and Serguei! I added a comment

Re: Thread Local Handshake in JVMTI functions

2020-04-01 Thread David Holmes
On 1/04/2020 11:02 am, Yasumasa Suenaga wrote: Thanks Dan and Serguei! I added a comment for this to JDK-8201641. David, can you share Bug ID for thread-to-thread handshake? I want to record it to JDK-8201641 as a blocker. https://bugs.openjdk.java.net/browse/JDK-8240918 I heard the RFR coul

Re: Thread Local Handshake in JVMTI functions

2020-03-31 Thread Yasumasa Suenaga
Thanks Dan and Serguei! I added a comment for this to JDK-8201641. David, can you share Bug ID for thread-to-thread handshake? I want to record it to JDK-8201641 as a blocker. Yasumasa On 2020/04/01 1:59, serguei.spit...@oracle.com wrote: Hi Yasumasa, Yes, this works needs to be done. I'll

Re: Thread Local Handshake in JVMTI functions

2020-03-31 Thread serguei.spit...@oracle.com
Hi Yasumasa, Yes, this works needs to be done. I'll take look at you webrev. Thanks, Serguei On 3/31/20 07:41, Daniel D. Daugherty wrote: Add Robbin to this thread... This reminded of the following RFE that Robbin filed:     JDK-8201641 JVMTI: GetThreadListStackTraces should use Thread-Loc

Re: Thread Local Handshake in JVMTI functions

2020-03-31 Thread Daniel D. Daugherty
Add Robbin to this thread... This reminded of the following RFE that Robbin filed:     JDK-8201641 JVMTI: GetThreadListStackTraces should use Thread-Local Handshakes     https://bugs.openjdk.java.net/browse/JDK-8201641 We could update 8201641 to include everything that Yasumasa-san is reque

Re: Thread Local Handshake in JVMTI functions

2020-03-31 Thread Yasumasa Suenaga
Hi David, On 2020/03/31 19:16, David Holmes wrote: Hi Yasumasa, On 31/03/2020 8:06 pm, Yasumasa Suenaga wrote: Hi all, Many JVMTI functions uses VM Operation to get information. However some of them need to stop only one thread - they don't need to stop all threads. So I think we can use Thr

Re: Thread Local Handshake in JVMTI functions

2020-03-31 Thread David Holmes
Hi Yasumasa, On 31/03/2020 8:06 pm, Yasumasa Suenaga wrote: Hi all, Many JVMTI functions uses VM Operation to get information. However some of them need to stop only one thread - they don't need to stop all threads. So I think we can use Thread Local Handshake as this webrev. It is example fo

Thread Local Handshake in JVMTI functions

2020-03-31 Thread Yasumasa Suenaga
Hi all, Many JVMTI functions uses VM Operation to get information. However some of them need to stop only one thread - they don't need to stop all threads. So I think we can use Thread Local Handshake as this webrev. It is example for GetOneCurrentContendedMonitor(). http://cr.openjdk.java.n