public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] don't udelay() in sn_mmiob
Date: Thu, 27 May 2004 21:29:41 +0000	[thread overview]
Message-ID: <16566.24005.529238.412533@napali.hpl.hp.com> (raw)
In-Reply-To: <200405261749.02254.jbarnes@engr.sgi.com>

>>>>> On Thu, 27 May 2004 17:06:31 -0400, Jesse Barnes <jbarnes@engr.sgi.com> said:

  Jesse> On Thursday, May 27, 2004 4:46 pm, David Mosberger wrote:

  >> Wouldn't you want at least a cpu_relax() in that loop?

  Jesse> That'll cause the CPU to switch to the other thread if it's
  Jesse> SMT so it won't spin waiting for the access to complete?  If
  Jesse> so, then yes.

It is simply good practice to always use cpu_relax() in busy-loops.
It'll make sure the compiler doesn't get too clever (thanks to the
implied barrier()) and ensures that the CPU doesn't go nuts on the
busy-loop (e.g., a Pentium 4 core might overheat).  In the case
of ia64, cpu_relax() results in a "hint @pause" instruction which
is specified as:

 "Indicates to the processor that the currently executing stream is
  waiting, spinning, or doing low priority tasks.  This hint can be
  used by the processor to allocate more resources or time to another
  executing stream on the same processor."

	--david

  parent reply	other threads:[~2004-05-27 21:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 21:49 [PATCH] don't udelay() in sn_mmiob Jesse Barnes
2004-05-27 20:46 ` David Mosberger
2004-05-27 21:06 ` Jesse Barnes
2004-05-27 21:29 ` David Mosberger [this message]
2004-05-28 17:28 ` Jack Steiner
2004-05-28 17:35 ` Jack Steiner
2004-05-29  0:57 ` Seth, Rohit
2004-05-29 14:31 ` Jack Steiner

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=16566.24005.529238.412533@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.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