JDK-8238370 : ObjectSynchronizer::om_release() could be simplified
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2020-02-01
  • Updated: 2020-11-11
  • Resolved: 2020-11-11
Related Reports
Duplicate :  
Relates :  
Description
Coleen raised a possible RFE in her review of:

JDK-8235795 replace monitor list mux{Acquire,Release}(&gListLock) with spin locks

> 1395   // _next_om is used for both per-thread in-use and free lists so
> 1396   // we have to remove 'm' from the in-use list first (as needed).
> 1397   if (from_per_thread_alloc) {
> 1398     // Need to remove 'm' from om_in_use_list.
> ...
> 1467 }
>
>
> None of this code would be needed if om_malloc() doesn't add the monitor to the in-use list until after the header cas succeeds in ObjectSynchronizer::inflate().  You could make sure this code path is tested with a new develop flag StressMonitorInterference.

s/om_malloc()/om_alloc()/

For additional context, the above code is in om_release()...

Thanks for sending a webrev with a prototype of the above changes.
I'm planning to address this as a separate RFE.

It is definitely an interesting RFE that has the potential to
simplify things (without complications)...

I need to research why Dice thought that optimistically adding a
newly allocated ObjectMonitor to the in-use list had benefit...
I also need to look for any unintended side effects...
Comments
JDK-8253064 has been integrated. Closing this bug as a duplicate.
11-11-2020

Erik and Dan's work on this bug: JDK-8253064 monitor list simplifications and getting rid of TSM will delete ObjectSynchronizer::om_release() so this bug can be closed as a duplicate if/when JDK-8253064 gets integrated.
05-11-2020