x86 - cpu_relax - why nop vs. pause?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Breuer
Date: Sunday, February 7, 2010 - 10:28 am

I did search and noticed some old discussions. Looking at both Intel and 
AMD documentation, it would seem that PAUSE is the preferred instruction 
within a spin lock. Further, both Intel and AMD specifications state 
that the instruction is backward compatible with older x86 processors.

For fun, I changed nop to pause on my core i7 920 (smt enabled) and I'm 
seeing about a 5-10% performance improvement on 2.6.33 rc7. Perf top 
shows time spent in spin_lock under load drops from an average of around 
35% to about 25%.

Thoughts?
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86 - cpu_relax - why nop vs. pause?, Michael Breuer, (Sun Feb 7, 10:28 am)
Re: x86 - cpu_relax - why nop vs. pause?, Joerg Roedel, (Sun Feb 7, 11:09 am)
Re: x86 - cpu_relax - why nop vs. pause?, Arjan van de Ven, (Sun Feb 7, 11:32 am)
Re: x86 - cpu_relax - why nop vs. pause?, Michael Breuer, (Sun Feb 7, 1:08 pm)
Re: x86 - cpu_relax - why nop vs. pause?, Michael Breuer, (Sun Feb 7, 2:15 pm)
Re: x86 - cpu_relax - why nop vs. pause?, Michael Breuer, (Sun Feb 7, 8:50 pm)
Re: x86 - cpu_relax - why nop vs. pause?, Artur Skawina, (Mon Feb 8, 6:33 am)