RFR (S) : JDK-8245043 : Simplified contention benchmark

eric.caspole at oracle.com eric.caspole at oracle.com
Wed Jun 3 20:38:01 UTC 2020



On 6/3/20 1:33 PM, Aleksey Shipilev wrote:
> On 6/3/20 7:28 PM, Daniel D. Daugherty wrote:
>>>> *) Does it still make sense to have separate update1, update2?
>>>
>>> It spends a few percent more time in the locking code when the update1
>>> middle method is used, I think it is a little better for testing these
>>> cases.
>>
>> By using update1() -> update2() you get the recursive locking
>> that you're look for right? I thought part of the point was to
>> optionally throw the exception thru a couple of stack frames
>> where the monitor was held in each frame...
> 
> My gut feeling is that both methods are on hot paths, so would/should be inlined? If we want to have
> separate stack frames, it would make sense to sprinkle some @CompilerControl(DONT_INLINE) around to
> make sure it actually does the call.

They are inlined, I looked with +LogCompilation and +PrintAssembly, but 
there is the same amount of inflated lock handling code for each 
enter/exit bci in the containing method as there would be if they 
weren't inlined. Last week I did experiment with DONT_INLINE but it 
didn't make much difference. Maybe the little update methods are too simple.

Ongoing, I will see if I can make a bigger non inlined case but I think 
this one is a decent start.


More information about the hotspot-runtime-dev mailing list