<p>Why would you not want a pause ins? I thought the point of it was to inform the CPU that you're busy spinning and not doing anything useful so it can make internal adjustments (e.g. scale down frequency on a mobile processor).</p>
<p>Thanks</p>
<p>Sent from my phone</p>
<div class="gmail_quote">On Aug 16, 2012 5:22 PM, "Daniel D. Daugherty" <<a href="mailto:daniel.daugherty@oracle.com">daniel.daugherty@oracle.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Win64, SpinPause() has been "return 0" since mid-2005. Way back<br>
when Win64 code was in os_win32_amd64.cpp:<br>
<br>
SCCS/s.os_win32_amd64.cpp:<br>
<br>
D 1.9.1.1 05/07/04 03:20:45 dice 12 10 00025/00000/00334<br>
MRs:<br>
COMMENTS:<br>
5030359 -- back-end synchonization improvements - adaptive spinning, etc<br>
<br>
When the i486 and amd64 cpu dirs were merged back in 2007, the code<br>
became like it is below (#ifdef'ed):<br>
<br>
D 1.32 07/09/17 09:11:33 sgoldman 37 35 00264/00008/00218<br>
MRs:<br>
COMMENTS:<br>
5108146 Merge i486 and amd64 cpu directories.<br>
Macro-ized register names. Inserted amd64 specific code.<br>
<br>
Looks like on Linux-X64, the code has used the PAUSE instruction<br>
since mid-2005:<br>
<br>
D 1.3 05/07/04 03:14:09 dice 4 3 00031/00000/00353<br>
MRs:<br>
COMMENTS:<br>
5030359 -- back-end synchonization improvements - adaptive spinning, etc<br>
<br>
We'll have to see if Dave Dice remember why he implemented<br>
it this way...<br>
<br>
Dan<br>
<br>
<br>
On 8/16/12 12:01 PM, Eric Caspole wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everybody,<br>
Does anybody know the reason why SpinPause is simply "return 0" on Win64 but uses PAUSE on Linux in a .s file?<br>
We would like to remove PAUSE from linux too.<br>
<br>
Thanks,<br>
Eric<br>
<br>
<br>
./src/os_cpu/windows_x86/vm/<u></u>os_windows_x86.cpp<br>
<br>
548 extern "C" int SpinPause () {<br>
549 #ifdef AMD64<br>
550 return 0 ;<br>
551 #else<br>
552 // pause == rep:nop<br>
553 // On systems that don't support pause a rep:nop<br>
554 // is executed as a nop. The rep: prefix is ignored.<br>
555 _asm {<br>
556 pause ;<br>
557 };<br>
558 return 1 ;<br>
559 #endif // AMD64<br>
560 }<br>
<br>
<br>
src/os_cpu/linux_x86/vm/linux_<u></u>x86_64.s<br>
<br>
63 .globl SpinPause<br>
64 .align 16<br>
65 .type SpinPause,@function<br>
66 SpinPause:<br>
67 rep<br>
68 nop<br>
69 movq $1, %rax<br>
70 ret<br>
<br>
<br>
</blockquote>
</blockquote></div>