Inlining SpinPause
Jungwoo Ha
jwha at google.com
Tue Jul 15 23:42:30 UTC 2014
Hi,
We observed that inlining PAUSE instruction on x86 actually makes some
noticeable difference when hyper-threading is on. (And that is the
recommended way of using PAUSE by Intel)
I think this is either the effect of saving branch forwarding in HT
pipeline or giving more cycles to the other threads that is not spinning on
the same core.
While trying to fix it, it is difficult to make global SpinPause
(hand-written assembly) without moving it under os:: namespace or someplace
else.
On os.hpp, I see the comment that SpinPause should be moved to
Atomic::SpinPause.
If I move SpinPause to Atomic:: and make it inlineable on x86, would that
be a change you guys are interested?
--
Jungwoo Ha
More information about the hotspot-runtime-dev
mailing list