review request for 6784100
Xiaobin.Lu at Sun.COM
Fri Dec 19 12:20:56 PST 2008
6784100: getTimeNanos - CAS reduction
getTimeNanos() is one of the hot methods for benchmarks such as Volano
or SPECjbb. To ensure every calling threads to get most up-to-date time,
the current implementation makes each thread to call CAS in a loop until
the operation succeeds to set the global max_hrtime on Solaris. Usually,
one CAS call succeeds. However, under systems having many cores and
application has tons of threads, that call may need to be tried couple
times, hence, performance may suffer.
The fix is to just call CAS once and if it fails, we just use the
current max_hrtime as the return result of getTimeNanos. If it succeeds,
we can safely use the most up-to-date time. Performance measurement
shows that on batoka system, volano client score improves about 5-6% on
15 runs. I am still running SPECjbb2005 to see whether we could observe
any improvement there. The micro-benchmark shows that within certain
amount of time, the calls getTimeNanos() doubles with the fix.
Contributed by: Dave Dice
JPRT (in progress).
More information about the hotspot-dev