RFR (jdk10): JDK-8180175: ObjectSynchronizer only needs to iterate in-use monitors
David Holmes
david.holmes at oracle.com
Wed May 17 21:35:18 UTC 2017
On 18/05/2017 7:25 AM, Roman Kennke wrote:
>
>> 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/>
+ // and the remaing global monitors in ObjectSynchronizer::oops_do().
Typo: remaing
David
> ?
>
> 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