RFR: 8291418: adjust monitor deflation logging and deflate_idle_monitors use

Daniel D. Daugherty dcubed at openjdk.org
Tue Nov 29 22:11:14 UTC 2022


On Wed, 23 Nov 2022 07:05:16 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Trivial fixes to monitor deflation logging and deflate_idle_monitors use.
>
> Looks good.
> 
> But this felt not trivial to me :) I tried to understand the preexisting code:
> 
> `while (ObjectSynchronizer::deflate_idle_monitors(tablep) >= (size_t)MonitorDeflationMax) {`
> 
> So, was the intent behind this "as long as deflate_idle_monitors() uses its full allotment of deflations, continue, but if you notice it slacking off, stop?" And the assumption is we always deflate n*MonitorDeflationMax + a smaller rest? And this assumption was wrong?

@tstuefe:

> Looks good.

Thanks!


> But this felt not trivial to me :)

Sorry about that. I suspect that I have lived with this code for too long...
I tried to figure out how to update the PR description to put a line thru
the word "Trivial", but I don't see that option.


> I tried to understand the preexisting code:
> 
> `while (ObjectSynchronizer::deflate_idle_monitors(tablep) >= (size_t)MonitorDeflationMax) {`
> 
> So, was the intent behind this "as long as deflate_idle_monitors() uses its full allotment of deflations, continue, but if you notice it slacking off, stop?" And the assumption is we always deflate n*MonitorDeflationMax + a smaller rest? And this assumption was wrong?

My original intent was "loop here until we have nothing left to deflate".
I implemented it wrong and we stopped if there was a partial
deflation, i.e., less than `MonitorDeflationMax` deflated.
However, in some cases, we would see multiple partial deflations
in a row before there is nothing left to deflate so I changed the loop
to stop when we did a complete pass and deflated nothing.

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

PR: https://git.openjdk.org/jdk/pull/11293


More information about the hotspot-runtime-dev mailing list