Review request: 8022880: False sharing between PSPromotionManager instances
stefan.karlsson at oracle.com
Tue Aug 13 04:38:57 PDT 2013
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 size.
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.
2) SPECjbb2005 - 2 socket, 8 core, HT machine on JDK8-b57 + recent
HotSpot + the patch
-showversion -Xmx29g -Xms29g -Xmn27g -XX:SurvivorRatio=60
-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