From: adam8157@gmail.com (Adam Lee)
To: kernelnewbies@lists.kernelnewbies.org
Subject: cpu_relax(), rep: nop, and PAUSE
Date: Wed, 20 Feb 2013 11:35:42 +0800 [thread overview]
Message-ID: <20130220033542.GA9926@adam-laptop> (raw)
In-Reply-To: <CAJJAcocc9FbgAUjRED_0iLt=iz58CrZf=hmSKZf91XANz+cgJw@mail.gmail.com>
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
next prev parent reply other threads:[~2013-02-20 3:35 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 [this message]
2013-02-20 21:18 ` Rainer Müller
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=20130220033542.GA9926@adam-laptop \
--to=adam8157@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).