public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86 - cpu_relax - why nop vs. pause?
@ 2010-02-07 17:28 Michael Breuer
  2010-02-07 18:09 ` Joerg Roedel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Breuer @ 2010-02-07 17:28 UTC (permalink / raw)
  To: Linux Kernel Mailing List

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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-08 13:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-07 17:28 x86 - cpu_relax - why nop vs. pause? Michael Breuer
2010-02-07 18:09 ` Joerg Roedel
2010-02-07 18:32 ` Arjan van de Ven
     [not found] ` <1265566470.6280.10.camel@marge.simson.net>
2010-02-07 20:08   ` Michael Breuer
2010-02-07 21:15     ` Michael Breuer
2010-02-08  3:50       ` Michael Breuer
2010-02-08 13:33         ` Artur Skawina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox