RFR: 8318757: VM_ThreadDump asserts in interleaved ObjectMonitor::deflate_monitor calls [v5]

David Holmes dholmes at openjdk.org
Thu Nov 9 01:36:04 UTC 2023


On Wed, 8 Nov 2023 21:41:44 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename monitors_iterate
>
> src/hotspot/share/runtime/synchronizer.cpp line 1094:
> 
>> 1092: // Iterate owned ObjectMonitors.
>> 1093: void ObjectSynchronizer::owned_monitors_iterate(MonitorClosure* closure) {
>> 1094:   auto all_filter = [&](void* owner) { return true; };
> 
> I don't grok how this filter only iterates owned ObjectMonitors.
> It always returns `true` and does not check for a non-null owner.
> I'm probably missing some sort of lambda magic here...

I think in this case we already know that all the monitors in the closure are owned by the expected owner. But I wonder if we should/can assert that?

> test/hotspot/jtreg/runtime/Monitor/ConcurrentDeflation.java line 69:
> 
>> 67: 
>> 68:     static private void createMonitors() {
>> 69:         Object[] monitors = new Object[1000];
> 
> Since `monitors` is local to this static function, if the test runs for long
> enough, then C2 might optimize away all those monitors...
> 
> I usually ask @vnkozlov about the best way to keep that from happening.

Yeah make the array a static field.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16519#discussion_r1387367477
PR Review Comment: https://git.openjdk.org/jdk/pull/16519#discussion_r1387373821


More information about the hotspot-dev mailing list