Re: RFR: 8266936: Add a finalization JFR event [v11]

2021-09-24 Thread Markus Grönlund
On Thu, 23 Sep 2021 22:35:26 GMT, Coleen Phillimore  wrote:

>> Markus Grönlund has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - remove rehashing and rely on default grow_hint for table resize
>>  - mtStatistics
>
> src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp line 26:
> 
>> 24: 
>> 25: #include "precompiled.hpp"
>> 26: #if INCLUDE_MANAGEMENT
> 
> With precompiled headers turned off, this gets a compilation error:
> error: "INCLUDE_MANAGEMENT" is not
>  defined, evaluates to 0 [-Werror=undef]

Thanks, I missed submitting a few no-precompiled header builds. Fixed now.

-

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


Re: RFR: 8266936: Add a finalization JFR event [v11]

2021-09-23 Thread Coleen Phillimore
On Mon, 13 Sep 2021 17:12:49 GMT, Markus Grönlund  wrote:

>> Greetings,
>> 
>> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
>> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
>> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
>> 
>> We also like to assist users in replacing and mitigating uses in non-JDK 
>> code.
>> 
>> Hence, this changeset adds a periodic JFR event to help identify which 
>> classes are overriding Object.finalize().
>> 
>> Thanks
>> Markus
>
> Markus Grönlund has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - remove rehashing and rely on default grow_hint for table resize
>  - mtStatistics

src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp line 26:

> 24: 
> 25: #include "precompiled.hpp"
> 26: #if INCLUDE_MANAGEMENT

With precompiled headers turned off, this gets a compilation error:
error: "INCLUDE_MANAGEMENT" is not
 defined, evaluates to 0 [-Werror=undef]

-

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


Re: RFR: 8266936: Add a finalization JFR event [v11]

2021-09-17 Thread Markus Grönlund
On Fri, 17 Sep 2021 12:02:32 GMT, Coleen Phillimore  wrote:

>> Markus Grönlund has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - remove rehashing and rely on default grow_hint for table resize
>>  - mtStatistics
>
> src/hotspot/share/runtime/mutexLocker.cpp line 323:
> 
>> 321: 
>> 322: #if INCLUDE_JFR
>> 323:   def(JfrMsg_lock  , PaddedMonitor, leaf-1,  true,  
>> _safepoint_check_always); // -1 because the ConcurrentHashTable resize lock 
>> is leaf
> 
> The ConcurrentHashTable_lock is a lock that doesn't check for safepoints, so 
> if you take this lock out while checking for safepoints, it should assert 
> when called from a JavaThread, which makes me think it's not called from a 
> JavaThread and should be _safepoint_check_never.
>   _resize_lock =
> new Mutex(Mutex::nosafepoint-2, "ConcurrentHashTableResize_lock",
>   Mutex::_safepoint_check_never);
> In my change, this is the ranking for ConcurrentHashTableResize_lock, so this 
> should be nosafepoint-3 if  you check in after I do.

Thanks, the JfrMsg_lock is acquired normally with safepoint checks when the JFR 
system needs to issue synchronous, blocking operations. Asynchronous 
operations, like message notifications, only attempt a try_lock() to avoid 
blocking in the case the lock is contended. The ConcurrentHashTable_lock is 
held during table iteration to prevent resizes from happening. Fortunately, the 
callback processing will only post asynchronous messages (like "Buffer full") 
and therefore will not reach the safepoint check.

-

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


Re: RFR: 8266936: Add a finalization JFR event [v11]

2021-09-17 Thread Coleen Phillimore
On Mon, 13 Sep 2021 17:12:49 GMT, Markus Grönlund  wrote:

>> Greetings,
>> 
>> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
>> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
>> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
>> 
>> We also like to assist users in replacing and mitigating uses in non-JDK 
>> code.
>> 
>> Hence, this changeset adds a periodic JFR event to help identify which 
>> classes are overriding Object.finalize().
>> 
>> Thanks
>> Markus
>
> Markus Grönlund has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - remove rehashing and rely on default grow_hint for table resize
>  - mtStatistics

src/hotspot/share/runtime/mutexLocker.cpp line 323:

> 321: 
> 322: #if INCLUDE_JFR
> 323:   def(JfrMsg_lock  , PaddedMonitor, leaf-1,  true,  
> _safepoint_check_always); // -1 because the ConcurrentHashTable resize lock 
> is leaf

The ConcurrentHashTable_lock is a lock that doesn't check for safepoints, so if 
you take this lock out while checking for safepoints, it should assert when 
called from a JavaThread, which makes me think it's not called from a 
JavaThread and should be _safepoint_check_never.
  _resize_lock =
new Mutex(Mutex::nosafepoint-2, "ConcurrentHashTableResize_lock",
  Mutex::_safepoint_check_never);
In my change, this is the ranking for ConcurrentHashTableResize_lock, so this 
should be nosafepoint-3 if  you check in after I do.

-

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


Re: RFR: 8266936: Add a finalization JFR event [v11]

2021-09-13 Thread Markus Grönlund
> Greetings,
> 
> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
> 
> We also like to assist users in replacing and mitigating uses in non-JDK code.
> 
> Hence, this changeset adds a periodic JFR event to help identify which 
> classes are overriding Object.finalize().
> 
> Thanks
> Markus

Markus Grönlund has updated the pull request incrementally with two additional 
commits since the last revision:

 - remove rehashing and rely on default grow_hint for table resize
 - mtStatistics

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4731/files
  - new: https://git.openjdk.java.net/jdk/pull/4731/files/fd86899f..62592daf

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4731&range=10
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4731&range=09-10

  Stats: 258 lines in 6 files changed: 25 ins; 197 del; 36 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4731.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4731/head:pull/4731

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