Re: cpu_relax(), rep: nop, and PAUSE

2013-02-20 Thread Rainer Müller
On 2013-02-19 13:20, David Shwatrz wrote: We have: #define cpu_relax() asm volatile(rep; nop) in arch/x86/boot/boot.h. Why don't we use the PAUSE assembler instruction here ? If you dig further into the Intel x86 manual, the machine instructions 'pause' and 'rep;nop' actually use the

Re: cpu_relax(), rep: nop, and PAUSE

2013-02-19 Thread Mulyadi Santosa
On Tue, Feb 19, 2013 at 7:20 PM, David Shwatrz dshwa...@gmail.com wrote: Hi, kernel newbies, We have: #define cpu_relax() asm volatile(rep; nop) in arch/x86/boot/boot.h. Why don't we use the PAUSE assembler instruction here ? Just guessing, maybe rep+nop could do better power saving

Re: cpu_relax(), rep: nop, and PAUSE

2013-02-19 Thread Valdis . Kletnieks
On Wed, 20 Feb 2013 01:58:17 +0700, Mulyadi Santosa said: On Tue, Feb 19, 2013 at 7:20 PM, David Shwatrz dshwa...@gmail.com wrote: Hi, kernel newbies, We have: #define cpu_relax() asm volatile(rep; nop) in arch/x86/boot/boot.h. Why don't we use the PAUSE assembler instruction

Re: cpu_relax(), rep: nop, and PAUSE

2013-02-19 Thread Adam Lee
On Tue, Feb 19, 2013 at 02:20:11PM +0200, David Shwatrz wrote: Hi, kernel newbies, We have: #define cpu_relax() asm volatile(rep; nop) in arch/x86/boot/boot.h. Why don't we use the PAUSE assembler instruction here ? But rep_nop and pause ought to be the same, why we change it? If it