RFR: 8305994: Guarantee eventual async monitor deflation [v2]

Aleksey Shipilev shade at openjdk.org
Fri Apr 14 14:56:43 UTC 2023


On Fri, 14 Apr 2023 14:02:27 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make the no-progress bit cleaner
>
> src/hotspot/share/runtime/synchronizer.cpp line 1126:
> 
>> 1124:     // We need to clean up the used monitors even if the threshold is
>> 1125:     // not reached, to keep the memory utilization at bay when many threads
>> 1126:     // touched many monitors. This inflation is expected to have no progress
> 
> Should this read "..This *deflation* is.." ?

Thanks, fixed!

> src/hotspot/share/runtime/synchronizer.cpp line 1129:
> 
>> 1127:     // in normal conditions, so it should not count towards non-progress
>> 1128:     // adjustments.
>> 1129:     _no_progress_cnt = 0;
> 
> Not sure about this one? I understand your intention, but I think setting `_no_progress_cnt` to zero doesn't really improve things. If there will be deflations, `_no_progress_cnt` will be set to zero anyway (in `deflate_idle_monitors()`. However if there are no deflations, `_no_progress_cnt` will now always become `1`, even if it was higher before.
> 
> So maybe doing `--_no_progress_cnt` here would be more accurate?

We don't know if this guaranteed deflation would make progress or not, so we cannot decrement blindly. In the new commit, I just introduced a new flag that disallows progress updates when we are in guaranteed deflation path.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13474#discussion_r1166935276
PR Review Comment: https://git.openjdk.org/jdk/pull/13474#discussion_r1166936216


More information about the hotspot-runtime-dev mailing list