On Tue, 10 Nov 2020 16:46:10 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
>> Daniel D. Daugherty has updated the pull request incrementally with one >> additional commit since the last revision: >> >> dholmes-ora - convert inner while loop to do-while loop in >> unlink_deflated(). > > src/hotspot/share/runtime/monitorDeflationThread.cpp line 85: > >> 83: // visible to external suspension. >> 84: >> 85: ThreadBlockInVM tbivm(jt); > > Does this have to be a JavaThread? Could it be a non-java thread since > deflating monitors doesn't have to call any Java code? You'd have to lock > down the Monitor list maybe, but couldn't this be a NamedThread? This isn't > a request to change it right now. Ummm... we use a JavaThread because we have to stop async deflation during safepoints so that we're not messing with Object headers during GC. Yes, it's possible to use a non-JavaThread because this is "just software", but I don't want to try to figure out those races... > src/hotspot/share/runtime/synchronizer.cpp line 1641: > >> 1639: >> 1640: // Do the final audit and print of ObjectMonitor stats; must be done >> 1641: // by the VMThread (at VM exit time). > > Can you take (at VM exit time) out of parenthesis? it made me wonder when > else is this called. Okay. > src/hotspot/share/runtime/objectMonitor.cpp line 509: > >> 507: // >> 508: bool ObjectMonitor::deflate_monitor() { >> 509: if (is_busy()) { > > is_busy should be checked != 0 since it doesn't return a bool. Nice catch! That has been there for many, many years... ------------- PR: https://git.openjdk.java.net/jdk/pull/642