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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
ain't broke, don't fix it."

You can see that by disassembling, they both are "f3 90", "f3" is rep,
"90" is nop.

> And AFAIK, in spinlocks , PAUSE indeed replaced the rep;nop.

Where? I haven't found that.

-- 
Regards,
Adam Lee
http://adam8157.info

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux