While working on
HBASE-25984, I noticed some weird frames in the flame graphs around monitor entry exit consuming a lot of CPU cycles (see attached images). Noticed that the synchronization there is too coarse grained and sometimes unnecessary. I did a simple patch that switched to a reentrant lock based synchronization with condition variable rather than a busy wait and that showed 70-80% increased throughput in WAL PE. Seems too good to be true.. (more details in the comments).