Pls review 7023931 (S)

Paul Hohensee paul.hohensee at oracle.com
Fri Mar 11 12:14:53 PST 2011


7023931: PcDescCache::find_pc_desc should not write _last_pc_desc

http://cr.openjdk.java.net/~phh/7023931/webrev.00/

The nmethod PcDescCache cached the last looked-up descriptor in a shared
field called _last_pc_desc.  This is fine in a single-threaded environment,
but in a multi-threaded, multi-socket enviroment, frequent writes cause
"block bouncing".  I.e., the cache line containing _last_pc_desc is 
constantly
being moved among the caches on different sockets.  This process hurts
stack walking performance, especially on multi-socket Intel systems.

The fix is to eliminate _last_pc_desc and use _pcdescs[0] instead.  The 
latter
is written only once when it's added to the cache, avoiding the block
bouncing issue.  Use of _pcdescs[0] instead of _last_pc_desc means that
there are slightly few "hits", but that doesn't seem to affect performance.

Tested using SPECjvm2008's serial sub-benchmark and full nsks.

Thanks,

Paul



More information about the hotspot-runtime-dev mailing list