Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
Thanks Serguei! Yasumasa On 2020/06/19 15:25, serguei.spit...@oracle.com wrote: Hi Yasumasa, Looks good. Thanks, Serguei On 6/18/20 18:56, Yasumasa Suenaga wrote: Hi Serguei, I tested vmTestbase/nsk/jdi with webrev.03, all tests work fine on my laptop.   http://cr.openjdk.java.net/~ysue

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread serguei.spit...@oracle.com
Hi Yasumasa, Looks good. Thanks, Serguei On 6/18/20 18:56, Yasumasa Suenaga wrote: Hi Serguei, I tested vmTestbase/nsk/jdi with webrev.03, all tests work fine on my laptop.   http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.03/ Thanks, Yasumasa On 2020/06/19 9:22, serguei.spit

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
Hi Serguei, I tested vmTestbase/nsk/jdi with webrev.03, all tests work fine on my laptop. http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.03/ Thanks, Yasumasa On 2020/06/19 9:22, serguei.spit...@oracle.com wrote: Hi Yasumasa, It would be even more safe to run the JDI tests as we

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread serguei.spit...@oracle.com
Hi Yasumasa, It would be even more safe to run the JDI tests as well. The ObjectReference owningThread(), waitingThreads() and entryCount() are based on this JVMTI function. See: https://docs.oracle.com/en/java/javase/14/docs/api/jdk.jdi/com/sun/jdi/ObjectReference.html Thanks, Serguei On 6

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
Thanks Serguei! I fixed them, and the change works fine on my laptop with serviceability/jvmti and vmTestbase/nsk/jvmti on Linux x64. I will push it later. Yasumasa On 2020/06/19 6:42, serguei.spit...@oracle.com wrote: Hi Yasumasa, This looks good, nice simplification. A couple of minor c

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread serguei.spit...@oracle.com
Hi Yasumasa, This looks good, nice simplification. A couple of minor comments. http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.02/src/hotspot/share/prims/jvmtiEnvBase.cpp.frames.html 995 ThreadsListHandle tlh(current_thread); 1

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
Hi Daniel, On 2020/06/18 23:38, Daniel D. Daugherty wrote: On 6/18/20 5:07 AM, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource.

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
Hi David, Dan Thanks for the comment! I will update the comment as below before pushing: // This needs to be performed at a safepoint to gather stable data // because monitor owner / waiters might not be suspended. Yasumasa On 2020/06/18 23:09, David Holmes wrote: On 19/06/2020 12:06 am

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Daniel D. Daugherty
On 6/18/20 5:07 AM, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as default parameter in c'tor. Do you mean we sh

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread David Holmes
On 19/06/2020 12:06 am, Daniel D. Daugherty wrote: On 6/18/20 10:04 AM, David Holmes wrote: On 18/06/2020 11:55 pm, Daniel D. Daugherty wrote: On 6/18/20 9:18 AM, David Holmes wrote: On 18/06/2020 7:07 pm, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Daniel D. Daugherty
On 6/18/20 10:04 AM, David Holmes wrote: On 18/06/2020 11:55 pm, Daniel D. Daugherty wrote: On 6/18/20 9:18 AM, David Holmes wrote: On 18/06/2020 7:07 pm, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsLi

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread David Holmes
On 18/06/2020 11:55 pm, Daniel D. Daugherty wrote: On 6/18/20 9:18 AM, David Holmes wrote: On 18/06/2020 7:07 pm, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thr

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Daniel D. Daugherty
On 6/18/20 9:18 AM, David Holmes wrote: On 18/06/2020 7:07 pm, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as def

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread David Holmes
On 18/06/2020 7:07 pm, Yasumasa Suenaga wrote: On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as default parameter in c'tor. Do you mean we

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread Yasumasa Suenaga
On 2020/06/18 17:36, David Holmes wrote: On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as default parameter in c'tor. Do you mean we should it explicitly in c'tor? Yes pass current

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-18 Thread David Holmes
On 18/06/2020 3:47 pm, Yasumasa Suenaga wrote: Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as default parameter in c'tor. Do you mean we should it explicitly in c'tor? Yes pass current_thread so we don't do the additional unn

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread Yasumasa Suenaga
Hi David, Both ThreadsListHandle and ResourceMarks would use `Thread::current()` for their resource. It is set as default parameter in c'tor. Do you mean we should it explicitly in c'tor? Thanks, Yasumasa On 2020/06/18 13:58, David Holmes wrote: Hi Yasumasa, On 18/06/2020 12:59 pm, Yasuma

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread David Holmes
Hi Yasumasa, On 18/06/2020 12:59 pm, Yasumasa Suenaga wrote: Hi Serguei, Thanks for your comment! I uploaded new webrev:   http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.01/ I'm not sure the following change is correct. Can we assume owning_thread is not NULL at safepoint? We can

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread Yasumasa Suenaga
Hi Serguei, Thanks for your comment! I uploaded new webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.01/ I'm not sure the following change is correct. Can we assume owning_thread is not NULL at safepoint? All tests on submit repo and serviceability/jvmti and vmTestbase/nsk/jvm

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread serguei.spit...@oracle.com
Hi Yasumasa, This fix is not enough. The function JvmtiEnvBase::get_object_monitor_usage works in two modes: in VMop and non-VMop. The non-VMop mode has to be removed. Thanks, Serguei On 6/17/20 02:18, Yasumasa Suenaga wrote: (Change subject for RFR) Hi, I filed it to JBS and upload a web

Re: RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread serguei.spit...@oracle.com
Hi Yasumasa, This fix is not enough. The function JvmtiEnvBase::get_object_monitor_usage works in two modes: in VMop and non-VMop. The non-VMop mode has to be removed. Thanks, Serguei On 6/17/20 02:18, Yasumasa Suenaga wrote: (Change subject for RFR) Hi, I filed it to JBS and upload a web

RFR: 8247729: GetObjectMonitorUsage() might return inconsistent information

2020-06-17 Thread Yasumasa Suenaga
(Change subject for RFR) Hi, I filed it to JBS and upload a webrev for it. Could you review it? JBS: https://bugs.openjdk.java.net/browse/JDK-8247729 webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8247729/webrev.00/ This change has passed tests on submit repo. Also I tested it with servi