All of lore.kernel.org
 help / color / mirror / Atom feed
From: raimue@codingfarm.de (Rainer Müller)
To: kernelnewbies@lists.kernelnewbies.org
Subject: cpu_relax(), rep: nop, and PAUSE
Date: Wed, 20 Feb 2013 22:18:16 +0100	[thread overview]
Message-ID: <kg3eik$ank$1@ger.gmane.org> (raw)
In-Reply-To: <CAJJAcocc9FbgAUjRED_0iLt=iz58CrZf=hmSKZf91XANz+cgJw@mail.gmail.com>

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 exact same encoding. As some
older assembler might not know the 'pause' mnemonic, using 'rep;nop'
here is most probably for backwards compatibility.

Rainer

      parent reply	other threads:[~2013-02-20 21:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 12:20 cpu_relax(), rep: nop, and PAUSE David Shwatrz
2013-02-19 18:58 ` Mulyadi Santosa
2013-02-19 21:41   ` Valdis.Kletnieks at vt.edu
2013-02-20  3:35 ` Adam Lee
2013-02-20 21:18 ` Rainer Müller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='kg3eik$ank$1@ger.gmane.org' \
    --to=raimue@codingfarm.de \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.