[aarch64-port-dev ] RFR: 8186671: Use `yield` instruction in SpinPause on linux-aarch64
Andrew Haley
aph at redhat.com
Wed Aug 23 16:32:11 UTC 2017
On 23/08/17 17:07, Dmitry Chuyko wrote:
> Please review a change in SpinPause implementation.
>
> related study:
> http://cr.openjdk.java.net/~dchuyko/8186670/yield/spinwait.html
> rfe: https://bugs.openjdk.java.net/browse/JDK-8186671
> webrev: http://cr.openjdk.java.net/~dchuyko/8186671/webrev.00/
>
> The function was moved to platform .S file and now contains yield
> instruction.
Re the use of YIELD for onSpinWait(), I think this probably would be a
mistake: Intel's PAUSE is intended to improve the performance of
spin-wait loops, whereas ARM's YIELD is intended to hint that the task
performed by a thread is of low importance so that it could yield.
So, despite that the instructions superficially look similar, they
have diametrically opposite semantics! But we won't really know if
YIELD will make a spin loop faster until somebody implements it.
Re the use of yield in SpinPause(): this looks correct to me. OK.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list