RFR (jdk10): JDK-8180175: ObjectSynchronizer only needs to iterate in-use monitors

Roman Kennke rkennke at redhat.com
Wed May 17 21:25:46 UTC 2017


> Looks good to me. Some comments will be nice.
Like this:

http://cr.openjdk.java.net/~rkennke/8180175/webrev.01/
<http://cr.openjdk.java.net/%7Erkennke/8180175/webrev.01/>

?

Roman

>
> Thanks,
>
> -Zhengyu
>
> On 05/11/2017 06:08 AM, Roman Kennke wrote:
>> Hi,
>>
>> ObjectSynchronizer::oops_do() currently iterates all monitor blocks,
>> even free ones. With -XX:+MonitorInUseLists, each thread has its own
>> in-use monitors list, and ObjectSynchronizer has a global gOmInUseList
>> for moribund threads. Iterating over in-use monitors only significantly
>> inmproves scanning time for monitors, because it avoids scanning free
>> blocks, improves caching (no padding, and better chances to have
>> thread-local oops in cache already).
>>
>> Performance-wise it makes a very significant difference (running
>> gc-bench's roots.Sync test, which exaggerates synchronizer usage, with
>> Shenandoah):
>>
>> baseline:
>> S: Thread Roots 37748 us
>> S: Synchronizer Roots 15115 us
>> UR: Thread Roots 24967 us
>> UR: Synchronizer Roots 11906 us
>>
>> patched:
>> S: Thread Roots 40365 us
>> S: Synchronizer Roots 0 us
>> UR: Thread Roots 24459 us
>> UR: Synchronizer Roots 0 us
>>
>> Testing: hotspot_gc, specjvm, jcstress -m quick
>>
>> http://cr.openjdk.java.net/~rkennke/8180175/webrev.00/
>> <http://cr.openjdk.java.net/%7Erkennke/8180175/webrev.00/>
>>
>> Roman
>>
>>



More information about the hotspot-runtime-dev mailing list