review request for 6784100
David Holmes - Sun Microsystems
David.Holmes at Sun.COM
Fri Dec 19 15:13:12 PST 2008
This looks ok to me.
It's somewhat sad that on a system where gethrtime never does the wrong
thing and is in fact monotonic, that we end up always doing the most
amount of work in getTimeNanos.
Xiaobin Lu said the following on 12/20/08 06:20:
> 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.
> Reviewed by:
> Contributed by: Dave Dice
> Verified by:
> JPRT (in progress).
More information about the hotspot-dev