On Thu, 18 Jul 2024 11:30:27 GMT, Roman Kennke <rken...@openjdk.org> wrote:
>> Axel Boldt-Christmas has updated the pull request incrementally with 10 >> additional commits since the last revision: >> >> - Remove try_read >> - Add explicit to single parameter constructors >> - Remove superfluous access specifier >> - Remove unused include >> - Update assert message OMCache::set_monitor >> - Fix indentation >> - Remove outdated comment LightweightSynchronizer::exit >> - Remove logStream include >> - Remove strange comment >> - Fix javaThread include > > src/hotspot/share/runtime/lightweightSynchronizer.cpp line 77: > >> 75: using ConcurrentTable = ConcurrentHashTable<Config, >> MEMFLAGS::mtObjectMonitor>; >> 76: >> 77: ConcurrentTable* _table; > > So you have a class ObjectMonitorWorld, which references the ConcurrentTable, > which, internally also has its actual table. This is 3 dereferences to get to > the actual table, if I counted correctly. I'd try to eliminate the outermost > ObjectMonitorWorld class, or at least make it a global flat structure instead > of a reference to a heap-allocated object. I think, because this is a > structure that is global and would exist throughout the lifetime of the Java > program anyway, it might be worth figuring out how to do the actual > ConcurrentHashTable flat in the global structure, too. This is a really good suggestion and might help a lot with the performance problems that we see with the table with heavily contended locking. I think we should change this in a follow-on patch (which I'll work on). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20067#discussion_r1688053792