Review request: 8022880: False sharing between PSPromotionManager instances
stefan.karlsson at oracle.com
Tue Aug 13 12:44:53 UTC 2013
On 2013-08-13 14:34, Bengt Rutisson wrote:
> Hi Stefan,
> Looks good!
> On 8/13/13 1:38 PM, Stefan Karlsson wrote:
>> We've seen a couple of instances of false sharing when accessing
>> fields from the beginning and the end of the PSPromotionManager
>> instances. This both decreases the performance of the Parallel
>> Scavenge young GC and makes it hard to do reliable GC benchmarks on
>> bigger machines.
>> This was first seen in:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7196911 : command
>> line length affects performance
>> The patch makes sure that each PSPromotionManager starts at a
>> cache-line-aligned address and is padded to have a cache-line-aligned
>> It doesn't use the exiting Padded<T> class, since it (unnecessarily)
>> wastes too much memory, but instead introduces a PaddedEnd<T> class.
>> This class only pads enough to get the cache-line-aligned size and
>> it's up to the user to align the start of the instance. This works
>> well in this specific case, where all the PSPromotionManagers are
>> together in an Array. A PaddedArray<T> class was added to hide the
>> memory layout code.
>> 1) JPRT
>> 2) SPECjbb2005 - 2 socket, 8 core, HT machine on JDK8-b57 + recent
>> HotSpot + the patch
>> -showversion -Xmx29g -Xms29g -Xmn27g -XX:SurvivorRatio=60
>> -XX:TargetSurvivorRatio=90 -XX:ParallelGCThreads=16
>> -XX:AllocatePrefetchDistance=256 -XX:AllocatePrefetchLines=4
>> -XX:LoopUnrollLimit=45 -XX:InitialTenuringThreshold=12
>> -XX:MaxTenuringThreshold=15 -XX:InlineSmallCode=4300
>> -XX:MaxInlineSize=270 -XX:FreqInlineSize=2700 -XX:+AggressiveOpts
>> -XX:+UseParallelOldGC -XX:-UseAdaptiveSizePolicy -XX:+PrintGC
>> Young GC times without cache aligned PSPromotionManager (ms):
>> with cache aligned PSPromotionManager:
>> Extra thanks goes to Claes Redestad for helping out with performance
>> analysis and implementation-detail discussions.
More information about the hotspot-gc-dev